Skip to main content

RemovePage

Removes a page from the document by its index.

note

If the document has only one page, it cannot be removed, and the method returns false.

Syntax​

expression.RemovePage(index);

expression - A variable that represents an ApiDocument class.

Parameters​

NameRequired/OptionalData typeDefaultDescription
indexRequirednumberThe index of the page to remove.

Returns​

boolean

Example​

Delete a page from a PDF.

// How do I remove an unwanted page from a PDF?

// Delete a specific page number from a PDF.

let doc = Api.GetDocument();
doc.AddPage(1);
doc.RemovePage(0);