Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
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 sharing their wisdom with the Monastery: (4)
As of 2024-07-22 06:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.