For the complete documentation index, see llms.txt. This page is also available as Markdown.

Open documents using Activity with Apryse Android SDK

Apryse's Android SDK ships with DocumentActivity, an all-in-one document reader and PDF editor. In addition to PDF files, it also supports viewing other file formats such as .docx, .doc, .pptx, .xlsx, .md, .cbz and various image formats. In this activity you can also read, annotate, sign, fill in PDF forms and more.

DocumentActivity extends Android's AppCompatActivity and follows Material design guidelines.

Prerequisites

No trial license key required.

The trial of Apryse Mobile SDK does not require a trial key. A commercial license key is required for use in a production environment. Please contact sales to purchase a commercial key or if you need any other license key assistance.

Step 1: Update AndroidManifest.xml

  1. In order to support all the features in DocumentActivity, we will need to add the Android permissions listed in this table. However if you would like to disable certain features and customize your document viewer, you should leave out unnecessary permissions.

  1. Enable largeHeap and set android:name in the <application> tag to MultiDexApplication:

  1. If you have not done so already, add the <meta-data> tag containing a reference to your license key in the AndroidManifest.xml file. Also, declare DocumentActivity in the same file. The final AndroidManifest.xml file should look something like this:

Step 2: Launch the viewer

Launch DocumentActivity by specifiying a local file path, an HTTP/HTTPS url, or a Content Uri:

Step 3: (Optional) Customize the viewer

  • If you would like to customize the appearance of the viewer activity, define PDFTronAppTheme in res/values/styles.xml:You can learn more about this in the customize the viewer's theme guide .

DocumentActivity uses the AppCompat theme for material colors. Make sure that the value of android:theme in your activity tag also extends the AppCompat theme.

  • Also, if you would like to customize the UI components in DocumentActivity, you can use ViewerConfig.Builder. For example:For details on customizing the UI and using ViewerConfig.Builder, check out the configuration tutorial .

Last updated

Was this helpful?