Some test text!

Rotate pageskeyboard_arrow_down

Rotating a PDF page in Go

To rotate a page in a PDF document.

doc := NewPDFDoc(filename)

// Rotate the first page 90 degrees clockwise.
page := doc.GetPage(1)
originalRotation := page.GetRotation()
var rotation int
if originalRotation == PageE_0 {
  rotation = PageE_90
else if originalRotation == PageE_90 {
  rotation = PageE_180
else if originalRotation == PageE_180 {
  rotation = PageE_270
else if originalRotation == PageE_270 {
  rotation = PageE_0
else {
  rotation = Page::E_0

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.

Get the answers you need: Support


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.