Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: Image errors with PDF::API2;

by djlerman (Sexton)
on Nov 16, 2021 at 18:54 UTC ( [id://11138906]=note: print w/replies, xml ) Need Help??


in reply to Re: Image errors with PDF::API2;
in thread Image errors with PDF::API2;

Thank You Ken. :-)

PDF::API2 -- 2.021
perl -- v5.10.1 (*) built for x86_64-linux-thread-multi
os -- CentOS release 6.5


Here is code:
use PDF::API2; use constant mm => 25.4 / 72; use constant in => 1 / 72; use constant pt => 1; # Create a blank PDF file my $pdf = PDF::API2->new(); # Add a blank page my $page = $pdf->page(); # Set the page size $page->mediabox('Letter'); $pdf->info( 'Author'=>'COPA', 'Title'=>'perl PDF API2 Test', ); $imageFile = "/home/images/test.png"; $img = $pdf->image_png($imageFile); $image = $page->gfx; $image->image($img, 0/mm, 100/mm); # print output $http_headers_out{'Content-Disposition'} = "inline; filename=pdfTes +t.pdf"; $http_headers_out{'Content-type'} = "application/pdf"; $escmode = 0; print OUT $pdf->stringify; $pdf->end;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-26 00:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found