#HOW TO INSERT SIGNATURE IN PDF XFA FORM PDF#
The process of flattening an XFA form to an ordinary PDF requires that you parse the XML and convert the XML syntax into PDF syntax. The actual content of the document is stored as an XML file. Where src, dest and xml are String paths to your documents.Ī dynamic XFA form usually consists of a single page PDF (the one with the "Please wait." message) that is shown in viewers that do not understand XFA.
![how to insert signature in pdf xfa form how to insert signature in pdf xfa form](https://4.bp.blogspot.com/-2c82Qd88xDg/VvWHxe1lbbI/AAAAAAAAAd0/bUh1pEpjxtoEDLbteS66t-rjj6yJ3QhfQ/s1600/Master-PDF-Editor-Running-in-Ubuntu.png)
Load dynamic XFA form Document document new. Aspose.PDF has a feature that allows developers to convert XFA forms to standard AcroForms. XFAFlattener.flatten(new FileInputStream("input.pdf"),new FileOutputStream(getDestFile())) It’s not possible to extract or manipulate pages of XFA Forms, because the form content is generated at runtime (during XFA form viewing) within the application trying to display or render the XFA form. XFAFlattener xFAFlattener = new XFAFlattener() Xfa.fillXfaForm(new FileInputStream(xml)) Don’t worry if you cannot that just means you do not have any XFA forms in that PDF Document. PdfAcroForm form = PdfAcroForm.getAcroForm(pdfdoc, true) As with the AcroForms format you will find a tag called ‘AcroForms’ within this tag there are others, one of which we found last time as ‘Fields’ which define the AcroForms, also within the AcroForms tag you may be able to find an ‘XFA’ tag. For forms based on the XML Forms Architecture (XFA) you should use the following snippet: PdfDocument pdfdoc = new PdfDocument(new PdfReader(src), new PdfWriter(dest)) This code will work when trying to flatten forms based on AcroForm technology.
![how to insert signature in pdf xfa form how to insert signature in pdf xfa form](http://blog.idrsolutions.com/wp-content/uploads/2014/03/xfa-220x300.png)
PdfAcroForm form = PdfAcroForm.getAcroForm(pdfDoc, true) I assume your code looks like this: PdfDocument pdfDoc = new PdfDocument(new PdfReader(src), new PdfWriter(dest)) You didn't insert a code sample to show how you are currently flattening the XFA form.