Some test text!

keyboard_arrow_down

Get started

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

Document Viewer

keyboard_arrow_down

Document Viewer components

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

Annotation and collaboration

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

Advanced customization

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

Conversion

Convert documents to PDFConvert HTML to PDF
keyboard_arrow_down

Search

Text search
keyboard_arrow_down

Other Frameworks

keyboard_arrow_down

Advanced topics

Understand coordinatesDocument savingDocument lockingGenerate page thumbnailsTool class hierarchy
keyboard_arrow_down

FAQ

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
keyboard_arrow_down

PDF Processing API

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
Generate page thumbnailskeyboard_arrow_down

Generate page thumbnails

PDFTron's library provides a page thumbnail dialog which shows thumbnails of all PDF document pages. Fore more information, see page thumbnails dialog fragment.

With PDFViewCtrl, you can get a thumbnail Bitmap image of each page in PDF document.

  1. To add a async listener for receiving a page thumbnail image, call PDFViewCtrl.addThumbAsyncListener(PDFViewCtrl.ThumbAsyncListener). When the page thumbnail is ready, onThumbReceived(int, int[], int, int) will be invoked. The second parameter represents the received thumbnail image buffer.

  2. To create a Bitmap object from the image buffer, call: Bitmap.createBitmap(int[], int, int, Bitmap.Config).

    For example, the following code snippet puts received thumbnail image buffer to an ImageView when a page thumbnail is received.

    
    
    
    

    where pdfViewCtrl is an instance of PDFViewCtrl, and imageView is an instance of ImageView.

As the size of ImageView may not be as large as the thumbnail image, it's recommended to resize the bitmap to save memory. Alternatively, you can also use Utils.manageOOM(PDFViewCtrl) to free up memory if an out of memory error occurs.
  1. To request a page thumbnail, call PDFViewCtrl.getThumbAsync(int). Please note that if multiple requests are made, the thumnails will be processed starting with the last request.

    
    
    
    

    where pdfViewCtrl is an instance of PDFViewCtrl.

    It is recommended you cancel all thumbnail requests once they are no longer needed. To cancel all thumbnail request, use PDFViewCtrl.cancelAllThumbRequests().