Posted on 2010-01-25 16:46:24.797258-08 by binarybits in response to 12240
Re: Manipulating XObjects

I played around with getPageContent, but it didn't seem to do what I wanted. For example, consider the following code:

my $pdf = CAM::PDF->new($infile); my $content = $pdf->getPageContent($pagenum); print $content;

If run on a particular PDF I'm trying to process, it produces the following output:

q 1 0 0 1 70 178.4801025 cm /Fm1 Do Q

If I'm reading the PDF spec correctly, the "/Fm1 Do" is an instruction to display the XObject named "Fm1" (not sure if that's the right terminology). My question is: is there a way to access to contents of this XObject? I think...

$pdf->getProperty($pagenum, 'Fm1');

...gives me a data structure describing this XObject, but I'm not sure how to extract the actual drawing commands, which is what I really need.

I hope that's clear. Thanks again!

-Tim

Direct Responses: 12242 | Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.