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

    Scales the content of a page by specified horizontal and vertical scaling factors.

    Namespace: DevExpress.Docs.Pdf

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

    Declaration

    public void ScaleContent(
        double scaleX,
        double scaleY
    )

    Parameters

    Name Type Description
    scaleX Double

    The horizontal scaling factor. A value greater than 1 enlarges the content, and a value from 0 to 1 reduces it.

    scaleY Double

    The vertical scaling factor. A value greater than 1 enlarges the content, and a value from 0 to 1 reduces it.

    Example

    How to: Scale Page Content in a PDF Document

    The following code snippet scales the content on the first page. The new content size is 50% of original both horizontally and vertically:

    using DevExpress.Docs.Pdf;
    using System.IO;
    
    using (PdfDocument pdfDocument = new PdfDocument(new FileStream(@"Document.pdf", FileMode.OpenOrCreate, FileAccess.ReadWrite)))
    {
        // Scale page content along both axes.
        Page page = pdfDocument.Pages[0];
        page.ScaleContent(0.5, 0.5);
        pdfDocument.Save(new FileStream("Result.pdf", FileMode.Create, FileAccess.Write));
    }
    
    See Also