PSPDFKit 4.7 for Android

Share

Today we’re proud to announce the immediate availability of PSPDFKit 4.7 for Android. In this release, we’re rolling out JavaScript support, a document info view, free text callouts, and more. For a full list of changes, head over to our changelog for PSPDFKit 4.7 for Android.

JavaScript Support

One great trait of the PDF format is its versatility by extensibility. With PSPDFKit 4.7 for Android, we’re building on that extensibility by rolling out full support for JavaScript in PDFs. Adding JavaScript to PDFs opens up new possibilities like dynamic content, computed form properties, and even small applications inside documents.

With our new APIs, adding JavaScript is as simple as creating a JavaScriptAction instance. JavaScript actions can be evaluated directly by passing them to the executeAction() method of your [PdfFragment]. You can also attach them to interactive parts of a PDF like annotations, form fields, or outline elements, deferring their evaluation to when a user interacts with these elements.

Here’s a small example of how to flip a page and show an alert to the user:

To get you started quickly, we prepared a guide on how to use our JavaScript APIs.

Document Info View

PDF documents are made up of many attributes that might need to be inspected or edited: the document title, authors, keywords, creation and modification dates, permissions, and much more. With PSPDFKit 4.7 for Android, we’re introducing PdfDocumentInfoView, a UI component for displaying and modifying many of the items that make up PDF metadata.

// Create the view using its constructor.valinfoView=PdfDocumentInfoView(context).apply{// All you need to do is set the document on the view.document=pdfFragment.document}// Add the view to your layout.container.addView(infoView)

// Create the view using its constructor.finalPdfDocumentInfoViewinfoView=newPdfDocumentInfoView(context);// All you need to do is set the document on the view.infoView.setDocument(getPdfFragment().getDocument());// Add the view to your layout.container.addView(infoView);

Free Text Callouts

With PSPDFKit 4.7 for Android, we’re improving on free text annotations by adding support for free text intents and callouts. A callout can be created like any other FreeTextAnnotation, and by then setting the FREE_TEXT_CALLOUT intent and specifying a list of points defining the callout line:

In the user interface, PSPDFKit 4.7 for Android supports full callout editing, including point editing, configuration of colors, and line end caps. Moreover, we replaced the measurement algorithms that were used when creating new free text annotations. This now allows annotations to automatically grow while entering text. As a result, their content won’t overflow if it’s too long; instead, it’s always fully visible.

And More!

We improved image document performance and added support for printing of image documents.

We hope you like the changes in PSPDFKit 4.7 for Android — we’re already working on our next great release, so stay tuned! To see a comprehensive list of changes in this release, check out the PSPDFKit 4.7 for Android changelog.