PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Merging completed forms
https://forum.pdfsharp.net/viewtopic.php?f=2&t=2264
Page 1 of 1

Author:  ccarpediem [ Wed Dec 12, 2012 7:33 pm ]
Post subject:  Merging completed forms

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!

Author:  canrobbo [ Fri Aug 14, 2015 7:11 pm ]
Post subject:  Re: Merging completed forms

I am interested in this as well in order to avoid a problem in tablets.

Author:  looc [ Thu Feb 01, 2018 5:50 pm ]
Post subject:  Re: Merging completed forms

Hi

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?

//b.

Author:  ifroggy2 [ Sun Dec 01, 2019 2:24 am ]
Post subject:  Re: Merging completed forms

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);
}

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/