We are building a new experience for our SmartBear Community.
This site is now read-only. You can still browse and search as usual. Learn More
This site is now read-only. You can still browse and search as usual. Learn More
Hello Lino
Can you include some code samples, or snippets of a code you implemented to verify PDF?
Thank youi
Hi,
The code depends on your actual needs.
There are several possible options discussed on this forum several times in different threads:
-- Like it is mentioned in the thread referenced above, you may use some third-party utility (e.g. pdfToText) to export the content of your pdf to the text file and use this file. Also Foxit PDF reader: https://community.smartbear.com/t5/TestComplete-Functional-Web/How-to-read-a-pdf-file-using-TestComplete/m-p/64842#M5563;
-- You may try to use MSAA like it is mentioned here: https://support.smartbear.com/viewarticle/65847/, https://community.smartbear.com/t5/TestComplete-Functional-Web/how-to-get-the-content-of-a-pdf-file-on-window/m-p/60189#M1721;
-- pdfbox library can be used as well: https://support.smartbear.com/articles/testcomplete/testing-pdf-files-with-testcomplete/, https://community.smartbear.com/t5/TestComplete-Desktop-Testing/Compare-pdf-files/m-p/122339, http://community.smartbear.com/t5/Functional-Web-Testing/Unable-to-read-pdf-dotNET-org-apache-pdfbox-pdmodel-PDDocument/td-p/94722, https://community.smartbear.com/t5/TestComplete-Functional-Web/Getting-exception-while-trying-to-read-PDF-file-using-pdfbox-dll/td-p/85511;
-- You may consider getting pictures of your pdf pages and visually validate them using, for example, the functionality provided by https://applitools.com/.
There is a further option ...
(I speak from experience .... I've done it!)
If you are only interested in lifting text snippets from a PDF document (to validate that an invoice contains a correct amount or something like that), you can use keyboard shortcuts to simply copy all the text from it into the clipboard, and the find, extract, and validate the parts your interested in.
Won't work on protected PDF docs.
But on a standard PDF doc, where you are only interested in text content, it's pretty easy and no need to install any extra "stuff".
You realise this thread is three years old right? And the guy you are asking has not logged into this forum since July?
Suspect you'll be lucky to get a response.
There is a far more up to date post here: https://community.smartbear.com/t5/TestComplete-Desktop-Testing/Reading-PDF-documents/m-p/131919#U131919
... which might contain slightly more up to date and relevant information.
Yes, I realized - but it's worth the try... :)
I will go through the link you sent.
Thank you