Q: We are looking for a .NET library for generating and comparing PDF documents.
We need to compare an “original” and a “revised” PDF document and show the differences between them. Ideally the library would be accessed by a web service we establish and would deliver a PDF of the highlighted changes back to the client. We are not looking for any UI components as these features would need to be fully integrated into another application.
A:
You can use PDFNet SDK (http://www.pdftron.com/pdfnet) for PDF generation, rendering, highlighting, and server side processing (http://www.pdftron.com/pdfnet/features.html).
For comparison, you would probably use pdftron.PDF.PDFDraw.GetBitmap() as shown in PDFDraw sample:
http://www.pdftron.com/pdfnet/samplecode.html#PDFDraw
Once you have images you can compare them with image diff utility (e.g. http://pdiff.sourceforge.net/, image magic, opencv, etc).
You can add highlights on existing PDF pages using ‘pdftron.PDF.Stamper’ (http://www.pdftron.com/pdfnet/samplecode.html#Stamper) or ElementBuilder/ElementWriter (see ‘How do I add a watermark to a page?’ in http://www.pdftron.com/pdfnet/faq.html). The later option offers more flexibility at the expense of extra coding.