Some test text!
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.
To create a new instance of the user crop pages dialog fragment, call
newInstance() and set the
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.
UserCropDialogFragmentdoes not crop pages permanently, it may not handled well by other PDF viewer. To crop pages permanently, see cropping pages permanently
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.
If, after cropping pages, you wish to reset page size, you can use the utility function
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