Today we are very excited to introduce PDFTron 6.8 for Android. This release features new gradle package manager, new fully featured drop-in activity, new annotation style picker, new annotation syncing API, various customization APIs and much more. This blog post will go through the major changes in 6.8. For a full list of changes, please head over to our changelog for PDFTron 6.8 for Android.

Gradle package manager

With PDFTron 6.8 for Android, you will no longer have to copy native .so and .jar files to your project. Include the PDFTron and Tools libraries as:

implementation "com.pdftron:pdftron:6.8.+"
implementation "com.pdftron:tools:6.8.+"

into your app's build.gradle file. For details please see: Integrating PDFTron via Gradle package manager. You will also not miss any future updates since gradle will notify you when a package is updated.

DocumentActivity

With PDFTron 6.8 for Android, it is now possible to use a drop-in DocumentActivity right in your application. With the ability to view PDFs, office documents and image formats, DocumentActivity is a fully featured document reader and editor that follows Google material design guidelines. Out of the box, with DocumentActivity you can add/modify/delete/flatten annotations, add/delete/rearrange pages, fill/create forms, sign documents and much more.

It is also highly configurable via the newly introduced configuration class PdfFragmentConfig. For example, to start a DocumentActivity with single tab with editing disabled from a link, do:

PdfFragmentConfig.Builder builder = new PdfFragmentConfig.Builder();
PdfFragmentConfig config = builder
    .multiTabEnabled(false)
    .documentEditingEnabled(false)
    .build();
final Uri fileLink = Uri.parse("https://pdftron.s3.amazonaws.com/downloads/pdfref.pdf");
DocumentActivity.openDocument(context, fileLink, config);

Annotation style picker

Annotation style picker has been fully redone for a modern look with smooth animations and more powerful customization. This includes a number of presets, a collection of beautiful color palettes and the ability to enter HTML color codes.

The picker comes with the annotation toolbar by default and allows customization through various APIs.

Annotation syncing API

With PDFTron 6.8 for Android, you can sync annotations among different clients with ease. For example, to notify remote service about local changes:

mToolManager.enableAnnotManager("12345-67890-ABCD-EFGH", new AnnotManager.AnnotManagerListener() {
    @Override
    public void onLocalChange(String action, String xfdfCommand) {
        // a local annotation change event has happened,
        // now is the time to send the XFDF command string to your remote service
    }
});

Then upon a remote change has been received:

mToolManager.getAnnotManager().onRemoteChange(xfdfCommand);

That's it! The ToolManager will take care of the rest.

Customization

Although PDFTron always included complete UI source code for ultimate customizability, there was some interest for quick & easy programmtic tweaks to our drop-in compoents. With PDFTron 6.8 for Android, we are happy to introduce a number of new APIs that enable quick UI and Tools customizations that do not changes to the source code. Here are a few examples:

And more...

For a full list of changes, please see changelog for PDFTron 6.8 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 ahead, stay tuned.