Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

PdfDocumentProcessor.AddNewPage(PdfRectangle) Method

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

Namespace: DevExpress.Pdf

Assembly: DevExpress.Docs.v24.2.dll

NuGet Package: DevExpress.Document.Processor

#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