I'd like to enlarge a PDF and save it as a JPG, and I found a similar
post (excerpt below) regarding EPS. But when I try a similar approach in
Perl, ImageMagick complains:

     use Image::Magick;
     my $p = new Image::Magick;
     $p->Set( 'density' => "300x300" );
     $p->Read( "doc.pdf" );
     $p->[0]->write("doc.jpg");

Results in the following:

     ERROR: /undefined in --get--
     Operand stack:
             --dict:6/6(L)--   F2   10   --dict:5/8(L)--
--dict:5/8(L)--   --dict:5/8(L)--   Subtype
     Execution stack:
        %interp_exit   .runexec2   --nostringval--   --nostringval--
--nostringval--   2   %stopped_push   --nostringval--   --nostringval--
--nostringval--   false   1   %stopped_push   1   3   %oparray_pop   1
3   %oparray_pop   1   3   %oparray_pop   --nostringval--
--nostringval--   3   1   2   --nostringval--   %for_pos_int_continue
--nostringval--   --nostringval--   --nostringval--   --nostringval--
%array_continue   --nostringval--   false   1   %stopped_push
--nostringval--   %loop_continue   --nostringval--   --nostringval--
--nostringval--
     Dictionary stack:
        --dict:1142/3371(ro)(G)--   --dict:0/20(G)--
--dict:107/200(L)--   --dict:107/200(L)--   --dict:104/127(ro)(G)--
--dict:241/347(ro)(G)--   --dict:20/24(L)--   --dict:4/6(L)--
--dict:24/31(L)--
     Current allocation mode is local
     Last OS error: 2
     ESP Ghostscript 8.15.3: Unrecoverable error, exit code 1
     Can't call method "write" on an undefined value at ./split-image
line 21.


However, if I run the exact same script on the same document and set the
density to 72x72 or anything less, there are no complaints, but the
document has not been enlarged. If I open the document in Adobe Reader,
I can zoom to 3200% with great clarity of fonts, but if I use
PerlMagick's Resize function, the image is first rasterized, then
resized, and the resulting image loses the sharp edges on the fonts.

Does anyone know how to accomplish this?

Ryan

>>>>>>>>> PREVIOUS POST >>>>>>>>>>>>>

[magick-users] Re: Enlarge EPS to JPG
Oliver Hirschi ohirschi at pm-medici.ch  
Wed Jun 23 23:28:30 PDT 2004

I have solved the problem...

The thing is, that I have to set the density befor reading the EPS:
-------------------------------
Image image;
image.density("300x300");
image.read(m_sSourceFile)
image.transform(m_sGeometry);
image.quality(m_iQuality);
image.write(m_sDestFile);
-------------------------------

...

Thanks & Regards, Oli


"Oliver Hirschi" <ohirschi at pm-medici.ch> schrieb im Newsbeitrag
> Hi guys,
>
> I would like to enlarge an EPS to JPG using ImageMagick 5.5.7, but the
> result-jpg is not really good quality.

...

_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to