I have ran into an issue performing page removal.
Your webpage states that “The page and its resources are still available until the document is saved in ‘full save mode’ with the ‘remove unused objects’ flag”.
So I use doc.PageRemove(it) and then save the document using
PDFNet’s output is only few kilobytes smaller than the input.
The document isn’t reducing in size because the pages are still being referenced by parts of the document, namely the bookmarks and logical structure. You can remove these references by erasing them from the document:
With these values removed, saving the document with “remove unused” set results in significantly smaller output.