Today we are very excited to introduce version 6.10.0 of PDFTron's Android PDF SDK. This release includes a new file comparison UI, a new page label editor, a new OCG layer browser, and much more. This blog post will go through the major changes in 6.10.0. For the full list of changes, please head over to our changelog for PDFTron 6.10.0 for Android.

linkFile comparison UI

With this release, it is now possible to visually compare pages from 10+ file formats, including PDF, Word, Excel, and Images. This resolution independent comparison allows you to quickly spot differences between pages.

  • PDF, PDF/A
  • MS Office: DOCX, XLSX, PPTX, DOC
  • Images: JPG, TIF, BMP, GIF, SVG, EMF
  • HTML

A new out-of-box UI component is available for you to quickly add this functionality to your application.

Here's the code snippet:

public void show(final Context context, FragmentManager fragmentManager, final ArrayList<Uri> files) {
    DiffOptionsDialogFragment fragment = DiffOptionsDialogFragment.newInstance(
        files.get(0), files.get(1)
    );
    fragment.setStyle(DialogFragment.STYLE_NORMAL, R.style.CustomAppTheme);
    fragment.setDiffOptionsDialogListener(new DiffOptionsDialogFragment.DiffOptionsDialogListener() {
        @Override
        public void onDiffOptionsConfirmed(int color1, int color2, int blendMode) {
            compareFiles(context, files, color1, color2, blendMode);
        }
    });
    fragment.show(fragmentManager, DiffOptionsDialogFragment.TAG);
}

Here's a preview:

See detailed tutorial here:

linkPage label editor

PDF page labels can be used to describe a page. This is used to allow for non-sequential page numbering or the addition of arbitrary labels for a page (such as the inclusion of Roman numerals at the beginning of a book).

A new out-of-box UI component is now available for editing page labels.

Here's the code snippet:

PageLabelDialog dialog = PageLabelDialog.newInstance(fromPage, toPage, pageCount);
dialog.setStyle(DialogFragment.STYLE_NO_TITLE, R.style.CustomAppTheme);
dialog.show(fragmentManager, PageLabelDialog.TAG);

Here's a preview:

See detailed tutorial here:

linkOCG layer browser

PDF OCG (Optional Content Groups) dictionary represents a collection of graphic objects that can be made visible or invisible. Any graphic content of the PDF can be made optional, including page contents, XObjects, and annotations.

A new out-of-box UI component is now available for browsing OCG layers associated with the document. You can selectively render layers based on their states.

Here's the code snippet:

PdfLayerDialog pdfLayerDialog = new PdfLayerDialog(
    activity, pdfViewCtrl);
pdfLayerDialog.show();

Here's a preview:

See detailed tutorial here:

linkAnd more...

For a full list of changes, please see the changelog for PDFTron 6.10.0 for Android.

We hope you like these changes and any feedback is greatly appreciated. Please don't hesitate and contact us if you have any questions or suggestions. We also have many exciting new features planned for the coming weeks and months. Stay tuned...