modern-pdf-lib / removePage
Function: removePage()
removePage(
doc,index):void
Defined in: src/core/pageManipulation.ts:180
Remove a page from the document by its zero-based index.
Parameters
doc
The PdfDocument to modify.
index
number
Zero-based index of the page to remove.
Returns
void
Throws
RangeError if the index is out of bounds.
Example
ts
removePage(doc, 0); // Remove the first page