Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: How to read page dimensions of pdf file

by polarius (Initiate)
on Jul 27, 2012 at 22:36 UTC ( [id://984112]=note: print w/replies, xml ) Need Help??


in reply to How to read page dimensions of pdf file

roboticus:

Thanks for the help. I used the Page object from PDF::API2.

Here's my basic code in case someone else needs to use something similar:

#!/usr/bin/perl use PDF::API2; my $filename="c:/filename.pdf"; my $pdf = PDF::API2->open("$filename"); for my $index (1 .. $pdf->pages) { my $page = $pdf->openpage($index); (my $llx, my $lly, my $urx, my $ury) = $page->get_mediabox; my $txt = $page->text; $txt->textlabel($urx-100, $ury-30, $pdf->corefont('Arial'), 12, 'a +dd text here'); } my $fileout = "c:/fileout.pdf"; $pdf->saveas("$fileout"); $pdf->end;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2024-04-25 09:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found