ITextSharp PDFTemplate FormFlattening removes filled data

浪尽此生 提交于 2019-11-28 11:24:40

Most likely you can resolve this when using iTextSharp 5.4.4 (or later) by forcing iTextSharp to generate appearances for the form fields. In your example code:

var form = stamper.AcroFields;
form.GenerateAppearances = true;

Resolved the issue by using a previous version of ITextSharp (5.4.3). Not sure what the cause is though...

I found a working solution for this for any och the newer iTextSharp. The way we do it was: 1- Create a copy of the pdf temmplate. 2- populate the copy with data. 3- FormFlatten = true and setFullCompression 4- Combine some of the PDFs to a new document. 5- Move the new combined document and then remove the temp.

This way we got the issue with removed input and if we skipped the "formflatten" it looked ok.

However when we moved the "FormFlatten = true" from step 3 and added it as a seperate step after the moving etc was complete, it worked perfectly.

Hope I explained somewhat ok :)

In your PDF File, change the property to Visible, the Default value is Visible but not printable.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!