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
  • 129,424
  • 31
  • 207
  • 592
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
  • 42,082
  • 9
  • 61
  • 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,905
  • 2
  • 35
  • 73