PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Jul 31, 2021 2:26 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Mon Feb 01, 2021 11:15 pm 
Offline

Joined: Mon Feb 01, 2021 10:37 pm
Posts: 1
I'm getting a system.NullReferenceException when I'm assigning a text value to a PDF form that I created in Acrobat Pro DC. The stack trace indicates it's happening deep in the PdfSharp.Pdf.AcroForms.PdfTextField.RenderAppearance() code. Here's the stack trace:

at PdfSharp.Pdf.AcroForms.PdfTextField.RenderAppearance()
at PdfSharp.Pdf.AcroForms.PdfTextField.set_Text(String value)
at <my code that assigns the text value>

This line is causing the exception: ((PdfTextField)field).Text = origValue;

I'm new to PdfSharp, so I'm guessing I must have missed something basic.

Can anyone lend some insight? What do I need to do to stop throwing this exception?

Oh, by the way, I get the same error when I run the sample code for filling out form fields.

If I wrap the assignments in a try/catch block and ignore the exceptions, the form is filled out correctly. I can open it in Adobe Acrobat and see all the data so it seems like a bug in PdfSharp.

Thanks in advance,
Ken


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 24 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group