How do I scale / rotate / offset a PDF page?


I use the PDFTron to realize a ,print in file" function. I added
existing single pdf pages to a new file and finally save it. But I
have to change the content before writing to the PDFDoc.

I want to:
- rotate
- move (offset)
- scale

the whole page content.

To rotate the page you can use page.SetRotation ().

For example, in C#

You can move/offset the page as illustrated in RectTest sample project
For example (in C#):

// Offset/adjust the page media box.
Rect box = page.GetMediaBox();
box.x1 -= 200; // translate the page 200 units (1 uint = 1/72 inch)
box.x2 -= 200;

// Offset/adjust the page crop box.
box = page.GetCropBox();
box.x1 -= 200;
box.x2 -= 200;

To scale the page you can simply call page.Scale(ratio) method.
Alternatively you may want to search PDFNet Knowledge Base for
alternative ways to scale and transform PDF page.