Say hello to PSPDFKit 3.3 for Android! Our newest release of PSPDFKit for Android features a new document progress API, annotation note editing, extraction of markup text, secure video playback, and more. Check out this blog post in which we outline the biggest changes of the 3.3 release or see the changelog for all the details.
Document Progress API
Before PSPDFKit 3.3 for Android, it was the responsibility of your app to maintain the download of your PDF documents (or any other provisioning) and to show a progress UI to your users. With PSPDFKit 3.3 for Android, we introduce the
ProgressDataProvider interface which can be implemented by your custom
DataProvider to let it inform PSPDFKit about progress updates of your PDF download, file inflation, or decryption directly inside the
Check out the
ProgressProviderExample in our catalog app to see how simple it is to implement progress updates in your app – or dig into our new guide on providing
DataProvider progress updates.
Editing Annotation Notes
PSPDFKit 3.3 for Android catches up with our iOS framework and adds the possibility to edit the note content of all annotation types that support this. Simply tap a highlight annotation, a stamp annotation, or virtually any other annotation and select the note action in the editing toolbar. We’ve tweaked our existing note annotation editor to give your users a familiar interface while staying tailored to this new feature.
Extraction of Mark-Up Text
The API in 3.3 got a small but immensely useful new method: Extraction of text below markup annotations. Simply call
getHighlightedText() on any
TextMarkupAnnotation which will return the highlighted text, or
null if nothing was below the annotation.
val annotation = document.annotationProvider .getAnnotation(pageIndex, objectNumber) as HighlightAnnotation val highlightedText = annotation.highlightedText toast("You highlighted: $highlightedText")
final HighlightAnnotation annotation = (HighlightAnnotation) document .getAnnotationProvider() .getAnnotation(pageIndex, objectNumber); final String highlightedText = annotation.getHighlightedText(); Toast.makeText(context, "You highlighted: " + highlightedText, SHORT).show();
XFDF is an XML-like standard from Adobe XFDF for encoding annotations and forms. It is compatible with Adobe Acrobat and several other 3rd-party frameworks.
PSPDFKit for Android now supports both reading and writing XFDF files. The
XfdfFormatter class contains
writeXfdf() methods you can use to perform these operations, as well as their asynchronous counterparts
writeXfdfAsync() (recommended so you can easily offload parsing from the UI thread).
See guides for more: XFDF Support
Secure Video Playback
Playback of embedded videos has already been available since PSPDFKit 3.2 for Android – and videos linked with multimedia annotations since a felt eternity. However, prior to 3.3 multimedia playback was disabled by default to prevent the possibility of PDF-triggered exploits. Starting with 3.3 we automatically enable video support on all devices that come with a secure multimedia framework, i.e. all devices with API 23+ and security patch dating Feb 1st, 2016 or newer. This gives the best out-of-the-box experience while providing the same level of security for your users.
Other Improvements and Fixes
As always, this release also focuses on improving existing framework features. Here’s a brief overview of features we worked on:
DownloadProgressFragment(which shows a progress dialog for the [
DownloadJob]) is now customizable and can use completely custom layouts. We added the
CustomDocumentDownloadExamplewhich shows how customization is done.
We fixed an issue where the annotation creation toolbar was dismissed when a configuration change happened. The toolbar will now properly stay active, together with the currently selected annotation tool.
We improved rendering of right-to-left scripts in PDF forms. Previously Arabic texts entered were accidentally flipped once rendered on the document, now they are correctly displayed.
This blog post outlines the major changes only. Check out the PSPDFKit for Android changelog for the full story.