Skip to main content
All docs
V26.1
  • Page.RotateContent(Double, Double, Double) Method

    Rotates page content by the set angle around the specified point.

    Namespace: DevExpress.Docs.Pdf

    Assembly: DevExpress.Docs.Pdf.v26.1.dll

    Declaration

    public void RotateContent(
        double x,
        double y,
        double degree
    )

    Parameters

    Name Type Description
    x Double

    The x-coordinate of the point around which the content is rotated.

    y Double

    The y-coordinate of the point around which the content is rotated.

    degree Double

    The rotation angle in degrees. Positive values rotate the content clockwise, and negative values rotate it counterclockwise.

    Example

    How to: Rotate Page Content in a PDF Document

    The following code snippet rotates content on the first page by 270 degrees around the point with coordinates (300, 300):

    using DevExpress.Docs.Pdf;
    using System.IO;
    using (PdfDocument pdfDocument = new PdfDocument(new FileStream(@"Document.pdf", FileMode.OpenOrCreate, FileAccess.ReadWrite)))
    {
        // Rotate page content by 270 degrees around the point with coordinates (300, 300).
        Page page = pdfDocument.Pages[0];
        page.RotateContent(300, 300, 270);
        pdfDocument.Save(new FileStream("Result.pdf", FileMode.Create, FileAccess.Write));
    }
    
    See Also