Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a test suite for PDF files?

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.

like image 866
Thushan Avatar asked Jan 12 '09 16:01

Thushan


People also ask

What is PDF testing?

PDF Testing requires a PDF file to actually be scanned and the contents verified – verifying the API that created the PDF file is usually not enough.

How do I check the contents of a PDF?

PDF Testing solutionApplitools PDF tester is a codeless utility that allows you to automate the PDF testing of your small or large documents using Visual AI and also allow for validation of the content in a page or a region across selected pages or all pages of the PDF.


2 Answers

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.

like image 82
Chris Dolan Avatar answered Nov 09 '22 13:11

Chris Dolan


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 :)

like image 29
jrockway Avatar answered Nov 09 '22 15:11

jrockway