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.

Thu Apr 25, 2019 3:32 am

Hi,

I have ran into NullReferenceException issue while trying to use the ExtractText Function.

I have 2 scenarios, 1 which is working and 1 which is not.
For the one that is working, I used a PDF that is generated from IText.
For the one that is hitting the NullReferenceException, the PDF used was generated from PrinceXML.


The code used was the following:
Spire.Pdf.PdfDocument doc = new Spire.Pdf.PdfDocument();
doc.LoadFromFile(@"C:\Users\TestUser\Desktop\TestFolder\Admin_Note.pdf");
int pageCount = doc.Pages.Count; //This is to check if document really contains same page as my PDF document

//Extract text from page
for (int i = 0; i < pageCount; i++)
{
if (i == 0)
{
//partialText = doc.Pages[i].ExtractText(); //This doesnt works too
partialText = doc.Pages[i].ExtractText(new Rectangle(0, 0, 300, 300)); //I changed the values for the Rectangle constructor but it doesnt work too. An exception of type
//'System.NullReferenceException' occurred in Spire.Pdf.dll but was not handled in user code
//Object reference not set to an instance of an object.

StringBuilder sb = new StringBuilder();
sb.AppendLine(partialText);
Debug.WriteLine(sb);
}
StringBuilder content = new StringBuilder();
content.Append(doc.Pages[i].ExtractText());
Debug.WriteLine("Text from page " + (i+1) + ": " + content);
}
Last edited by qwertity123 on Tue Apr 30, 2019 6:58 am, edited 1 time in total.

qwertity123
 
Posts: 11
Joined: Thu Apr 25, 2019 3:14 am

Thu Apr 25, 2019 3:47 am

Hello,

Thanks for your inquiry.
To help us look into your issue accurately and quickly, please provide your testing PDF file that was generated from PrinceXML. You could send it to us via email ([email protected]).

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1536
Joined: Wed Apr 25, 2018 3:20 am

Thu Apr 25, 2019 4:03 am

Lisa.Li wrote:Hello,

Thanks for your inquiry.
To help us look into your issue accurately and quickly, please provide your testing PDF file that was generated from PrinceXML. You could send it to us via email ([email protected]).

Sincerely,
Lisa
E-iceblue support team


I have just sent my PrinceXML PDF to the support email. I look forward to hear from you soon. Thank you so much!

qwertity123
 
Posts: 11
Joined: Thu Apr 25, 2019 3:14 am

Thu Apr 25, 2019 5:48 am

Hello Fabian,

Thank you for sharing the testing file.
I have reproduced the NullReferenceException and logged it into our bug tracking system for further investigating and fixing, once there is any progress, we will let you know. Sorry for the inconvenience caused.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1536
Joined: Wed Apr 25, 2018 3:20 am

Thu Apr 25, 2019 5:59 am

Lisa.Li wrote:Hello Fabian,

Thank you for sharing the testing file.
I have reproduced the NullReferenceException and logged it into our bug tracking system for further investigating and fixing, once there is any progress, we will let you know. Sorry for the inconvenience caused.

Sincerely,
Lisa
E-iceblue support team


Hi Lisa,

Thank you for the update.
I look forward to any updates from the support team if there is any progress regarding this issue.
If there is no quick fix to this, I also look forward to hear it from your team. Thank you so much :)

Regards,
Fabian

qwertity123
 
Posts: 11
Joined: Thu Apr 25, 2019 3:14 am

Thu Apr 25, 2019 7:20 am

Hello,

Sure, I will keep you informed about any update that I get from our Dev team. Thanks for your understanding.

Sincerely,
Lisa
E-icbelue support team
User avatar

Lisa.Li
 
Posts: 1536
Joined: Wed Apr 25, 2018 3:20 am

Fri Apr 26, 2019 9:15 am

Lisa.Li wrote:Hello,

Sure, I will keep you informed about any update that I get from our Dev team. Thanks for your understanding.

Sincerely,
Lisa
E-icbelue support team


Hi Lisa,

Just want to get some update from you. Is there any progress/news from the Dev Team?
Probably something like whether this is going to be a quick fix or it's going to be a cumbersome process to solve the extracting text issue on PrinceXML generated documents?

Best Regards,
Fabian

qwertity123
 
Posts: 11
Joined: Thu Apr 25, 2019 3:14 am

Fri Apr 26, 2019 11:07 am

Hello,

Thank you for following up.
Sorry your reported issue has not been resolved yet, our dev team is still working on it. I have given your issue a higher priority and requested them to share any possible ETA at their earliest. If there is any good news, we will let you know at once.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1536
Joined: Wed Apr 25, 2018 3:20 am

Tue Apr 30, 2019 12:46 am

Lisa.Li wrote:Hello,

Thank you for following up.
Sorry your reported issue has not been resolved yet, our dev team is still working on it. I have given your issue a higher priority and requested them to share any possible ETA at their earliest. If there is any good news, we will let you know at once.

Sincerely,
Lisa
E-iceblue support team


Hi Lisa,

Thank you for putting this issue on a higher priority :)
Pardon me for asking again, is there any updates from the Dev Team regarding the failure to extract text from PrinceXML PDFs?


Best Regards,
Fabian

qwertity123
 
Posts: 11
Joined: Thu Apr 25, 2019 3:14 am

Tue Apr 30, 2019 1:25 am

Hello,

Thanks for your patient waiting. I got the news from our Dev team that your issue has been resolved and it is in the testing phase, once the tests pass, we will prepare a hotfix for you ASAP.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1536
Joined: Wed Apr 25, 2018 3:20 am

Tue Apr 30, 2019 1:37 am

Lisa.Li wrote:Hello,

Thanks for your patient waiting. I got the news from our Dev team that your issue has been resolved and it is in the testing phase, once the tests pass, we will prepare a hotfix for you ASAP.

Sincerely,
Lisa
E-iceblue support team


Hi Lisa,

Thank you so much for following up with this so meticulously.
Looking forward to hear from you regarding the release of the hotfix. :)

Best Regards,
Fabian

qwertity123
 
Posts: 11
Joined: Thu Apr 25, 2019 3:14 am

Tue Apr 30, 2019 1:52 am

Hello,

OK, once the hotfix version is a available, we will let you know immediately.
Have a nice day!

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1536
Joined: Wed Apr 25, 2018 3:20 am

Wed May 01, 2019 9:53 am

Hello,

Thanks for your patient waiting.
The reported issue has been fixed in Spire.PDF Pack(Hot Fix) Version:5.5.1. Welcome to test it and any feedback will be greatly appreciated.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1536
Joined: Wed Apr 25, 2018 3:20 am

Wed May 01, 2019 1:09 pm

Lisa.Li wrote:Hello,

Thanks for your patient waiting.
The reported issue has been fixed in Spire.PDF Pack(Hot Fix) Version:5.5.1. Welcome to test it and any feedback will be greatly appreciated.

Sincerely,
Lisa
E-iceblue support team


Hi Lisa,

Thanks for updating me w the hotfix. I will try the hotfix tomorrow and let you know after I have tested it. Thank you so much :)


Best Regards,
Fabian

qwertity123
 
Posts: 11
Joined: Thu Apr 25, 2019 3:14 am

Thu May 02, 2019 4:27 am

Lisa.Li wrote:Hello,

Thanks for your patient waiting.
The reported issue has been fixed in Spire.PDF Pack(Hot Fix) Version:5.5.1. Welcome to test it and any feedback will be greatly appreciated.

Sincerely,
Lisa
E-iceblue support team


Hi Lisa,

I have tried the Hotfix and the text extraction works when i use .LoadFromFile(path).

New Issue:
1) I can work with the above but I would like to highlight another issue which is that I am not able to extract text if i use the .LoadFromStream(MemoryStream stream).

Clarifications:
1) Can I check with you/your Dev Team if the text extracted from PrinceXML PDFs always contains duplicates? For e.g. (22 DEC 2017 is read as "2222 DDEECC 22001177")

Thank you so much and I look forward to hear from you soon.

Best Regards,
Fabian
Last edited by qwertity123 on Thu May 02, 2019 8:09 am, edited 1 time in total.

qwertity123
 
Posts: 11
Joined: Thu Apr 25, 2019 3:14 am

Return to Spire.PDF

cron