Some test text!

menu
search

Crop a page (Android)

There are two options to crop a page. First is using a UI component that can crop or reset pages. Second is an API guide to programmatically crop a page.

Crop UI

This tutorial only applies to Xamarin.Android.

With the PDFTron library you can crop pages manually or automatically, as well as reset document pages to their original size. The UserCropDialogFragment allows a user to adjust the page's crop box which can then be applied to a subset of pages or to all the pages in a document.

Crop pages

linkShow user crop pages dialog

To show a user crop pages dialog in your activity, create a new instance of UserCropDialogFragment by calling newInstance() and setting the PDFViewCtrl:

public void ShowUserCropDialog()
{
    var userCropDialogFragment = pdftron.PDF.Controls.UserCropDialogFragment.NewInstance()
        .SetPdfViewCtrl(mPdfViewCtrl);
    userCropDialogFragment.SetStyle((int)DialogFragmentStyle.NoTitle, Resource.Style.CustomAppTheme);
    userCropDialogFragment.Show(this.SupportFragmentManager, "user_crop_pages_dialog");
}

In order to view user cropped pages in PDFViewCtrl make sure you set Page.e_user_crop as the default page box:

mPdfViewCtrl.SetPageBox(pdftron.PDF.Page.Box.e_user_crop);

Get the answers you need: Support

close

Free Trial

Get unlimited trial usage of PDFTron SDK to bring accurate, reliable, and fast document processing capabilities to any application or workflow.

Select a platform to get started with your free trial.

Unlimited usage. No email address required.

PDFTron Receives USD$71 Million Growth Investment Led By Silversmith Capital Partners

Learn more
close