Some test text!

Get started

keyboard_arrow_down
Download PDFTron SDKIntegrate with GradleIntegrate manuallyRun samplesAdd PDFTron license keyQuick start - view a documentProGuardUpdate to latest versionTroubleshooting

Document Viewer

keyboard_arrow_down

Document Viewer components

keyboard_arrow_down
PDFViewCtrlReflowFloating context menuCustomize floating context menuAnnotation toolbarAnnotation style dialogCustomize annotation style dialogPage sliderAnnotation listDocument outlineUser bookmark listList containerThumbnail browserAdd pages dialogRotate pages dialogView mode dialogCrop pages dialog

Annotation and collaboration

keyboard_arrow_down
OverviewSet up ToolManagerRead only modeDisable annotation creation/editingDefault annotation propertiesAnnotation propertiesEventsOverride annotation handlingShow and hide existing annotationsUndo and redoRealtime collaboration

Advanced customization

keyboard_arrow_down
Add a custom view to a pageCreate a custom toolPage coloring modePage fit modePage layout mode

Conversion

keyboard_arrow_down
Convert documents to PDFConvert HTML to PDF

Search

keyboard_arrow_down

Other Frameworks

keyboard_arrow_down

Advanced topics

keyboard_arrow_down
Understand coordinatesDocument savingDocument lockingGenerate page thumbnailsTool class hierarchy

FAQ

keyboard_arrow_down
System RequirementsRun project in Android StudioRun project with source codePDFTron full vs. standardLocalizationIcon cheat sheetReduce size of APKEnable multidexOut of memory when rotating device multiple timesReduce memory consumptionDetachCurrentThread warning

PDF Processing API

keyboard_arrow_down
What is PDFNet?Opening a documentSerializing (saving) a documentWorking with pagesWorking with Page ContentWorking with BookmarksWorking with Interactive Forms (AcroForms)PDF SecurityLow-level PDF APIError handling
Reduce memory consumptionkeyboard_arrow_down

Reduce memory consumption

In this document
chevron_rightIncreasing Android heap size

In order to achieve smoother viewing experience, PDFViewCtrl keeps invisible content. However, keeping invisible content increases memory usage. Android sets an upper bound on the VM heap size allowed for an app. By default, PDFViewCtrl is set to use a quarter of maximum VM heap size for keeping visible and invisible content. Based on the memory footprint of your app, you may want to customize it.

In order to customize the memory usage, call PDFViewCtrl.setRenderedContentCacheSize(long):



where pdfViewCtrl is an instance of PDFViewCtrl.

If you want to minimize the heap memory usage at the cost of viewing experience quality, you can set allowed_max to 0. PDFViewCtrl will not keep any invisible content.
setRenderedContentCacheSize(long) only controls the memory usage of VM heap size by PDFViewCtrl, but not the native memory that PDFViewCtrl might use.

linkIncreasing Android heap size

On Android 3.0 and above, you can also increase the allowed heap size of an app.

In your app AndroidManifest.xml file, add android:largeHeap="true" to <application> tag:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  ...
  >
  <application
    ...
    android:largeHeap="true"
    >
    ...
  </application>

</manifest>