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
Crop pages dialogkeyboard_arrow_down

Crop pages dialog

In this document
chevron_rightShowing user crop pages dialog
chevron_rightCropping pages automatically
chevron_rightRemoving user crop boxes
chevron_rightPermanently cropping pages

With PDFTron library, you can crop pages manually or automatically, as well as reset pages to their original size. The UserCropDialogFragment class shows a dialog for users to adjust the page's crop box. The user can also apply the current page's crop box to a subset of pages or even to all pages in the document.

linkShowing user crop pages dialog

To create a new instance of the user crop pages dialog fragment, call newInstance() and set the PDFViewCtrl:

To apply the crop box, make sure you have Page.e_user_crop as the default page box:

You can also set a listener via setOnUserCropDialogDismissListener(OnUserCropDialogDismissListener) to be notified when the user crop dialog is dismissed.

UserCropDialogFragment does not crop pages permanently, it may not handled well by other PDF viewer. To crop pages permanently, see cropping pages permanently

linkCropping pages automatically

To crop pages automatically, you can simply use the utility API called UserCropUtilities.AutoCropInBackgroundTask. It crops the edges of the document based on the position of the content.


linkRemoving user crop boxes

If, after cropping pages, you wish to reset page size, you can use the utility function UserCropUtilities.removeUserCropFromPage(Page).

linkPermanently cropping pages

Cropping pages through above methods are in user-level. User-level page-cropping may not be handled well by other PDF viewers. To apply crop pages permanently use UserCropUtilities.cropDoc(PDFDoc).