Q: How can I turn on / off the comparison mode in Qoppa’s PDF editing component jPDFEditor?
A: The code below will change the view of the PDFEditorBean to a new comparison view with both the current document and a second document in the specified mode.
Comparing 2 documents by overlaying them:
// load a second document to PDFDocument doc = new PDFDocument("C:\\test.pdf"); // start compare overlay view pdfEditorBean.startCompare(doc, PDFEditorBean.MODE_COMPARE_OVERLAY, new CompareOverlayOptions()); |
Comparing 2 documents side by side:
// load a second document to PDFDocument doc = new PDFDocument("C:\\test.pdf"); // start side by side comparison view pdfEditorBean.startCompare(doc, PDFEditorBean.MODE_SIDEBYSIDE, new CompareOverlayOptions()); |
// Stops overlay comparison mode pdfEditorBean.stopCompareOverlay(); |
// Stops side by side comparison mode pdfEditorbean.stopCompareSideBySide(); |
Live Demo and Source Sample
To see a live demonstration of the comparison feature in jPDFEditor and find the corresponding source code, download jPDFEditor Sample Demo Application which has buttons to start the comparison modes.
Licensing
Comparison is an optional add-on module to jPDFEditor. Please email us if you have any technical or licensing question about our Comparison module.