Free Support Forum - aspose.com

PDF comparison

Hi,

I have searched through the forum and discovered a few threads related to the PDF comparison. May i know how is the progress related to PDF comparison feature for Aspose.PDF.dll ?

I am just curious, how does the Aspose development team performs unit test on the Aspose.PDF dll. Let's say based on the available data and word document template, the PDF result should have some kind of expected result. How can this be automated ? I mean how does Aspose development team use some kind of automated test to ensure that the result PDF is produced according to the specification.

Regards,

hadi teo

Hi Hadi,


Thanks for contacting support.

Please try using the following code snippet to compress the PDF document. During optimization process,
  1. Resources which are not used on the document pages are removed;
  2. Equal resources are joined into one object;
  3. Unused objects are deleted.
Now concerning to your query related to Unit testing, we have baseline documents for each functionality and we perform unit testing against each feature. During testing, the new document is compare with baseline documents.

Hi,

thanks for sharing the information related to the unit testing. What i am looking for is building an automated test by comparing the result of the PDF with the specification. Currently we are performing manual verification by eyeballing the documents. But with a huge number of variation tested, it will not be feasible for manual verification. That is the reason i am inquiring related to how do we automate the comparison of the PDF document.

Regards,

hadi teo

Hi Hadi,


The comparison of documents depends upon the objects/components present inside the file. Furthermore, we use some third party components/libraries for text and image comparison. If the resultant file contains text, we extract the text from PDF file and compare it with baseline text file. Furthermore, if there are images in PDF file, we extract the images and compare them with baseline images.

I have also inquired further details from development team and as soon as I have some updates, I would be more than happy to update you with the required information.

Hi,

Thanks very much for your reply. If it's not confidential, will you be able to share the third party components that you're using now ? If it's confidential, then it's fine not to share the details.

Please inform me if there are any further update. I am looking forward to it.

Regards,

hadi teo

Hi Hadi,


We use various components/tools for document comparison and I am afraid I might not be able to share the names of all components that we are using. However you may try using http://www.groupdocs.com/ (our sister company) as it provides the feature for document comparison. Or as I have shared earlier, in stead of performing eyeballing, you may convert the output documents into Image format and then compare the images suing some third-party components i.e. TestAPI etc.