PdfPageCollection

public final class PdfPageCollection implements Iterable<T>

Represents a collection of pages in a PDF document. Provides indexed access to individual objects and methods to manipulate the page structure.

Constructors

Link copied to clipboard
public void PdfPageCollection()

Functions

Link copied to clipboard
public final PdfPage add()
Adds a new page at the end of the document with the default A4 page size.
public final PdfPage add(PdfPageSizes pageSize)
Adds a new page at the end of the document with a predefined page size.
public final PdfPage add(float width, float height)
Adds a new page at the end of the document with the specified dimensions.
Link copied to clipboard
public void forEach(Consumer<? super T> action)
Link copied to clipboard
public final PdfPage get(int index)
Returns the element at the specified position in this collection.
Link copied to clipboard
public final int getCount()
Gets the number of pages in the collection.
Link copied to clipboard
public final long getEnumerator()
Returns an enumerator that iterates through the pages collection.
Link copied to clipboard
public final PdfPage getFirst()
Gets the first page of the document, or null if the document has no pages.
Link copied to clipboard
public final PdfPage getLast()
Gets the last page of the document, or null if the document has no pages.
Link copied to clipboard
public final PdfPage getPage(int pageNumber)
Returns a page by its 1-based page number.
Link copied to clipboard
public final PdfPage insert(int index)
Inserts a new page at the specified position with the default A4 page size.
public final PdfPage insert(int index, PdfPageSizes pageSize)
Inserts a new page at the specified position with a predefined page size.
public final PdfPage insert(int index, float width, float height)
Inserts a new page at the specified position with the specified dimensions.
Link copied to clipboard
public final Iterator<PdfPage> iterator()
Returns an iterator over the elements in this collection.
Link copied to clipboard
public final void moveTo(int sourceIndex, int destinationIndex)
Moves a page from one position to another.
Link copied to clipboard
public final void removeAt(int index)
Removes the page at the specified 0-based index.
Link copied to clipboard
public final int size()
Returns the number of elements in this collection.
Link copied to clipboard
Link copied to clipboard
public final void swap(int index1, int index2)
Swaps two pages in the document.