Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Tue Nov 10, 2015 4:40 pm

Code: Select all
foreach (var Product in ProductsDictionary.Values)
{
    var TextFinds = Doc.Pages[0].FindText(Product.Name).Finds;
    ... do stuff with TextFinds[0]...
    // TextFinds = null;
}


This is the meat of what I'm trying to accomplish. I'm finding that TextFinds[0] always contains the same PDFTextFind object that was found on the first iteration on this loop, even though that TextFinds is a local variable for that loop instance only. Setting TextFinds to null at the end of the loop results in the same error. I have ~26k items in ProductsDictionary, so this is causing an ArgumentOutOfRange to be thrown and all code proceeding the foreach loop to stop executing.

What is causing this, and what can be done so that on each loop iteration, I'm working with an empty FindCollection object?

AntiTcb
 
Posts: 3
Joined: Tue Nov 10, 2015 4:16 pm

Tue Nov 10, 2015 6:45 pm

Resolved the previous issue, but now there's a new one.

I'm getting an ArgumentOutOfRange Exception whenever I try to do .FindText("Charging Griffin"); on this PDF:
GP Decklist.rar
.

AntiTcb
 
Posts: 3
Joined: Tue Nov 10, 2015 4:16 pm

Wed Nov 11, 2015 7:04 am

Hello,

Thanks for your inquiry.
I have reproduced the ArgumentOutOfRange Exception, and posted it to our Dev team. We will inform you when it is fixed.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Wed Nov 11, 2015 3:54 pm

Thank you!

AntiTcb
 
Posts: 3
Joined: Tue Nov 10, 2015 4:16 pm

Thu Dec 10, 2015 7:14 am

Hello,

Thanks for your waiting.
We just release Spire.PDF Pack Version:3.6, in which your issue has been resolved. Welcome to download it and have a try.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Tue Dec 15, 2015 9:24 am

Hello,

Did you test this hotfix ?
Thanks for your feedback.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Return to Spire.PDF