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

    Offsets page content by the specified horizontal and vertical distances.

    Namespace: DevExpress.Docs.Pdf

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

    Declaration

    public void OffsetContent(
        double dx,
        double dy
    )

    Parameters

    Name Type Description
    dx Double

    The horizontal distance by which the content is offset. A positive value moves the content to the right, and a negative value moves it to the left.

    dy Double

    The vertical distance by which the content is offset. A positive value moves the content down, and a negative value moves it up.

    Example

    How to: Offset Page Content in a PDF Document

    The following code snippet moves the content of the first page 50 units to the right and 50 units down.

    using DevExpress.Docs.Pdf;
    using System.IO;
    
    using (PdfDocument pdfDocument = new PdfDocument(new FileStream(@"Document.pdf", FileMode.OpenOrCreate, FileAccess.ReadWrite)))
    {
        // Offset page content by X and Y values.
        Page page = pdfDocument.Pages[0];
        page.OffsetContent(50, 50);
        pdfDocument.Save(new FileStream("Result.pdf", FileMode.Create, FileAccess.Write));
    }
    
    See Also