Skip to main content

PdfGraphics.TranslateTransform(Single, Single) Method

Translates the coordinate system origin to the specified point.

Namespace: DevExpress.Pdf

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

NuGet Package: DevExpress.Pdf.Drawing


public void TranslateTransform(
    float x,
    float y


Name Type Description
x Single

The x-coordinate of the translation.

y Single

The y-coordinate of the translation.


This method multiplies the transformation matrix of the PdfGraphics object by a translation matrix. The translation matrix includes the x and y parameters.


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

The code sample below translates the coordinate system origin and draws shapes in the initial and translated coordinate systems.

Translate the Coordinate System

using DevExpress.Pdf;
using System.Drawing;

using (PdfDocumentProcessor processor = new PdfDocumentProcessor())
    PdfPage page = processor.AddNewPage(PdfPaperSize.A4);
        using (PdfGraphics graphics = processor.CreateGraphics())
            var rectangle = new RectangleF(0, 0, 300, 300);

            // Draw a green square.
            using (var brush = new SolidBrush(Color.Green))
                graphics.FillRectangle(brush, rectangle);

            // Translate the coordinate system.
            graphics.TranslateTransform(200, 400);

            // Draw a blue square in the translated coordinate system.
            using (var brush = new SolidBrush(Color.Blue))
                graphics.FillRectangle(brush, rectangle);

            // Add graphics content to the document page.
            graphics.AddToPageForeground(page, 72, 72);

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the TranslateTransform(Single, Single) method.


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