Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Problems adding EPS file to PostScript::Simple

by ksublondie (Friar)
on Feb 21, 2011 at 23:03 UTC ( #889498=perlquestion: print w/replies, xml ) Need Help??
ksublondie has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks!

I've created a dynamic postscript document with PostScript::Simple and am able to successfully create a pdf using PostScript::Convert and/or by opening the ps document in Adobe.

However, when I attempt to import an EPS logo, I get the following errors when running my perl script:

Ghostscript failed: exit status 1 at /usr/local/share/perl/5.10.0/Post +Script/ line 302 PostScript::Convert::convert_fh('File::Temp=GLOB(0x9dd3c00)', 'HASH(0x +9beda00)') called at /usr/local/share/perl/5.10.0/PostScript/Convert. +pm line 186 PostScript::Convert::convert_ref('SCALAR(0x9dce118)', 'HASH(0x9beda00) +') called at /usr/local/share/perl/5.10.0/PostScript/ line +87 PostScript::Convert::psconvert('SCALAR(0x9dce118)', 'filename', 'fileB +53331AF-6526-8804-3B37-68F2EFC8F14A.pdf', 'format', 'pdf') called at +/var/www/perl/modules/Intranet/FirstFarm/ line 159
...and when I try to open the ps file through Adobe, I get the following errors in the dialog box:
Acrobat Distiller 8.0 Started: Monday, February 21, 2011 at 16:33:43 Adobe PostScript software version: 3016.102 CID support library initialization completed. Error in PDFX4 2007.joboptions: /CheckCompliance out of range Start Time: Monday, February 21, 2011 at 16:34:08 Source: Destination: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\scp32583\fileB53331AF- +6526-8804-3B37-68F2EFC8F14A.pdf Adobe PDF Settings: C:\Documents and Settings\All Users\Application Da +ta\Adobe\Adobe PDF\Settings\Standard.joboptions %%[ Error: undefined; OffendingCommand: ]%% %%[ Flushing: rest of job (to end-of-file) will be ignored ]%% %%[ Warning: PostScript error. No PDF file produced. ] %% Distill Time: 00 Hour(s) : 00 Minute(s) : 00.109 Second(s) **** End of Job ****
So I'm assuming there is nothing wrong with my GS installation if Adobe is having issues as well.

I've tried importing a blank EPS file created w/Illustrator along with several different EPS files all with the same result. The only concusion I can come up with is that either all my EPS files are jacked or there's something wrong with my perl, but since I've followed the documentation on how to import the EPS, I'm at a loss.

Here's my perl code:

my $ps = new PostScript::Simple(papersize => "Letter", colour => 1, eps => 0, units => "pt"); $ps->newpage; $ps->setcolour("black"); $ps->setlinewidth( 1 ); #I've tried both of the following methods #my $image = new PostScript::Simple::EPS(file => "test2.eps"); #$ps->importeps( $image, 300,300) ; $ps->importepsfile( "test.eps", 5,1,6,6) ; ... #$Id is set in the sub parameters $ps->output("file$"); my $text=$ps->get; psconvert(\$text,filename=>"file$Id.pdf",format=>'pdf');
Does anyone have any ideas on how I can get this to work?

Replies are listed 'Best First'.
Re: Problems adding EPS file to PostScript::Simple
by Eliya (Vicar) on Feb 22, 2011 at 00:05 UTC
    %%[ Error: undefined; OffendingCommand: ]%%

    The "offending command" (C5 D0 D3 C6 in hex) is the typical identifying characteristic of an EPS file containing a TIFF/WMF preview thumbnail (see Identifying EPS files).

    Not all tools can handle such extended EPS files correctly, so the above ID may end up being mistakenly interpreted as a Postscript command.  You could try either creating the EPS file(s) anew without a preview image, or use something like epstool to extract the pure-EPS content from your existing EPS files.

      Perfect! Finally got it to work. Thanks!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://889498]
Approved by ww
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2018-05-23 19:51 GMT
Find Nodes?
    Voting Booth?