PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Tue Mar 19, 2024 4:21 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: Thu Mar 31, 2022 10:01 pm 
Offline

Joined: Thu Mar 31, 2022 9:55 pm
Posts: 3
Hi people, I have used PDFSharp to populate form fields from and xml datasource. I then flattened the pdf.

The pdf look fine when viewed in Adobe but when printed using ghostscript the acrofields don't display values.

Any IDeas?

foreach (var pdfField in form.Fields)
{
string MetaValue;
string CurrentField = form.Fields[i].Name.ToString();
if (metadata.TryGetValue(CurrentField, out MetaValue))
{

form.Fields[i].Value = new PdfString(MetaValue);


}
i++;
}
if (form.Elements.ContainsKey("/NeedAppearances"))
{
form.Elements["/NeedAppearances"] = new PdfBoolean(true);
}
else
{ form.Elements.Add("/NeedAppearances", new PdfBoolean(true)); }


Top
 Profile  
Reply with quote  
PostPosted: Thu Apr 07, 2022 6:18 am 
Offline

Joined: Thu Mar 31, 2022 9:55 pm
Posts: 3
I changed the PDFSharp dll to "FlatteningPDFSharp" and the program worked without changing any code!


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: No registered users and 21 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