Missing form field content after merging PDF documents
Posted: Mon Jun 06, 2016 11:32 am
Hi,
after merging two PDF documents by using MergeDocuments(GDPicturePDF[]) the form field contents of the second PDF document were missing in the output file.
When merging three documents the form field contents of the last two documents were missing.
The contents of the first page's form fields where always retained in the output file.
Applying SetFormFieldVisibility() to every field in each document didn't change anything.
Thanks for your support!
after merging two PDF documents by using MergeDocuments(GDPicturePDF[]) the form field contents of the second PDF document were missing in the output file.
When merging three documents the form field contents of the last two documents were missing.
The contents of the first page's form fields where always retained in the output file.
Applying SetFormFieldVisibility() to every field in each document didn't change anything.
Thanks for your support!
Code: Select all
public GdPicturePDF Merge(GdPicturePDF[] inputFiles, string outputFile)
{
GdPicturePDF mergedFile = new GdPicturePDF();
var output = mergedFile.MergeDocuments(inputFiles);
int i = 0;
int formFieldId = output.GetFormFieldId(i);
while (i < output.GetFormFieldsCount())
{
output.SetFormFieldVisibility(formFieldId, PdfFormFieldVisibility.PdfFormFieldVisible);
formFieldId = output.GetFormFieldId(i++);
}
output.SaveToFile(outputFile);
output.CloseDocument();
return output;
}