textElement.ToString() no longer works

I started with an issue where a dash ‘-’ was no longer being out in the location. It may have never worked, but I think it did.

I noticed there was an update, so I updated. Now, when my code attempts textElement.ToString(), like in the examples, I get an error:

Message=Object reference not set to an instance of an object.
at  .()
at  .()
at  .(Boolean , Int32 , Int32 ,  , Boolean& )
at  . ()
at  ..(PdfFontFace )
at  ..( , Boolean )
at  .[TArg]( , Func3 , TArg ) at  .( , Func2 )
at  .(PdfFontFace ,  & ,  & )
at  …ctor(IEnumerable1 , PdfTextOptions , PdfMatrix , StringBuilder , IList1 )
at GemBox.Pdf.Content.PdfTextContent.(StringBuilder )
at GemBox.Pdf.Content.PdfTextContent.ToString()
at _3up_to_1up.PdfClass.SetText(PdfPage newPage, PdfTextContent textElement, PdfQuad bounds, PdfPoint offset) in H:\repos\Prep\Common\3up_to_1up\PdfClass.cs:line 220

This previously worked for all but the dash ‘-’




Hi James,

Can you please send us the PDF file that reproduces your issue so that we can investigate it?
You can send a file to us via email or support ticket, see the Contact page.


This is actually two different issues I realize now. This one should be deleted and I’ll create one for the primary issue and deal with the upgrade issue at a later date.


I have a support ticket # 32022 that has more info and a file uploaded. It is dealing with the not drawing of the dashes ‘-’

I decided not to update unless I am told it is fixed in the newer version. This is becoming a critical issue as we have a client that we cannot process their data until this is fixed. I am concerned that no one has taken my Support Ticket yet.

It seems that the NullReferenceException doesn’t occur with the current latest version:

Install-Package GemBox.Pdf -Version 17.0.1484-hotfix