I need to create large pdf documents with a very large number of annotations. It combines text with a keyword in context index: each significant word in the full text links to the corresponding word in the context index and back again.
On a linux desktop with 32Gb, using perl PDF::API2 I can successfully create a document of 1000 pages with 750 annotations on each page. More than this causes the process to hang, probably after exhausting RAM.
I tried breaking documents into separate pdf files using GotoR annotations, but this apparently works only with Acrobat Reader which also complains about security risks.
Are there other perl or python libraries better able to handle this?