PDFTron .NET: Is there a way to change the bounding box of a page?

You can change the page using media & crop box (page.SetCrop/MediaBox(rect)) as shown in Rect sample:

It is not entirely clear what you are attempting to do.

page.GetBoundingBox() finds a bounding box that surrounds all contant. It may be either larger or smallers than the page box (i.e. the intersection between crop and media box). This value does not have explict represenatation in PDF.

So it is not clear why you are setting the media/crop box to GetBoundingBox(). You would only want to do this is you need to crop the page to visible content or something like that.

As an experiment try the following:

var page = …


Rect r = new Rect(0, 0, 1000, 1000)


The page box should be 0…1000 in both X & Y.