|
Rank: Member Groups: Member
Joined: 7/31/2012 Posts: 10
|
After upgrading from 22.1.42 to the 22.1.67 the following pdf will generate an exception now. https://www.fmcsa.dot.gov/sites/fmcsa.dot.gov/files/2022-03/Medical%20Examiner%27s%20Certificate%20Form%20MCSA-5876.pdfQuote:System.Exception: Target can not be null. at EO.Internal.fkbl..ctor(fkbk dau) at EO.Internal.fkcp.bohe(fkco djr, String djs, fkbk djt) at EO.Internal.fjpc.iyoh() at EO.Internal.fjpc.iyof() at EO.Pdf.PdfField.cuvh() at EO.Pdf.PdfField.blwy() at EO.Internal.fjph.blwy() at EO.Pdf.PdfDocument.nxik() at EO.Pdf.PdfDocument.Save(Stream stream) It's specifically the three PdfComboBoxField State Fields that cause the error. I believe it might be related to them having Items with only Labels and null Values. In the previous version there was also a problem when viewing the filled document in Chrome. The selected item is not visible until it the input receives focus but it displays fine in Adobe Reader. Quote: [TestMethod] public void WorksBefore1() { PdfDocument doc = new PdfDocument(PdfFileName); var field = doc.Fields["cmvState"] as PdfComboBoxField; field.SelectedIndex = 1; field.Modified(); doc.Save("../../../output1.pdf"); }
[TestMethod] public void WorksBefore2() { PdfDocument doc = new PdfDocument(PdfFileName); var field = doc.Fields["cmvState"] as PdfComboBoxField; field.Value = "TX"; field.Modified(); doc.Save("../../../output2.pdf"); }
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Thanks for letting us know. We have confirmed this to be an issue in the current build. This issue will be fixed in our next build and we will reply here again as soon as the new build is available.
|
|
Rank: Member Groups: Member
Joined: 7/31/2012 Posts: 10
|
On the second part about the forms not showing the value until they receive focus this might be relevant. It's a separate project pdfium but it's also based on chrome so there might be some similar base source. https://stackoverflow.com/questions/66227256/when-filling-a-pdf-document-with-pdfsharp-the-filled-form-doesnt-show-the-valu[quote] if (acroForms.Elements.ContainsKey("/NeedAppearances")) acroForms.Elements["/NeedAppearances"] = new PdfBoolean(true); else acroForms.Elements.Add("/NeedAppearances", new PdfBoolean(true)); [quote]
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
Yes. This is a separate but related issue and it will also be addressed in our next build.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 7/31/2012 Posts: 10
|
That was fast. Thank you so much that is amazing.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
You are very welcome. This is just to let you know that we have posted a new build that should resolve both issues. You can download it from our download page. Please let us know how it goes.
Thanks!
|
|