PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Tue Mar 19, 2024 7:11 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
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  
PostPosted: Fri Aug 26, 2022 12:34 pm 
Offline

Joined: Thu Aug 25, 2022 6:41 pm
Posts: 2
I also have the same problem.Has anyone been able to solve this problem?
Thanks everyone for the help :) .


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

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 49 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