Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: PDF::API2 page margin

by shibu_pu (Acolyte)
on Apr 18, 2009 at 07:03 UTC ( [id://758414]=note: print w/replies, xml ) Need Help??


in reply to Re: PDF::API2 page margin
in thread PDF::API2 page margin

I tried cropbox. But I am not getting the pdf as my requirement. I am putting an image on the pdf's 1st page. The image is of size 612 x 792. On the pdf, I need a margin of 50 px on all the top, bottom, left and right. When I tried cropbox instead of mediabox, its the same result. #!/usr/bin/perl use CGI; use PDF::API2; my $q = new CGI; my $pdf = PDF::API2->new(); print $q->header( -type => 'application/x-pdf', -attachment => "test.pdf" ); my $page = $pdf->page; $page->mediabox(612, 792); my $gfx = $page->gfx; my $image = $pdf->image_jpeg("test.jpg"); $gfx->image($image); print $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://758414]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-04-19 06:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found