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

Re: PDF::API2 question in images

by jds17 (Pilgrim)
on Jul 01, 2008 at 20:55 UTC ( #695025=note: print w/ replies, xml ) Need Help??


in reply to PDF::API2 question in images

The image L.png is missing because you don't start a new page before adding the jpeg, so the jpeg ends up covering the png.

You can control the image size e.g. by using an art box. The positioning can be taken care of using the image method (taking as parameters the image, the left x coordinate, the lower y coordinate and a scaling factor). To get the desired result in your program, please check replacing the lines starting with "foreach my $img (@imgs) {..." by the following code, using example coordinates $min_x, $min_y for better illustration:

my $min_x = 150; my $min_y = 100; foreach my $img (@imgs) { $page=$pdf->page; $page->artbox(0, 0, $img->width,$img->height); $gfx=$page->gfx; $gfx->image($img, $min_x, $min_x, 1); } $page=$pdf->page; $page->artbox($jpeg->width,$jpeg->height); $gfx=$page->gfx; $gfx->image($jpeg, $min_x, $min_y, 1); $pdf->save; $pdf->end();
I feel the module's documentation on CPAN is quite good, besides there are wrapper modules if you want a simpler interface (e.g. PDF::API2::Simple). Also, PDF is a well documented standard, so you can use its documentation, and since PDF::API2 does not rename entities, you should be able to look up things in case the module's documentation is not sufficient.


Comment on Re: PDF::API2 question in images
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://695025]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2014-07-31 03:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (244 votes), past polls