Hello
We are using PDFsharp to extract single pages out of a larger document. It seems like the single page retains some streams (or other objects) that were used in the larger document. The PDF containing the single page has approximately the same size as the original PDF (which contained ~1400 pages, each page has one image (different image on each page) and some text).
So for example the original PDF has 1400 pages and is 11 MB in size.
A single, extracted page is still 11 MB in size.
If we use an optimizer, we can bring down the file size to about 120 KB or so.
Is there any way to clean up an extracted page to prevent this?
edit: for the record, the problem exists both with release and debug builds
edit2: upon further research, the problem seems to be that all images (from all pages) are preserved, the outputdoc.Internals.AllObjects dictionary contains exactly as many entries that seem to be an image as there are pages:
Code:
[38] = "dictionary(id=(39 0),[9])=key=9:(/Type /Subtype /Name /Width /Height /BitsPerComponent /ColorSpace /Length /Filter)"