Skip to content
ComPDF
DemoSampleAPI ReferenceFAQ
New Release

Open-Source PDF SDK & AI Document Processing

Get the full self-hosted SDK and AI document processing on GitHub. One-click deploy to quickly build your document workflows.

Guides

Rotate Pages

This example shows how to rotate pages:

java
//  Rotate the first page 90 degrees clockwise.
document.pageAtIndex(0).setRotation(90);
kotlin
//  Rotate the first page 90 degrees clockwise.
document.pageAtIndex(0).rotation = 90

When the document is bound and displayed through CPDFReaderView, after modifying the document pages, you need to call the following method to refresh the view so that the changes take effect immediately:

java
cpdfReaderView.reloadPages();