Unplanned
Last Updated: 22 Dec 2020 10:49 by ADMIN
Fadi
Created on: 22 Dec 2020 10:34
Category: PdfProcessing
Type: Bug Report
2
PdfProcessing: Form Fields are not copied when merging documents` pages using PdfStreamWriter

When merging documents` pages using the PdfStreamWriter the Form Fields are not copied:

using (PdfStreamWriter fileWriter = new PdfStreamWriter(File.OpenWrite(document2Name)))
{
	// Iterate through the files you would like to merge 
	for (int i = 0; i < 2; i++)
	{
		// Open each of the files 
		using (PdfFileSource fileToMerge = new PdfFileSource(File.OpenRead(document1Name)))
		{
			// Iterate through the pages of the current document 
			foreach (PdfPageSource pageToMerge in fileToMerge.Pages)
			{
				// Append the current page to the fileWriter, which holds the stream of the result file 
				fileWriter.WritePage(pageToMerge);
			}
		}
	}
}

A possible workaround is to use the RadFixedDocument`s Merge() method: 

document1.Merge(document2);

 

0 comments