in reply to Including a PDF in Perl/Tk
If all you want is a preview window, then converting with ImageMagick to a thumbnail might be good. See Conver PDF to Image( JPG , JPEG , etc. ) and here is a simple converter. You can use IM blobs to avoid writing temp files, if needed. There are ways for Tk to directly display IM blobs; see Tk and ImageMagick
#!/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'=>'jpeg'); $img->Write(filename=>'zzzzimage.jpg'); __END__
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Including a PDF in Perl/Tk
by Joe_ (Beadle) on Jun 26, 2012 at 10:38 UTC | |
by zentara (Cardinal) on Jun 26, 2012 at 11:26 UTC | |
by Joe_ (Beadle) on Jun 26, 2012 at 19:15 UTC | |
|
Re^2: Including a PDF in Perl/Tk
by Joe_ (Beadle) on Jun 28, 2012 at 19:08 UTC | |
by zentara (Cardinal) on Jun 28, 2012 at 19:44 UTC |