You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Nick Westerly <de...@gmail.com> on 2018/11/13 06:32:32 UTC

Selective Loading of Objects

Hi -

I am trying to load a document that has a lot of annotations (50k+) (i.e.
comments, highlights, etc) However, just calling 'load' on the document is
extremely slow, and uses a lot of memory (2G+).

I actually don't need to use or access annotations at all (I'm using PDFBOX
through a separate library that doesn't need them), but do need access to
the PDDocument. Is there a way to load a document, but ignore all
annotations when parsing? Similarly, ignoring all items such as fonts
associated with those annotation objects.

I was browsing through PDFParser#initialiParse and COSParser, but a little
out of my depth.
Even something as simple as ignoring objects if they are of some 'type' i
could check.

Any suggestions, even partial, would be helpful.

Thanks.