page.Accept(textAbsorber) throw NullReferenceException

page.Accept.pdf (1.7 MB)
page.Accept2.pdf (7.0 MB)
var doc = new pdf.Document(file);
foreach (pdf.Page page in doc.Pages)
{
TextAbsorber textAbsorber = new TextAbsorber();
page.Accept(textAbsorber);
}

@xhuigy
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-54671

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Hi,

What is the status of this issue? I am experiencing this issue as well. I used to reference 23.6.0 and even updating to the latest 24.4.0 I do still get the error.

Thanks,

Is there an update on this issue?

We are experiencing this issue, we had 23.6.0 and updated to 24.4.0 and we still get the NullReferenceException , here is a snippet of the issue

TextAbsorber textAbsorber = new TextAbsorber();
pdfDocument.Pages.Accept(textAbsorber);

The following is the stack trace

System.NullReferenceException: Object reference not set to an instance of an object.
at #=zqw9ISzvB3tQKO7TL$dspb318g8$9UGOTeALZC$NB2R2FLprE8wwMOSs=.#=zVFAePH4=(Operator #=zfCQtINs=)
at #=zqw9ISzvB3tQKO7TL$dspb318g8$9UGOTeALZC$NB2R2FLprE8wwMOSs=.#=zFhW_v7A=(Page #=z2gjj94w=)
at #=z2bf_Y9PL$CLSpDtNy_vJP6XY2hfHuzZHkX6klgBv0C0C0hdYwDUYCgVCypn_.#=zClYf6jIXe4jR(BaseOperatorCollection #=zb9_QUl8=, Resources #=zy6pxI7I=, Page #=z2gjj94w=, Rectangle #=zeUw50yLmO7N1)
at #=z2bf_Y9PL$CLSpDtNy_vJP6XY2hfHuzZHkX6klgBv0C0C0hdYwDUYCgVCypn_.#=zClYf6jIXe4jR(BaseOperatorCollection #=zb9_QUl8=, Resources #=zy6pxI7I=, Rectangle #=zeUw50yLmO7N1)
at #=z2bf_Y9PL$CLSpDtNy_vJP6XY2hfHuzZHkX6klgBv0C0C0hdYwDUYCgVCypn_.#=zNnzg6V4=()
at #=z2bf_Y9PL$CLSpDtNy_vJP6XY2hfHuzZHkX6klgBv0C0C0hdYwDUYCgVCypn_…ctor(Page #=z2gjj94w=, TextSearchOptions #=zHKzPPGHY0sR6, Boolean #=zgNGVpxPgz4zS)
at #=z2bf_Y9PL$CLSpDtNy_vJP6XY2hfHuzZHkX6klgBv0C0C0hdYwDUYCgVCypn_…ctor(Page #=z2gjj94w=, TextSearchOptions #=zHKzPPGHY0sR6)
at Aspose.Pdf.Text.TextAbsorber.Visit(Page page)
at Aspose.Pdf.Page.Accept(TextAbsorber visitor)
at Aspose.Pdf.PageCollection.Accept(TextAbsorber visitor)

@trentcioran @OAAdmin
Unfortunately, no changes yet.
I additionally wrote to the development team asking them to take up this task, even though it is low-priority.

The issues you have found earlier (filed as PDFNET-54671) have been fixed in Aspose.PDF for .NET 24.6.

Still getting the same error aspose.pdf 25.1.0 in a .NET Framework 4.8 solution

Okay a bit of further clarification. When we added Aspose.PDF to our Solution using nuget we were seeing this problem. However, when I did this again, took note of all the secondary nuget packages it wanted to install beforehand, then added nuget references to those first and made sure all those packages were fully up to date, and THEN I added the Aspose.PDF package again so now it was the only package it wanted to install … the problem no longer occurred.

So as long as you make sure ALL the nuget packages needed for Aspose.PDF and your Solution are up to date I think the problem doesn’t happen.

@kidkeogh
.NET Framework 4.8 is currently not supported in the main nuget package. Are you using the dll downloaded from here?

Hello Sergei, I’m really sorry I forgot to check for notifications.

I reviewed all our bindings and in our case the software is now working fine. Our solution still targets .NET Framework 4.8 and we are now using Aspose.PDF 25.2.0 through nuget.

@kidkeogh
I’m glad your issue was solved.
Thanks for your feedback.

1 Like