Some test text!

Search
Hamburger Icon

Xamarin / Android

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.

API to programmatically crop pages in Android

To crop a page in a PDF document.

PDFDoc doc = new PDFDoc(filename);

// Access a PDF page
Page page = doc.GetPage(page_num);

// Crop the page
page.SetCropBox(new Rect(0, 0, 500, 600));

About cropping the page

The crop box defines the region to which the contents of the page are to be clipped (cropped) when displayed or printed. Unlike other types of boxes, the crop box has no defined meaning in terms of physical page geometry or intended use; it merely imposes clipping on the page contents. The default value is the page's media box. A new crop box can be imposed on a page with Page.SetCropBox().

Trial setup questions? Ask experts on Discord
Need other help? Contact Support
Pricing or product questions? Contact Sales