Good morning E-Iceblue team!
I'm using the Spire.PDF library on one of my RPA (Robotic Process Automation) projects (based on the UiPath) and have to admit that your library really does its job, thank you! But I'm also forced to add, that at the same time I'm encountering a problem while trying to use your FindText method to find some common word (say, "the") in the huge pdf-file (1000+ pages). You may say that on modern machines even that shouldn't be a problem -- and yes, you may be right. But UiPath Studio itself (a variable, which can't be changed in my equation, in my case) adds one more restriction -- UiPath Studio's main executable application is still written for x86 logic and so doesn't support more than 2 GB of RAM. And for this particular case, 2 GB, unfortunately, looks like, isn't enough.
Can you please share any ideas of how a FindText method can be optimized to fit 2 GB limit? I'll appreciate any generic ideas too, without measuring and checking if exactly 2 GB limit was crossed or not (yes, I do know about the virtual memory, the pagefile). Or maybe you're currently working on some optimization of this method internally?
While understanding that I've provided not a lot of specific information:
1. My library version is: 5.9.16.2046. I do see that it's not the latest version, but I also can't find any updates brought for a FindText method in changelogs of the newer versions.
2. This issue doesn't show up and used resources are being freed by .NET Garbage Collector successfully in case the application, which contains SpirePDF.dll as the reference, was relaunched, in one way or another (completely or partially).
3. Intensification of Garbage Collector calls, moving FindText calls into separate thread, attempts to dispose returned resources (attempts, because native Spire.PDF models don't implement IDisposable, in most cases), slowing thread down a bit -- didn't show any positive effect. Calling FindText method separately as a delegate even made things worse.
Thank you in advance and take care of yourself!