Rotating a PDF page on iOS

To rotate a page in a PDF document.

1PTPDFDoc *doc = [[PTPDFDoc alloc] initWithFilepath: filename];
2
3// Rotate the first page 90 degrees clockwise.
4PTPage *page = [doc GetPage:1];
5PTRotate originalRotation = [page getRotation];
6PTRotate rotation;
7switch (originalRotation)
8{
9 case e_pt0: rotation = e_pt90; break;
10 case e_pt90: rotation = e_pt180; break;
11 case e_pt180: rotation = e_pt270; break;
12 case e_pt270: rotation = e_pt0; break;
13 default: rotation = e_pt0; break;
14}
15[page 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