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
Document savingkeyboard_arrow_down

Document saving

In this document
chevron_rightSave to a new PDF document
chevron_rightSave to the same PDF document
chevron_rightSaving modes
chevron_rightSave with remove unused objects
chevron_rightSave incrementally
chevron_rightSave in linearized format

Use PDFNet saving APIs from PDFDoc class to save PDF documents on local storage. The PDFDoc can be obtained from PDFViewCtrl using PDFViewCtrl.getDoc().

linkSave to a new PDF document

To save the current PDF document to a new file on internal storage use save(String, SDFDoc.SaveMode[], ProgressMonitor):



To save the document on external storage specified by a URI, you can create a Filter and use save(Filter, SaveMode[]):



linkSave to the same PDF document

If you want to save changes on an opened PDF document you can save incrementally which is faster:



linkSaving modes

There are a few ways to save a PDF document on permanent storage such as saving with removal of unused objects, incremental saving, and saving in linearized format. A complete list of saving modes is available here.

linkSave with remove unused objects

The REMOVE_UNUSED mode saves disk storage space by rearranging the PDF document and removing unused objects. As a result, the output file can be significantly smaller. However, the saving process itself may take longer compared to incremental mode.

linkSave incrementally

Use the INCREMENTAL mode if you are particularly concerned about the time it takes to save the file. If you use this mode, any changes to the document, even the deletion of annotations, will be appended to the end of the PDF file. Note that it is not possible to incrementally save the document if the underlying file has an XRef table that had to be repaired when the file was opened (see http://www.pdftron.com/kbcorruptxref).

linkSave in linearized format

The LINEARIZED mode is to be preferentially used in file streaming situations, such as when you want to upload a PDF document. It will rearrange the PDF document and remove unused objects. However, the saving process itself may take longer compared to other modes.