Qoppa’s PDF libraries components (v2020 and up) and Android PDF toolkit (v6.8 and up) use the safest hash algorithm available and supported by the PDF file version when applying digital signatures. This is priority order in which we look for hash algorithms based on the document version: PDF File Version 1.7 & up: “SHA512”, “SHA384”, […]
Category: Android PDF Toolkit – qPDF
Developer library to create, display and manipulate PDF documents in Android.
Find the first Goto page action bookmark in a PDF and go to that page
This sample uses QPDFNotesView, Qoppa’s Android PDF viewer & annotator. It loops through the bookmarks contained in a PDF document, finds the first GotoPage action contained in the document’s bookmark tree and if any and go to that page. private void goToFirstBookmark() { PDFDocument doc = notes.getDocument(); if (doc != null) { try { // […]
Setting View Mode for Android PDF Viewer QPDFViewerView
The view mode can be set at the time the QPDFViewerView is constructed. See below sample for how to set it initially, it is not possible to change it while viewing a document with our current API. If the view mode is null, QPDFViewerView.VIEW_MODE.VERTICAL_CONTINUOUS is used. package com.qoppa; import android.app.Activity; import android.os.Bundle; import […]
Different options to render and markup PDFs on Android and iOS
Q: What are the options to display / render PDF documents in Android using Qoppa’s PDF products? A: You may use a few of our products: PDF Automation Server: This is an easy to install server that can run on your web-server to convert PDF documents to HTML5 and serve them to any browser on […]
Extract Text from a PDF using Android Java
Sample Android program to extract text content from a PDF document as a String using Qoppa’s Android toolkit qPDF Toolkit. This program will extract the text from all pages of the PDF. //must be called before utilizing qPDF Toolkit StandardFontTF.mAssetMgr = getAssets(); //load the PDF document you want to extract text from File file […]
JavaScript is not working when loading PDFs programmatically in Android qPDF Toolkit
Q: JavaScript does not seem to be running when I load a PDF programmatically. JavaScript works fine when I load a PDF through the toolbar open button on the QPDFViewerView. A: JavaScript in Qoppa qPDF Toolkit requires an Android context to run within. When you open the document from the viewer, we automatically set the […]
File browsing or saving on device when an Android app is targeting SDK 23 or higher
They way apps get permissions has changed as of API 23. If the device is running Android 6.0 or higher, and your app’s target SDK is 23 or higher: The app has to list the permissions in the manifest, and it must request each dangerous permission it needs while the app is running. The user […]
Loading a PDF file from RandomAccessFile or an InputStream
Q: How do you suggest we open PDF files from a USB key or removable device? When Qoppa’s PDF Android toolkit opens a PDF file, by default it uses a RandomAccessFile object and reads parts of the PDF file on-demand. The reason to do this is to preserve memory which is limited on Android. You […]
Deactivating Form Filling in QPDFNotesView
Here is a sample code in Android showing how to launch QPDFNotesView and add a document listener that implements the documentOpened() method, allowing to do something each time a PDF document is open. In this sample, when a PDF is open and it is an interactive PDF form, all interactive form fields are set to […]
List of JavaScript Functions Supported in qPDF Toolkit
List of JavaScript functions supported in qPDFToolkit: App Methods: alert beep Console Methods: println Doc Methods: calculateNow getField getNthFieldName Properties: calculate numFields URL Field Methods: buttonGetCaption buttonSetCaption clearItems deleteItemAt getArray getItemAt insertItemAt isBoxChecked setAction setItems Properties: borderStyle borderWidth calcOrderIndex charLimit comb commitOnSelChange currentValueIndices defaultValue delay display doc doNotScroll doNotSpellCheck editable exportValues fileSelect fillColor hidden lineWidth […]
How to remove a button from the toolbar in QPDFNotesView or QPDFViewerView
Q: How can I remove the save button from the toolbar in QPDFNotesView? A: Please see the below sample code for removing the “save” button. The relevant line of code is below: qpdfNotesView.getToolbar().removeView(qpdfNotesView.getToolbar().getIbSave());qpdfNotesView.getToolbar().removeView(qpdfNotesView.getToolbar().getIbSave()); package com.qoppa; import android.app.Activity; import android.os.Bundle; import com.qoppa.notes.QPDFNotesView; public class RemoveSaveButtonActivity extends Activity { public QPDFNotesView qpdfNotesView; protected void […]
Fit to Height View when Rendering PDF with Android qPDF Toolkit
Q: How can I implement a fit to height view using Qoppa’s Android qPDF Toolkit and the PDF Viewer QPDFNotesView? A: We don’t have a predefined way of fitting the document to its height within the viewer. You can calculate the appropriate scale and set it on the viewer. See sample code below. package com.sample; […]
Getting interactive field location information (bounds and page number)
To get PDF interactive form fields location information (including signature fields) such as dimension and page number, you will need to access the widget which is the visual representation of the field on the page. When using Qoppa’s PDF components (jPDFViewer, jPDFNotes, jPDFEditor), you can get information from the editing component. // get Acroform AcroForm […]
Adding custom properties to PDF digital signatures
Q: Is it possible to set custom properties to digital signatures using Qoppa’s PDF SDK? A: Yes, it is possible to do so using jPDFSecure, jPDFProcess or qPDF Toolkit. Adding custom property to the signature dictionary This method can be used to add additional custom properties to the signature dictionary. SigningInformation.setCustomProperty(key, value);SigningInformation.setCustomProperty(key, value); You can […]
PDF Form Fill Activity for efficient interactive form filling in Android SDK
FormFill is a an activity included in Qoppa’s Android PDF SDK, qPDF Toolkit, that can be used in conjunction with Qoppa’s PDF view for Android, QPDFNotesView, to fill PDF forms fast and efficiently, even on smaller Android phone screens. It opens as a separate activity that shows all the fields present in the interactive PDF […]
When keyboard is open, it is not possible to scroll to the top of the first page
Q: When searching text in the PDF document and the input keyboard is open on the screen, it is no longer possible to scroll all the way up to the beginning of the PDF document. A: This is actually an Android setting. When the keyboard is showing on the screen, Android will adjust the visible […]
Getting notifications when PDF documents are modified in qPDF Toolkit
A: I am using QPDFNotesView within qPDF Toolkit to display, annotate and fill PDF forms in Android. Is there a mechanism that allows to be notified when a PDF document has been changed, for instance when a form field has been updated? A: Yes, this is possible by adding a DocumentListener, see sample code below. […]
NullPointerException in Typeface.nativeCreateFromAsset
Q : I am trying to load a PDF document using Qoppa’s Android PDF toolkit and getting the following error: Caused by: java.lang.NullPointerException at android.graphics.Typeface.nativeCreateFromAsset(Native Method) at android.graphics.Typeface.createFromAsset(Typeface.java:149) at com.qoppa.android.pdfViewer.fonts.StandardFontTF.getTypeface(Unknown Source) at com.qoppa.android.pdfViewer.fonts.StandardFontTF.getFont(Unknown Source) at com.qoppa.android.pdfViewer.fonts.t.b(Unknown Source) at com.qoppa.android.pdfProcess.PDFPage.(Unknown Source) A: You need to load the font assets before using our library. //this static allows […]
ARM and x86 Architecture Support for Android PDF library
Q: Can your Android library render PDF documents on both ARM and x86 architectures? A: Yes, our PDF android toolkit qPDF Toolkit supports both ARM and x86 architectures. When you download the toolkit, you will find a “libs” folder that contains native Android libraries. You will notice different folders for armeabi, armeabi-v7a and x86. The […]
Android View to Display / Render PDF Documents
As part of Qoppa’s Android toolkit, there is a class called QPDFViewerView, which is an extensions of FrameLayout and can be included in an app by adding as a View in an Activity. This view is a complete implementation of a PDF viewer, based on the toolkit. the intent of this class is to provide […]
Android View to Display, Annotate PDF Documents, Sign and Fill PDF forms
As part of Qoppa’s Android toolkit, there is also a class included called QPDFNotesView that extends an Android View. This class can be used within your application to show PDF documents and also provides annotation tools, similar to our qPDF Notes app. Our Android View QPDFNotesView can: Display PDF documents Review and annotate PDFs Digitally […]
Android PDF Viewer and Annotator Sample Code Using Fragment
As part of Qoppa’s Android toolkit, there is also a class included called QPDFNotesView that extends an Android View. This class can be used within your application to show PDF documents and also provides annotation tools, similar to our qPDF Notes app. Here is sample code using Qoppa’s qPDFToolkit to display and annotate a PDF […]
Refresh issues when rendering a PDF in Android
Q: As we’re in the process of integrating your Android PDF viewer sdk into Android application, we are seeing some refresh issues with only parts of the PDF being rendered in the View. When we scroll, we see blank pages. Rotating the android device or zooming will force a refresh but we still have the […]
Android Sample Code: Flatten Annotations Using qPDF Toolkit
This is a sample program showing how to add a button for flattening all annotations on all pages in a PDF document using Qoppa’s Android annotating view, QPDFNotesView and Qoppa’s android toolkit, qPDF Toolkit. import com.qoppa.android.pdf.PDFException; import com.qoppa.android.pdfProcess.PDFDocument; import com.qoppa.notes.QPDFNotesView; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; public class FlattenActivity extends Activity […]
Download Sample Android PDF Viewer
This is an implementation of an Android PDF Viewer that uses the qPDF Toolkit to render the PDF content. This viewer is intended as a starting point in the implementation of a custom viewer, the source code is provided so that it can be customized to meet the needs of the app that uses the […]
Download Qoppa PDF Android Toolkit
Download the following zip file from our website: qpdftoolkit.zip This file contains four items: version_history.txt – This text file will be updated with each new version of the toolkit. qoppapdf.jar – This is the main jar file for the toolkit. This jar file needs to be added to the classpath for your project. assets folder […]
Developing with qoppapdf.zip in Android Studio
This is the structure of QPDFSamplesViewer a sample project using qoppapdf.zip, Android Qoppa’s PDF toolkit, within Android Studio. Download qpdftoolkit.zip (containing qoppapdf.jar, libs and assets folder) Downnload qPDF_Samples_Viewer.zip Make sure that the libs folder, jniLibs folder and the assets folder are in the correct location so that they are available as resources. Make sure to add […]
Developing with qoppapdf.jar in Eclipse
Below is a structure of QPDFSamplesViewer, a sample project using qoppapdf.jar, Android Qoppa’s PDF toolkit, within Eclipse. Download qpdftoolkit.zip which includes qoppapdf.jar, libs and assets folder Download qPDF_Samples_Viewer.zip Make sure that the libs folder and the assets folder are in the correct location so that they are available as resources.
JPEG images in the PDF render with an X or do not render with the good colors
Q: I am evaluating your Android PDF Library, qPDF Toolkit and the images do not seem to display. A: qPDF Toolkit ships with a few libraries, including JPEG decoders for rendering JPEG images. They are located under the “libs” folder in the qpdftoolkit.zip file. These libraries need to be available as resources for JPEG images […]
How to enable JavaScript in Qoppa Android PDF Toolkit
JavaScript is supported in Qoppa’s Android PDF toolkit, qPDF Toolkit. How is JavaScript used in PDF documents? Mostly, JavaScript is used in interactive PDF forms in field actions to calculate the value of fields, validate field data to prevent invalid entry and format special fields such as dates, ssn, postal codes, phone numbers, etc… JavaScript […]