Rotating a PDF page in UWP

To rotate a page in a PDF document.

C#

1PDFDoc doc = new PDFDoc(fileName);
2
3// Rotate the first page 90 degrees clockwise.
4Page page = doc.GetPage(1);
5PageRotate originalRotation = page.GetRotation();
6PageRotate rotation;
7switch (originalRotation)
8{
9 case PageRotate.e_0: rotation = PageRotate.e_90; break;
10 case PageRotate.e_90: rotation = PageRotate.e_180; break;
11 case PageRotate.e_180: rotation = PageRotate.e_270; break;
12 case PageRotate.e_270: rotation = PageRotate.e_0; break;
13 default: rotation = PageRotate.e_0; break;
14}
15page.SetRotation(rotation);

About rotating pages

A page can be rotated clockwise, by 90 degrees, when displayed or printed. The Page.GetRotation() method returns the Page.Rotate enum specifying the current rotation. Similarly, Page.SetRotation() sets the current rotation.

Did you find this helpful?

Trial setup questions?

Ask experts on Discord

Need other help?

Contact Support

Pricing or product questions?

Contact Sales