PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Aug 13, 2020 2:11 pm

All times are UTC

Forum rules

Please read this before posting on this forum: Forum Rules

Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Merging completed forms
PostPosted: Wed Dec 12, 2012 7:33 pm 

Joined: Wed Dec 12, 2012 7:10 pm
Posts: 1
I'm having an issue merging completed forms. Basically I have a PDF template with many form fields and an example of the basic logic flow is:
1 - Open PDF template and fill in the form fields
2 - Save the completed form to a temp file location
3 - Open the temp file and merge into an existing PDF document

Repeat steps 1 - 3 until all forms completed.

The problem is when I open the final completed/merged PDF, all of the forms now have identical values (they are all the same as the very first PDF form that was completed. My best guess is this is because each completed form has fields with identical names and so all the fields with the same name are automatically being updated to the first value? After step 2 above I can pause the application and verify each individual temporary file has different data before the merge, but after the merge they all have the same data.

Is there anyway to avoid this? I was looking for some function like "flatten" I'd seen in other tools to kind of get rid of the fields and lock the values, but I'm not seeing this. Is there some other method to avoid what I'm seeing?

BTW, I'm using PdfSharp-WPF ver 1.32.2608

Thanks in advance for any help!

Reply with quote  
PostPosted: Fri Aug 14, 2015 7:11 pm 

Joined: Fri Aug 14, 2015 6:44 pm
Posts: 2
I am interested in this as well in order to avoid a problem in tablets.

Reply with quote  
PostPosted: Thu Feb 01, 2018 5:50 pm 

Joined: Wed Jan 31, 2018 3:19 pm
Posts: 4

My request i simular.
1. I have a pdf with a page containing a form as template
2. Fill out the form, and place the filled out page inte a new document.
3. repeat #2 some times...
4. convert the new document to a pdf without the form but keep the filled in texts.

I have steps 1-3 working , but not #4 ,is there a way to convert document with form to just text document?


Reply with quote  
PostPosted: Sun Dec 01, 2019 2:24 am 

Joined: Fri Nov 29, 2019 8:51 am
Posts: 3
The problem with merge/concatenate forms in PDF is that form field names are globally shared within the same document. So if multiple pages in the same document share the same form field names, all the fields will have the same value. To fix this issue is to rename the fields for each document before merging/concatenating.

public void RenameAcroField(PdfAcroField field, string newFieldName)
field.Elements.SetString("/T", newFieldName);

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

All times are UTC

Who is online

Users browsing this forum: No registered users and 8 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