简体   繁体   中英

How can I add an image at a specific X, Y location using Perl's PDF::API2?

I'm using Perl's PDF::API2 module to create a PDF document and I need to add an PNG image at a specific X,Y location on the page.

How do I do this?

Actually I worked it out:

# grab a text object - we are missing fonts?
my $gfx = $page->gfx;

my $image = $self->pdf->image_png('/tmp/logo.png');

# add the image to the graphic object - x, y, width, height  
$gfx->image($image, 24, 815, 102, 29);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM