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.

In reply to Re: PDF::API2 question in images by jds17
in thread PDF::API2 question in images by ndnalibi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.