Some test text!


Get started

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

Document Viewer


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

Annotation and collaboration

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

Advanced customization

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


Convert documents to PDFConvert HTML to PDF


Text search

Other Frameworks


Advanced topics

Understand coordinatesDocument savingDocument lockingGenerate page thumbnailsTool class hierarchy


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

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
Convert HTML to PDFkeyboard_arrow_down

Convert HTML to PDF

In this document
chevron_rightFrom link
chevron_rightFrom HTML string
chevron_rightFrom other sources
HTML to PDF conversion is available for Android API 21 and above.

The HTML to PDF conversion API accepts different sources, such as HTTP/HTTPS URLs, HTML strings, and everything that can be loaded in a WebView.

linkFrom link

To convert a link URL to PDF, simply:

linkFrom HTML string

To convert an HTML string to PDF, simply:

where myBaseUrl is the URL to use as the page's base URL. If null defaults to about:blank and myHtmlData is a String of data in the UTF-8 encoding. Click here for more info.

linkFrom other sources

If none of the above fit your needs, you can also pass in a WebView directly for conversion: