c# - How to copy form fields with PdfWriter not PdfCopy in iTextSharp -


i merge 2 pdf files (only selected pages) , add custom headers , footers them.

therefore not use pdfcopy copies page without altering it. use pdfwriter.

the problem not know how copy acrofields, acroforms, annotations , else except content pdfwriter.

do know how this?

you want use getimportedpage method of pdfwriter class. copies pdfimportedpage can use.

pdfreader pdfreader = new pdfreader(originalfile); pdfimportedpage importedpage = pdfwriter.getimportedpage(pdfreader, pagenumber); 

as example, can place previous code in onopendocument event of pdfpageeventhelper , in onendpage event can use directcontentunder object of pdfwriter place entire page underneath current page.

pdfwriter.directcontentunder.addtemplate(importedpage, 0, 0); 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -