Back to Devexpress

PdfPage.ScaleContent(Double, Double) Method

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

latest2.3 KB
Original Source

PdfPage.ScaleContent(Double, Double) Method

Scales the page content.

Namespace : DevExpress.Pdf

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

NuGet Package : DevExpress.Pdf.Core

Declaration

csharp
public void ScaleContent(
    double scaleX,
    double scaleY
)
vb
Public Sub ScaleContent(
    scaleX As Double,
    scaleY As Double
)

Parameters

NameTypeDescription
scaleXDouble

The horizontal scale factor (1 is 100%).

| | scaleY | Double |

The vertical scale factor (1 is 100%).

|

Remarks

The ScaleContent method call does not affect the page size. To flip content horizontally or vertically, specify a negative value for the method parameter.

Note

PDF pages are measured in points. One point is 1/72nd of an inch (0.3528 mm). To convert this measurement unit to pixels, use the Units.PointsToPixelsF method.

Example

The code sample below scales the content to 75%:

csharp
using (PdfDocumentProcessor processor = new PdfDocumentProcessor())
{
    processor.LoadDocument(@"Document.pdf");
    PdfPage page = processor.Document.Pages[0];
    page.ScaleContent(0.75,0.75);
    processor.SaveDocument("result.pdf");
}
vb
Using processor As New PdfDocumentProcessor()
  processor.LoadDocument("Document.pdf")
  Dim page As PdfPage = processor.Document.Pages(0)
  page.ScaleContent(0.75,0.75)
  processor.SaveDocument("result.pdf")
End Using

See Also

PdfPage Class

PdfPage Members

DevExpress.Pdf Namespace