Other output formats (e.g. PNG) are much smaller, but I wish to retain
the vector information, as my ultimate aim is to convert the graphic
to a LaTeX compilable format, such as PGF/TikZ.
Thank you in advance,
Colin Rowat
Suppression would be something you'd select in Maple wouldn't it? That
would be a question for a Maple support forum.
If you want to remove extraneous material from the Postscript file
*after* it has been produced by Maple, it might be possible. I'd inspect
the produced Postscript using a text editor and then write a program (I
usually use Perl, but sometimes a good text editor suffices) to remove
the unwanted parts. I have done this in the past to reduce the size of
Postscript files. For example, by reducing the precision of coordinates
from e.g. ten significant digits to four.
> Other output formats (e.g. PNG) are much smaller, but I wish to retain
> the vector information, as my ultimate aim is to convert the graphic
> to a LaTeX compilable format, such as PGF/TikZ.
Does Maple support SVG? Maybe you could try that and compare the size of
the resultant file.
--
RGB
> Suppression would be something you'd select in Maple wouldn't it? That
> would be a question for a Maple support forum.
As yet, I've been unable to find any 'suppression' options via Maple,
but I am looking into this further.
> If you want to remove extraneous material from the Postscript file
> *after* it has been produced by Maple, it might be possible. I'd inspect
> the produced Postscript using a text editor and then write a program (I
> usually use Perl, but sometimes a good text editor suffices) to remove
> the unwanted parts. I have done this in the past to reduce the size of
> Postscript files. For example, by reducing the precision of coordinates
> from e.g. ten significant digits to four.
The eps2pgf conversion currently increases my file size by a factor of
10 (thus, to c. 60MB). Thus, while I might be able to make marginal
improvements in Postscript, I don't think that I'm skilled enough to
cut it down as seriously as I need.
> Does Maple support SVG? Maybe you could try that and compare the size of
> the resultant file.
Maple does not currently support SVG - it's on users' wish list,
though (q.v. http://www.mapleprimes.com/blog/acer/pollchangemapleyouwantmost).
I can, of course, convert from EPS to SVG (and then to PGF/TikZ with
inkscape2tikz), but don't know how reliable this is, or if this would
bring about the sort of size improvements that I need.
Again, thank you,
Colin
Ed
Thanks Ed. I can do that, and do get a smaller file than the PS (c.
2MB). Once I've got the PDF file, though, I'm still left with the
same problem of trying to make it (and especially its fonts) look
LaTeX compatible.
Best,
Colin
Coverting .ps to .pdf removes much that is not required to make marks
(apply ink to the page.) Then convert .pdf to .ps (for example, pdf2ps
from Ghostscript) to get something that can be edited. Then edit the
file, or write your own definitions of PostScript primitives that are
used by the 2nd-generation .ps file, to parse and translate into input
that is suitable for LaTeX.
--
Thanks John. I've just converted my 2MB PDF file back into PS, both
by using pswrite inside Ghostview, and by using pdf2ps from a DOS
box. In both cases, the output is about 12MB, much larger than my
original 7MB PS file. I've not used pdf2ps before, so there may be
compression options that I'm not aware of.
Best,
Colin
Here is a thread that discusses exactly this topic:
http://groups.google.com/group/comp.lang.postscript/browse_thread/thread/6e7b47e66f5ef784
Gernot Hoffmann gave all theoretically possible algorithms for the
task. The final pragmatic solution however was to raster the plot and
re-vectorize it. That's certainly quicker than writing a program for
the task or removing the invisible parts by hand in Adobe Illustrator
or Inkscape.
Thomas W.
Thank you Thomas - this does the trick. To re-vectorise, I don't have
Adobe Illustrator, so have used the online version of Vector Magic.
This creates a 200kb EPS file - very manageable - but does blur some
details which I'll have to clean up by hand. Again, though, that
seems manageable.
Best, and thank you again,
Colin