Represents a collection of pages of PDF document.
Class allows to:
- get an PdfPage object associated with selected page
- add an VintasoftImage object as a PDF page to the PDF document
- insert an VintasoftImage object as a PDF page into the PDF document
- delete PDF page from the PDF document
Instance of this class cannot be created directly, it can be received only from the
PdfDocument object.
Here is an example that shows how to add new blank pages to a PDF document:
''' <summary>
''' Adds a new empty page into PDF document.
''' </summary>
''' <param name="pdfFileName">The filename of PDF document.</param>
''' <param name="pageSize">The size of page.</param>
Public Shared Sub AddEmptyPageToPdfDocument(pdfFileName As String, pageSize As System.Drawing.SizeF)
' open PDF document
Using document As New Vintasoft.Imaging.Pdf.PdfDocument(pdfFileName)
' get the collection of pages of PDF document
Dim pages As Vintasoft.Imaging.Pdf.Tree.PdfPageCollection = document.Pages
' add an empty page into collection of pages
pages.Add(pageSize)
' save changes to a file
document.SaveChanges()
End Using
End Sub
/// <summary>
/// Adds a new empty page into PDF document.
/// </summary>
/// <param name="pdfFileName">The filename of PDF document.</param>
/// <param name="pageSize">The size of page.</param>
public static void AddEmptyPageToPdfDocument(string pdfFileName, System.Drawing.SizeF pageSize)
{
// open PDF document
using (Vintasoft.Imaging.Pdf.PdfDocument document =
new Vintasoft.Imaging.Pdf.PdfDocument(pdfFileName))
{
// get the collection of pages of PDF document
Vintasoft.Imaging.Pdf.Tree.PdfPageCollection pages = document.Pages;
// add an empty page into collection of pages
pages.Add(pageSize);
// save changes to a file
document.SaveChanges();
}
}
System.Object
 Vintasoft.Imaging.Pdf.Tree.PdfPageCollection
Target Platforms: .NET9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5