I have a PDF with 4500 pages and a collection of arround 100 words. I need to seek each word (without regex) on each pdf page, and if found, I create a link on the word (with LinkAnnotation and TextFragment rectangle).
I try to different ways and the last one :
A) Open PDF
B) Loop on 4500 pages
C) Foreach page, loop on 100 words
D) Foreach word, Accept TextFragmentAbsorber for currentPage
E) If result in TextFragments, create linkAnnotation.
F) Close PDF after loop on page
The only way to do this is to close my PDF every 1000 pages. Memory is released but this way is very slow.
It seem there is no way to free memory after assign TextFragmentAbsorber to current page or whole file and after few loop, my application crash with an out of memory.
Is there a way to released memory while processing ?