UnitTesting comparison between two pdf streams

Hi,


I wanted to build a unit test that generates a pdf and compares it to a previously generated and approved pdf, but comparing two streams of the same exact process shows that the files are not the same (probably because of file info differences?)
Do you have any idea how to succesfully compare the two memory streams that where created by the same exact process?

Hope I was able to explain my self.

D’vir

Hi D’vir,


Thanks for contacting support.

Currently Aspose.Pdf does not support the feature to compare two PDF documents. However we suggest you to please try using ComparisonApp of our sister company named GroupDocs.

Should you have any further query, please feel free to contact.

The question is not how to compare documents but rather how to compare Aspose PDFs.

Is it possible to create the pdf without the metada that makes the file uncomparable? How do I compare the file bytes without the metadata?

Hi D’vir,


Thanks for sharing the details.

As per my understanding, you need to generate PDF files without MetaData information. If so is the case, then you may consider using following code snippet to strip MetaData information (pass empty information). Set XMP Metadata in a PDF File.