Back to Devexpress

PdfPage.RotateContent(Double, Double, Double) Method

officefileapi-devexpress-dot-pdf-dot-pdfpage-dot-rotatecontent-x28-system-dot-double-system-dot-double-system-dot-double-x29.md

latest2.5 KB
Original Source

PdfPage.RotateContent(Double, Double, Double) Method

Rotates the page content relative to the specified point. Document annotations are not rotated.

Namespace : DevExpress.Pdf

Assembly : DevExpress.Pdf.v25.2.Core.dll

NuGet Package : DevExpress.Pdf.Core

Declaration

csharp
public void RotateContent(
    double x,
    double y,
    double degree
)
vb
Public Sub RotateContent(
    x As Double,
    y As Double,
    degree As Double
)

Parameters

NameTypeDescription
xDouble

The point’s X coordinate in the page coordinate system.

| | y | Double |

The point’s Y coordinate in the page coordinate system.

| | degree | Double |

The degree of rotation (from 0 to 360).

|

Remarks

The RotateContent method call does not affect the page size.

Example

The code sample below rotates the first page’s content:

csharp
using (PdfDocumentProcessor processor = new PdfDocumentProcessor())
{
    processor.LoadDocument(@"Document.pdf");
    PdfPage page = processor.Document.Pages[0];

    // Scale content to fit it
    // on the first page after rotation
    page.ScaleContent(0.5, 0.5);
    page.RotateContent(200,100, 270);
    processor.SaveDocument("result.pdf");
}
vb
Using processor As New PdfDocumentProcessor()
  processor.LoadDocument("Document.pdf")
  Dim page As PdfPage = processor.Document.Pages(0)

  ' Scale content to fit it
  ' on the first page after rotation
  page.ScaleContent(0.5, 0.5)
  page.RotateContent(200,100, 270)
  processor.SaveDocument("result.pdf")
End Using

See Also

PdfPage Class

PdfPage Members

DevExpress.Pdf Namespace