views:

166

answers:

2

Is there a test suite for PDFs, preferably in Perl? What I want is some function to test positioning and existence of some text (and if possible a name of a grapic) in a PDF file. Is this theoritically possible with PDF markup?

Thank you for your help.

+2  A: 

I don't think there is anything pre-built on the CPAN, but Test::Builder and CAM::PDF should allow you to write what you want.

Once you get it working, upload it to the CPAN... and then there will be a way to test PDFs on the CPAN :)

jrockway
+1  A: 

As jrockway said, there's not a 100% solution available today. With my CAM::PDF library, you can compute positions for any element in the document. See my answer to "How do I get character offset information from a pdf document?" which shows how to extract coordinates for all text on a page.

Chris Dolan