Skip to main content
.NET Framework 4.5.2+

PdfDocumentProcessor.AddNewPage(PdfRectangle) Method

Adds an empty page to the document. Accepts page size as a parameter.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Docs.v22.1.dll

Declaration

public PdfPage AddNewPage(
    PdfRectangle mediaBox
)

Parameters

Name Type Description
mediaBox PdfRectangle

A PdfRectangle object that is the actual page size.

Returns

Type Description
PdfPage

A PdfPage object that is the added page.

Remarks

The AddNewPage method creates an empty page. Use the PdfDocumentProcessor.RenderNewPage method to create a new page with graphics.

Example

The following code adds a new page to a document:

using DevExpress.Pdf;

using (PdfDocumentProcessor processor = new PdfDocumentProcessor())
{
    processor.LoadDocument("..\\..\\Document.pdf");
    processor.AddNewPage(PdfPaperSize.A4);
    processor.SaveDocument("..\\..\\Result.pdf");
}
See Also