Some test text!

menu
search
Rotate pageskeyboard_arrow_down

Rotate a page

To rotate a page in a PDF document.

PDFDoc doc(filename);

// Rotate the first page 90 degrees clockwise.
Page page = doc.GetPage(1);
Page::Rotate originalRotation = page.GetRotation();
Page::Rotate rotation;
switch (originalRotation)
{
  case Page::e_0:   rotation = Page::e_90;  break;
  case Page::e_90:  rotation = Page::e_180; break;
  case Page::e_180: rotation = Page::e_270; break;
  case Page::e_270: rotation = Page::e_0;   break;
  default:          rotation = Page::e_0;   break;
}
page.SetRotation(rotation);

linkAbout 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.

Get the answers you need: Support

close

Free Trial

Get unlimited trial usage of PDFTron SDK to bring accurate, reliable, and fast document processing capabilities to any application or workflow.

Select a platform to get started with your free trial.

Unlimited usage. No email address required.

PDFTron Receives USD$71 Million Growth Investment Led By Silversmith Capital Partners

Learn More
close