soubalaji has asked for the wisdom of the Perl Monks concerning the following question:

Hi to all,

I want to convert a pdf file to EPS. Is there any option to convert the PDF to EPS through coding.

Regards,
Balaji S

Replies are listed 'Best First'.
Re: PDF to EPS
by zentara (Cardinal) on Dec 06, 2008 at 17:26 UTC
    Here is a simple ImageMagic script. Remember the IM docs say that vector formats like pdf, svg, eps, etc are not handled the best way possible by IM, see IM and vector formats
    #!/usr/bin/perl use warnings; use strict; use Image::Magick; my $img = Image::Magick->new; $img->Read('zzimage.pdf'); $img->Rotate(-90); #if portrait/lanscape causes problem $img->set('magick'=>'eps'); $img->Write(filename=>'zzzzimage.eps'); __END__

    I'm not really a human, but I play one on earth Remember How Lucky You Are
Re: PDF to EPS
by zwon (Abbot) on Dec 06, 2008 at 12:43 UTC

    I looks like the job for ghostscript. You can use GSAPI for accessing it.

      I could not understand clearly. So could you please explain little more about pdftoeps convertion.

      Thankyou.
Re: PDF to EPS
by marto (Cardinal) on Dec 06, 2008 at 12:52 UTC
      imagemagick can be trouble (freeze/consume all memory ) with small pdf (3mb), so I split them up using PDF::Extract (dont bother with PDF::Xtract) before processing
Re: PDF to EPS
by hda (Chaplain) on Dec 06, 2008 at 17:23 UTC
    In *NIX systems there exists:

    pdf2ps

    and

    ps2eps

    May be you find them useful, calling them with "system"
      Iam using the windows platform. so kindly share your knowledge with any samples.
Re: PDF to EPS
by matze77 (Friar) on Dec 06, 2008 at 12:52 UTC

    Eventually you have to use something like ghostscript, a quick search for "pdf2eps" didnt help much maybe you find more pdf2eps. Perhaps there is something on CPAN (as already mentioned)

    hth MH
Re: PDF to EPS
by ww (Archbishop) on Dec 06, 2008 at 11:24 UTC
    Have you searched for a module to handle your conversion?

    If not, you may wish to search CPAN (or -- if running Windows -- try ppm search EPS or ppm search PDF). Depending on your skills with selecting search terms, you may also find the big G helpful.