PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.de/

PDF Sharp overwriting field values on AddPage()
http://forum.pdfsharp.de/viewtopic.php?f=2&t=4397
Page 1 of 1

Author:  birmsi [ Sat Oct 15, 2022 1:17 pm ]
Post subject:  PDF Sharp overwriting field values on AddPage()

Hello.
I'm filling a couple of fillable form pdfs and trying to add them together to create a new pdf.

Creating, filling, and saving the pdf's into disk is done.

What is not working is creating a new pdf, with all the others.

I'm Iterating all the pdfs from the system, and one by one:

Code:
var docToImport = PdfReader.Open(pathToPdf, PdfDocumentOpenMode.Import);
doc.AddPage(docToImport.Pages[0]);


After iterating over all pdfs
just

Code:
docFromFileSystem.Save(output);


The correct number, and pdfs are inserted.
BUT the issue is that if any form field has the same name as other field, it gets replaced by the new one.
This is preventing me from adding more of the same pdf pages (same form, but different data filled) to the same pdf.

Any way to prevent this behaviour and just insert the pdfs without chaning the data?

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