Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re^2: PDF Parsing

by ademmler (Novice)
on Dec 03, 2007 at 16:55 UTC ( #654616=note: print w/replies, xml ) Need Help??

in reply to Re: PDF Parsing
in thread PDF Parsing

Hi Starky! Again me, as a "known monk" - same question. Can you give me an example how to parse PDF with PDF::API2? I want to find Xobjects and replace them . . . Would be great to here from you. Regards Alex PS: Sorry for my confusing usage of this forum.

Replies are listed 'Best First'.
Re^3: PDF Parsing
by Anonymous Monk on Jan 03, 2008 at 15:18 UTC
    Hi, figuring how to parse existing PDF files gave me headaches but reading PDF::API2::File's perldoc I figured it out. if you do something like my $foo = PDF::API2->open(bar.pdf);, the file structure is stored in $foo->{'pdf'}. Then you've got the Catalog (see pdf' specs) that you can parse to get objects indirect references (pages & annots or acroform) Once you've got an hash refering to the item you want to mess with you can use read_obj method like that : my $pdfapi = PDF::API2->open(foo.pdf); my $pdf = $pdfapi->{'pdf'}; my $object = $pdf->read_obj($indirect_reference_hashref);

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2020-09-28 06:18 GMT
Find Nodes?
    Voting Booth?
    If at first I donít succeed, I Ö

    Results (143 votes). Check out past polls.