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

Repeatedly Importing file with AcroForm, possible?
http://forum.pdfsharp.com/viewtopic.php?f=2&t=3676
Page 1 of 1

Author:  Asmodai [ Wed Oct 18, 2017 3:54 pm ]
Post subject:  Repeatedly Importing file with AcroForm, possible?

We've been using PDFSharp to fill in forms using a database and it's worked great.

Up until now we just open a pre-made PDF for modify, fill in the AcroForm fields using the database and then save to stream (so the original file doesn't change). Again, so far so good.

Now however we'd like to use a single page PDF as a template and repeat it per database record so the final result is a multi-page PDF with each page being the same except the values in the AcroForm fields which are populated differently for each database record.

Looking at the samples for combining PDFs I can make a new PDF and import the page from the template PDF for each record but opening the template for Import and copying the page doesn't seem to bring the AcroForm. Also most of the AcroForm fields in the API seem to be read-only and I suspect even if I can get it into the new document if the fields all have the same name then they'll share a single value instead of different values for page... so I'll need to rename the fields in the generated document with maybe a count on the end. For example:
Template Field Name: Name
Generated Document Field Name: Name1, Name2, Name3...Name{N} where {N} is the number of pages.

Is this even possible with PDFsharp? Anyone have any experience with something like this or have another way to accomplish it that I'm not thinking of?

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