Back to Devexpress

PdfDocumentProcessor.AddNewPage(PdfRectangle) Method

officefileapi-devexpress-dot-pdf-dot-pdfdocumentprocessor-dot-addnewpage-x28-devexpress-dot-pdf-dot-pdfrectangle-x29.md

latest2.3 KB
Original Source

PdfDocumentProcessor.AddNewPage(PdfRectangle) Method

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

Namespace : DevExpress.Pdf

Assembly : DevExpress.Docs.v25.2.dll

NuGet Package : DevExpress.Document.Processor

Declaration

csharp
public PdfPage AddNewPage(
    PdfRectangle mediaBox
)
vb
Public Function AddNewPage(
    mediaBox As PdfRectangle
) As PdfPage

Parameters

NameTypeDescription
mediaBoxPdfRectangle

A PdfRectangle object that is the actual page size.

|

Returns

TypeDescription
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:

csharp
using DevExpress.Pdf;

using (PdfDocumentProcessor processor = new PdfDocumentProcessor())
{
    processor.LoadDocument("..\\..\\Document.pdf");
    processor.AddNewPage(PdfPaperSize.A4);
    processor.SaveDocument("..\\..\\Result.pdf");
}
vb
Imports DevExpress.Pdf

Using processor As New PdfDocumentProcessor()
    processor.LoadDocument("..\..\Document.pdf")
    processor.AddNewPage(PdfPaperSize.A4)
    processor.SaveDocument("..\..\Result.pdf")
End Using

See Also

PdfDocumentProcessor Class

PdfDocumentProcessor Members

DevExpress.Pdf Namespace