Skip to main content
A newer version of this page is available. .

How to: Rotate Pages

Important

You require a license to the DevExpress Office File API or DevExpress Universal Subscription to use these examples in production code. Refer to the DevExpress Subscription page for pricing information.

This example illustrates how to use the PDF Document API component for rotating pages.

Note

A complete sample project is available at https://github.com/DevExpress-Examples/how-to-rotate-pdf-pages-t114305

Imports DevExpress.Pdf

Namespace PdfPageRotationExample

    Friend Class Program
        Shared Sub Main(ByVal args() As String)
            Using pdfDocumentProcessor As New PdfDocumentProcessor()
                pdfDocumentProcessor.LoadDocument("..\..\docs\TextRotate.pdf")
                Dim angle As Integer = 0
                For Each page As PdfPage In pdfDocumentProcessor.Document.Pages
                    angle = (angle + 90) Mod 360
                    page.Rotate = angle
                Next page
                pdfDocumentProcessor.SaveDocument("..\..\docs\Rotated.pdf")
            End Using
        End Sub
    End Class
End Namespace
See Also