Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2018-08-18 06:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Asked to put a square peg in a round hole, I would:









    Results (185 votes). Check out past polls.

    Notices?