hi!
>I tried some code I found that uses Text/PDF/API/Image.pm to create an image
>from a file but when I use that I get this error:
>
>Can't locate Text/PDF/API/Image.pm in @INC
Text::PDF::API is ages old (1998?) module code long out of service.
the basic code readslike this:
#!/usr/bin/perl
use PDF::API2;
$pdf=PDF::API2->new;
$img=$pdf->image_tiff($imagefilepath);
$page = $pdf->page;
$gfx=$page->gfx;
$gfx->image($img,$lowerLeftX,$lowerLeftY,$scale);
$pdf->saveas("$0.pdf");
$pdf->end();
exit;
__END__
you can use other image_* methods as documented
by 'perldoc PDF::API2' which reads:
#=======================================================
IMAGE METHODS
$jpeg = $pdf->image_jpeg $file
Returns a new jpeg image object.
$tiff = $pdf->image_tiff $file
Returns a new tiff image object.
$pnm = $pdf->image_pnm $file
Returns a new pnm image object.
$png = $pdf->image_png $file
Returns a new png image object.
$gif = $pdf->image_gif $file
Returns a new gif image object.
$gdf = $pdf->image_gd $gdobj, %options
Returns a new image object from GD::Image.
Options: The only option currently supported
is "-lossless => 1".
Examples:
$jpeg = $pdf->image_jpeg('../some/nice/picture.jpeg');
$tiff = $pdf->image_tiff('../some/nice/picture.tiff');
$pnm = $pdf->image_pnm('../some/nice/picture.pnm');
$png = $pdf->image_png('../some/nice/picture.png');
$gif = $pdf->image_gif('../some/nice/picture.gif');
$gdf = $pdf->image_gd($gdobj);
#=======================================================
cheers,
--
__ _
/ _|_ __ ___ __| | ___ unix, linux, freebsd
| |_| '__/ _ \/ _` |/ _ \ jpeg, png, gif, ppm
| _| | | __/ (_| | (_) | apache, perl, php, mysql
|_| |_| \___|\__,_|\___/ pdf, ps, abw, html, pod
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/dpFolB/TM
--------------------------------------------------------------------~->
To unsubscribe from this group, send an email to:
perl-text-pdf-modules-unsubscribe-Km8ibD4bFueDmjp1MlKEbA@xxxxxxxxxxxxxxxx
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/perl-text-pdf-modules/
<*> To unsubscribe from this group, send an email to:
perl-text-pdf-modules-unsubscribe-hHKSG33TihhbjbujkaE4pw@xxxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|