Page 1 of 1

How to verify pdf content

Posted: Thu Dec 15, 2016 4:00 pm
by Speedboat
Hi

I have to automate a web application where a pdf file is created and viewable / downloadable.
1) How can I verify that the pdf is somehow correct
(if the pdf file is corrupt it depends from the browser and the plugin how this is displayed)
2) Can I get the number pages in the pdf by an universal way (for all browsers and plugins)
3) Is it possible to read some content of the pdf file (e. g. if a given string exists)

Currently (Ranorex 6.2.0) Ranorex sees only 1 large area, but no content.
With Firefox and the current plugin I am able to verify at least the number of pages from toolbar.
But this test is brittle and would run only on my machine.

Another workaround would be to download the file and convert it to text format by another tool or simply by ctrl-c and verify text in the clipboard.

If the pdf is not protected and selecting of text is possible - what are Ranorex built in possibilities?

Thanks for any suggestions
Speedboat

Re: How to verify pdf content

Posted: Thu Dec 15, 2016 4:09 pm
by odklizec
Hi,

It should be possible to read and validate the content of PDF file, but only if the PDF file has enabled "accessibility" option, as described here:
http://www.ranorex.com/forum/how-to-get ... tml#p25699
Also, as far as I remember, there was a problem with some PDF creators, which the element recognition may not work with PDF files created with something else than Adobe Acrobat.