aashish_shah
2011-03-17 17:30:21 UTC
Can someone let me know how to create a pdf file by importing all the
images from a tiff (tagged image file format) file having multiple
pages. I tried with the image_tiff() api call from PDF::API2 module but
it is importing only the 1st page instead of importing all the pages.
Here's the sample program which I tried.
<code>
use PDF::API2 #image file having multiple pages of images. my
$image_file = "multi_image.tiff"; my $pdf = PDF::API2->new(-file =>
"$0.pdf"); #add a blank page. my $page = $pdf->page(); #adding a content
object for pictures. my $image_content = $page->gfx; #get a tiff image
object. my $tiff = $pdf->image_tiff($image_file); #adding image at (0,0)
x, y coordinates $image_content->image($tiff, 0, 0, 300, 300);
$pdf->save(); $pdf->end();
</code>
images from a tiff (tagged image file format) file having multiple
pages. I tried with the image_tiff() api call from PDF::API2 module but
it is importing only the 1st page instead of importing all the pages.
Here's the sample program which I tried.
<code>
use PDF::API2 #image file having multiple pages of images. my
$image_file = "multi_image.tiff"; my $pdf = PDF::API2->new(-file =>
"$0.pdf"); #add a blank page. my $page = $pdf->page(); #adding a content
object for pictures. my $image_content = $page->gfx; #get a tiff image
object. my $tiff = $pdf->image_tiff($image_file); #adding image at (0,0)
x, y coordinates $image_content->image($tiff, 0, 0, 300, 300);
$pdf->save(); $pdf->end();
</code>