PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 1:32 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri May 04, 2018 6:10 am 
Offline

Joined: Tue Apr 24, 2018 10:02 am
Posts: 5
I found a bug, its throwing NUllPointerException on setting the value of textfield to something else.

I've prepared a project with example pdf file which you have to put into C:\PDF\example.pdf

Thanks for pdfsharp :D

its too big for forum size so here it is:
https://www31.zippyshare.com/v/1tmx55Hu/file.html


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 28, 2020 12:26 pm 
Offline

Joined: Mon Jan 27, 2020 1:38 pm
Posts: 2
There is a bug in PdfTextField.RenderAppearance(). The lines marked with '+' need to be added.

PdfFormXObject xobj = form.PdfForm;
+ if (xobj.Stream == null)
+ {
+ xobj.CreateStream(Encoding.ASCII.GetBytes(text));
+ }
string s = xobj.Stream.ToString();


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 30, 2020 9:51 am 
Offline

Joined: Mon Jan 27, 2020 1:38 pm
Posts: 2
My mistake - my brain was working with several things at once.

The problem in PdfTextField.RenderAppearance() is that XGraphics gfx = XGraphics.FromForm(form) needs to be wrapped in a using statement. The needed stream is created in XGraphics.Dispose (actually in XGraphics.Close, but that is called from Dispose).


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 45 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:  
cron
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group