Skip to main content

PdfGraphics.RotateTransform(Single) Method

Rotates the coordinate system clockwise to the specified angle relative to its origin.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Pdf.v24.1.Drawing.dll

NuGet Package: DevExpress.Pdf.Drawing

Declaration

public void RotateTransform(
    float degree
)

Parameters

Name Type Description
degree Single

Angle of rotation in degrees.

Remarks

This method multiplies the transformation matrix of the PdfGraphics object by a rotation matrix. Elements of the rotation matrix are derived from the degree parameter.

Note

Coordinate system transformations (e.g., system rotation) are not taken into account for the following methods:

The code sample below rotates the coordinate system and draws shapes in the initial and rotated coordinate systems.

Rotates the Coordinate System

using DevExpress.Pdf;
using System.Drawing;
//...

using (PdfDocumentProcessor processor = new PdfDocumentProcessor())
{
    processor.CreateEmptyDocument();
    PdfPage page = processor.AddNewPage(PdfPaperSize.A4);
        using (PdfGraphics graphics = processor.CreateGraphics())
        {
            // Draw a green rectangle.
            using (var brush = new SolidBrush(Color.Green))
                graphics.FillRectangle(brush, new RectangleF(0, 0, 300, 200));

            // Rotate the coordinate system clockwise by 90 degrees.
            graphics.RotateTransform(90);

            // Draw a blue rectangle in the rotated coordinate system.
            using (var brush = new SolidBrush(Color.Blue))
                graphics.FillRectangle(brush, new RectangleF(0, -350, 300, -200));

            // Add graphics content to the document page.
            graphics.AddToPageForeground(page, 72, 72);
        }
    processor.SaveDocument("out2.pdf");
}
Process.Start("out.pdf");

The following code snippets (auto-collected from DevExpress Examples) contain references to the RotateTransform(Single) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also