8

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.

brian d foy
  • 124,803
  • 31
  • 200
  • 568
Thushan
  • 348
  • 1
  • 4
  • 14

2 Answers2

4

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
  • 40,927
  • 8
  • 60
  • 86
4

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.

Community
  • 1
  • 1
Chris Dolan
  • 8,797
  • 2
  • 32
  • 73