Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://695025]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (2)
As of 2018-03-25 01:36 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (299 votes). Check out past polls.