Removing pages from PDF in Xamarin

To remove pages from a PDF document.

C#

1PDFDoc doc = new PDFDoc(filename);
2
3// Remove the fifth page from the page sequence.
4doc.PageRemove(doc.GetPageIterator(5));
5
6// Remove the third page.
7PageIterator i = doc.GetPageIterator();
8i.Next();
9i.Next();
10doc.PageRemove(i);

Merge, copy, delete, and rearrange PDF pages
Full code sample which illustrates how to copy pages from one document to another, how to delete, and rearrange pages and how to use ImportPages().

About removing/deleting pages

PDFDoc.PageRemove(itr) only removes the page from document's page sequence. The page and its resources are still available until the document is saved in 'full save mode' with the 'remove unused objects' flag. If you are saving the file in 'incremental mode', the serialized document may contain the content of the removed page.

Did you find this helpful?

Trial setup questions?

Ask experts on Discord

Need other help?

Contact Support

Pricing or product questions?

Contact Sales