xfa

iTextSharp need to repeat table rows with textfield dynamically

半腔热情 提交于 2020-01-16 04:04:29
问题 I am reading and filling a dynamic pdf template(having dynamic table with textfields in each cell) below way using iTextSharp [assuming I would be getting a single product info from source]: FileStream fs = new FileStream("C:\\ABC\\DestinationFile.pdf", FileMode.Create); PdfReader reader = new PdfReader("C:\\ABC\\SourceTemplateFile.pdf"); PdfStamper stamper = new PdfStamper(reader, fs); xfa = stamper.AcroFields.Xfa; string[] strProductList = productInfo.Product.Split('|'); string dName=

XPath not working correctly with XFA

隐身守侯 提交于 2019-12-25 09:47:10
问题 I have a dynamic PDF form that has a DropDownList. I'm using iTextSharp to try and modify the values inside the PDF before sending it out to the client. Here's what I'm trying, as per an answer in this question: PdfReader reader = new PdfReader(myPdfPath); XmlDocument xdoc = reader.AcroFields.Xfa.DomDocument; XmlNode dropdown = xdoc.SelectSingleNode("/*/template/subform[@name='form1']/subform[@name='form2']/field[@name='DropDownList1']"); But no matter what XPath expression I use (ex: /

List attributes of an XFA Object using Javascript in a PDF

冷暖自知 提交于 2019-12-23 13:15:34
问题 I'm trying to create a PDF document with several text fields that can grow in height up to some maximum value. Due to the constraints of the project, I'm using Adobe Designer 7, which happily allows Javascript. However, the objects in XFA are a little different from the HTML DOM or earlier PDF DOMs. So, I know for certain that my field, TextField1, has certain attributes, such as "h", which controls the height. The code below only lists the methods on TextField1, but not the attributes: -----

How to digitally sign PDF files with XFA forms using iText

独自空忆成欢 提交于 2019-12-23 04:08:09
问题 iText release notes mention that signing of PDFs with XFA forms is supported from iText versions 5.4.2 and 5.4.3: http://itextpdf.com/history/?branch=54&node=542 http://itextpdf.com/history/?branch=54&node=543 Is there a documentation somewhere how to do the signing in Java? I am specifically interested in signing PDFs with XFA where there is a prepared field for signature. 回答1: This is a small example showing how to sign using XmlDSig: PdfReader reader =new PdfReader(src); FileOutputStream

C# to read XFA form data

旧巷老猫 提交于 2019-12-22 10:58:13
问题 I am trying to programmatically read the field values from a Livecycle created form. I tried opening the document using the Acrobat COM component and it seemed to work and with some reflection I managed to get the actual field names, but the value for each field is the hard part, as it seems. Furthermore, I know believe that I actually need to use a different approach to extract the values, since it is an XFA form PDF. (Please don't tell me to look into the examples provided in the Adobe PDF

PDFTK not working to fill out pdf form created in livecycle

ぃ、小莉子 提交于 2019-12-21 04:39:39
问题 I created a form in livecycle es 2 and i am trying to use pdftk to fill out the form but it doesn't work. It says it fills it out successfully but when i try to open the pdf it just gives me an error saying "If this message is not eventually replaced by the proper contents of the document, your PDF viewer may not be able to display this type of document." Below is the code i am using to fill out the pdf <?php error_reporting(E_ALL); ini_set('display_errors', 1); $Clicks = "567"; $Impressions

How to correctly fill in XFA form data using iTextSharp to allow editing and saving result in Acrobat XI

旧时模样 提交于 2019-12-20 07:44:37
问题 I have an application that I'm using the populate a pdf form using iTextSharp. /// <summary> /// Imports XFA Data into a new PDF file. /// </summary> /// <param name="pdfTemplate">A PDF File with an unpopulated form.</param> /// <param name="xmlFormData">XFA form data in XML format.</param> /// <returns>a memorystream containing the new PDF file.</returns> public static void XFAImport(System.IO.Stream pdfTemplate, System.IO.Stream xmlFormData, System.IO.Stream outputStream) { using

How to fill XFA form using iText?

强颜欢笑 提交于 2019-12-19 09:09:42
问题 Code: using (FileStream pdf = new FileStream("C:/test.pdf", FileMode.Open)) using (FileStream xml = new FileStream("C:/test.xml", FileMode.Open)) using (FileStream filledPdf = new FileStream("C:/test_f.pdf", FileMode.Create)) { PdfReader.unethicalreading = true; PdfReader pdfReader = new PdfReader(pdf); PdfStamper stamper = new PdfStamper(pdfReader, filledPdf); stamper.AcroFields.Xfa.FillXfaForm(xml); stamper.Close(); pdfReader.Close(); } This code throws no exception and everything seems to

How can I flatten a XFA PDF Form using iTextSharp?

谁都会走 提交于 2019-12-17 07:53:36
问题 I assume I need to flatten a XFA form in order to display properly on the UI of an application that uses Nuance's CSDK. When I process it now I get a generic message "Please Wait.... If this message is not eventually replaced..". Looking for some sample iTextSharp code to do this. 回答1: You didn't insert a code sample to show how you are currently flattening the XFA form. I assume your code looks like this: var reader = new PdfReader(existingFileStream); var stamper = new PdfStamper(reader,

Populate dynamic XFA pdf form itext

我们两清 提交于 2019-12-11 03:58:54
问题 I have a XFA based pdf form that we need to be populate using java. Can you suggest the best approach. I was able to generate the xfa xml for the pdf using iText. public void readXfa(String srcPdfFilename, String destXMLFilename) throws IOException, ParserConfigurationException, SAXException, TransformerFactoryConfigurationError, TransformerException { PdfReader reader = new PdfReader(srcPdfFilename); XfaForm xfa = new XfaForm(reader); Document doc = xfa.getDomDocument(); Transformer tf =