Welcome Guest Search | Active Topics | Sign In | Register

Some fields throw NullReferenceException on Color and Font properties and if they get a value set, saving of PDF fails as well Options
Maxim
Posted: Tuesday, March 13, 2018 6:13:43 AM
Rank: Advanced Member
Groups: Member

Joined: 12/18/2013
Posts: 67
Hello.

Some PDF fields throw NullReferenceException when you try to see the value of Color and/or Font properties.

If you set a value to such text field (with checkbox field it works) and then try to Save the document to a file or MemoryStream, it will throw NullReferenceException exception.

This bug did not exist in EO.Pdf version 17.2.43.0 and has been in every version after that including the latest version 18.1.7.

This is the code to reproduce the issue:

Code: C#
// DOCUMENT 1 (NullReferenceException_1.pdf)

var pdfPath1 = @"C:\Data\Dev\TheIssue20180313\NullReferenceException_1.pdf";
var pdf1 = new EO.Pdf.PdfDocument(pdfPath1);

// if only these 2 checkbox fields are filled in, then it saves OK
pdf1.Fields["Falt_1"].Value = "1";
((PdfCheckBoxField)pdf1.Fields["Falt_78"]).Checked = true;

// if any text field below is filled in, then saving fails
pdf1.Fields["order_number"].Value = "order number";
pdf1.Fields["Falt_55"].Value = "person 2 name";
pdf1.Fields["Falt_80"].Value = "person 2 id";

pdf1.Save(@"C:\Data\Dev\TheIssue20180313\NullReferenceException_1 (filled in).pdf");


// DOCUMENT 2 (NullReferenceException_2.pdf)

var pdfPath2 = @"C:\Data\Dev\TheIssue20180313\NullReferenceException_2.pdf";
var pdf2 = new EO.Pdf.PdfDocument(pdfPath2);

// if only below text field is filled in, then it saves OK
pdf2.Fields["Namnförtydligande"].Value = "MAXIM"; 

// if this text field is filled in, then saving fails
pdf2.Fields["Text Field 1"].Value = "111";

pdf2.Save(@"C:\Data\Dev\TheIssue20180313\NullReferenceException_2 (filled in).pdf");


You can see that checkbox fields in the first document also throw NullReferenceException on Color/Font properties, but if only they get a value, then the document can be saved.

You can also see that the second PDF file has 2 pages. And the field on the first page doesn't throw NullReferenceException on Color/Font properties and if only this field gets a value, then document can be saved. But all 3 fields from the second page throw exception and saving fails if any of them gets a value before saving.

The PDF files can be downloaded from this link: the link to PDF file 1, the link to PDF file 2
This image shows NullReferenceException on Color and Font properties: the link to the image

Of course if such document is sent to PdfDocument.Merge method, then this method throws an exception as well.

I'll send you these files with the code to your support email in a few mins if you don't want to download the files from dropbox.

Please have a look at this as soon as you can, our clients are angry at us, because they first had to wait because of the issue with Swedish characters and now after that issue seems to be fixed in the latest build I can't use it with the fix because of this issue I run into which exists since version 17.2.75.

Thank you!
Best regards,
Maxim
eo_support
Posted: Tuesday, March 13, 2018 11:02:59 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,070
Hi,

We have looked into this issue. The root of the problem is because the font set for the input field is invalid. We will change our code to ignore such errors and provide you a new build as soon as possible.

Thanks!
Maxim
Posted: Wednesday, March 14, 2018 5:29:05 AM
Rank: Advanced Member
Groups: Member

Joined: 12/18/2013
Posts: 67
Hi,

Sounds good, thank you!
Maxim
Posted: Friday, March 16, 2018 2:28:43 AM
Rank: Advanced Member
Groups: Member

Joined: 12/18/2013
Posts: 67
Hello!

Is there any expected time a new build with the fix for this issue and the fix for the issue from the topic "The library doesn't see the field as a field, so it's not possible to set its value" will come? Our clients keep asking us when we'll fix the issue with Swedish characters and as I wrote I can't use the latest build with that issue fixed because of these 2 things.

Best regards,
Maxim
eo_support
Posted: Friday, March 16, 2018 8:10:57 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,070
Hi,

The new build should be available early next week.

Thanks!
eo_support
Posted: Tuesday, March 20, 2018 9:41:24 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,070
Hi,

This is just to let you know the new build has been posted. Please take a look and let us know how it goes.

Thanks!
Maxim
Posted: Tuesday, March 20, 2018 9:50:37 AM
Rank: Advanced Member
Groups: Member

Joined: 12/18/2013
Posts: 67
Hi,

Thank you for the update. I noticed it this morning here https://www.essentialobjects.com/ChangeLog.aspx

I'm testing now, I'll let you know!

Thanks!
Maxim
Posted: Tuesday, March 20, 2018 11:24:39 AM
Rank: Advanced Member
Groups: Member

Joined: 12/18/2013
Posts: 67
Hello,

I've run into another issue after the update to the latest version which didn't exist in EO.Pdf version 17.2.43.0.

When EO.Pdf tries to open 1 file from our files it crashes with "Object reference not set to an instance of an object" exception. I removed everything from that file, the file now has only 1 page with 1 line and it fails to open it with EO.Pdf.

Why does it fail? It did work fine in the version 17.2.43.0.

The link to the file is this: the link to the file
The printscreen of the exception: the link to the printscreen with the exception

Could you please have a look at this?

Best regards,
Maxim
eo_support
Posted: Tuesday, March 20, 2018 4:40:43 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,070
Hi,

We have looked into this and confirmed this to be an issue on our end. We will fix it in our next build and reply here again when the new build is posted.

Thanks!
eo_support
Posted: Wednesday, March 21, 2018 10:34:52 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,070
Hi,

We have posted a new build that should fix this problem. You can download the new build from our download page. Please take a look and let us know how it goes.

Thanks!
Maxim
Posted: Wednesday, March 21, 2018 10:48:14 AM
Rank: Advanced Member
Groups: Member

Joined: 12/18/2013
Posts: 67
Hi,

Thanks! Will have a look now and will get back then!
Maxim
Posted: Thursday, March 22, 2018 8:50:03 AM
Rank: Advanced Member
Groups: Member

Joined: 12/18/2013
Posts: 67
Hi,

These issues are fixed, but I found another bug with Swedish characters and Adobe Acrobat Reader :/ It's insane how much time I spent on the testing in total already...

I'll update the topic about Swedish characters now.

Best regards,
Maxim
eo_support
Posted: Thursday, March 22, 2018 8:54:35 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,070
Ah. I apologize for the issues. Please try to run as many files as possible on your end so that we can fix them together instead of one by one. Hopefully this will be faster to get all the issues resolved for you.
Maxim
Posted: Thursday, March 22, 2018 8:57:14 AM
Rank: Advanced Member
Groups: Member

Joined: 12/18/2013
Posts: 67
It was the final test already on all files. I was already going to write you that "it's all good, thank you", but no, found another issue :) I'm writing the explanation and preparing the test file for you now.
eo_support
Posted: Thursday, March 22, 2018 9:02:17 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,070
Great. We will work on it as soon as we receive them.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.