comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Mac OS X: Creating PDF figures from within IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Mac OS X: Creating PDF figures from within IDL [message #49298] Fri, 14 July 2006 07:01
jm is currently offline  jm
Messages: 32
Registered: April 2003
Member
For those Mac users who have got into the habit of wanting all their
figures in PDF format (i.e for Pages, Keynote or TexShop), Ben Tupper's
PStoPDF procedure is very handy (see postings April 2005). The PStoPDF
procedure spawns a command that executes Apple's own pstopdf. It works
very well, but the PDFs don't seem to employ any compression. For
example, starting with a 200k EPS file, pstopdf creates a 200k PDF
whereas Omnigraffle can export a PDF 1/10 the size without any hint of
loss. There does not seem to be any way to enable compression
(loss-less or otherwise) in pstopodf.

The perl script epstopdf (which calls calls Ghostscript) [1] seemed a
promising alternative, but the compression offered is lossy (and the
PDFs are only a bit smaller than what Omnigraffle can export). There
are a plethora of options for Ghostscript. Wanting a 'quick fix'
rather that a lesson on Ghostscript settings, I was on the verge of
giving up when I stumbled on a post that recommended these options for
loss-less compression:
-dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode

I created a new myepstopdf file to include those options. The command:
myepstopdf --nocompress foo.eps
now produces compressed PDFs with no (sign of) loss.

So, a small modification to BTs PStoPDF procedure and all works well
from within IDL. Should you wish to do the same, the myepstopdf script
and (modified) PStoPDF procedure are here:

http://www.iesd.dmu.ac.uk/~jm/pickup/myepstopdf
http://www.iesd.dmu.ac.uk/~jm/pickup/pstopdf.pro

Just ensure that myepstopdf is executable and place it in a directory
traversed by 'path'. I really wasn't too bothered about the size of
PDFs until a report with 40+ figures (produced by TexShop) ended up
10Mb big. The exact same report is now of size 720k. All Keynote and
Pages 'packages' will be a lot smaller also.

-John Mardaljevic

[1] You should have everything necessary if TexShop is installed.

Dr. John Mardaljevic
Senior Research Fellow
Institute of Energy and Sustainable Development
De Montfort University
The Gateway
Leicester
LE1 9BH, UK

http://www.iesd.dmu.ac.uk/~jm
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: IDL and Macs. Speed is not only about squared roots
Next Topic: Re: negation operator

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 22:28:34 PDT 2025

Total time taken to generate the page: 0.63905 seconds