Hi
I am trying to use importXml API of the aspose PDF for Java, to fill up a fillable PDF. I see that the PDF that gets rendered is read only. I need the ability to retain the fillable form so that users can edit the data. I use the version 25.3. Can you please let me know how to fix this issue?
thanks
Would you please share your sample PDF and other source files for our reference along with the sample code snippet? We will test the scenario in our environment and address it accordingly.
Thank you very much for the response. I have attached the files and the code to the email reply, I sent.
Thanks
Can you please share the email address to which you sent the files? Can you please attach the files here in the thread using upload button in the post editor while you are replying?
Thanks for the response, I uploaded the pdfs, but could not upload the xml. So added the xml contents to the letter body.
I have also included the code I used to create output pdf.
Thanks
fw9.pdf (137.5 KB)
Template_output_new.pdf (143.4 KB)
<?xml version="1.0" encoding="utf-8"?>
<xfa:data xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">
<topmostSubform>
<Page1>
<Pg1Header />
<f1_01>First Last</f1_01>
<f1_02>Business</f1_02>
<Boxes3a-b_ReadOrder>
<c1_1>0</c1_1>
<c1_1>0</c1_1>
<c1_1>0</c1_1>
<c1_1>0</c1_1>
<c1_1>0</c1_1>
<c1_1>0</c1_1>
<f1_03 />
<c1_1>1</c1_1>
<f1_04>Test other</f1_04>
<c1_2>1</c1_2>
</Boxes3a-b_ReadOrder>
<f1_05 />
<f1_06 />
<Address_ReadOrder>
<f1_07>12 34th Street, Apt 56</f1_07>
<f1_08>City1, MA 02111</f1_08>
</Address_ReadOrder>
<f1_09>RequesterName</f1_09>
<f1_10>566656656, 5655546546</f1_10>
<Part1 />
<EnterTIN-Note_ReadOrder />
<f1_11>111</f1_11>
<f1_12>23</f1_12>
<f1_13>4567</f1_13>
<f1_14>45</f1_14>
<f1_15>4580935</f1_15>
<Part2 />
<NumberedList>
<Number1 />
<Number2 />
<Number3 />
<Number4 />
</NumberedList>
<Col1 />
<Col1 />
<Col1 />
<Col2>
<BulletedList />
</Col2>
<Col2>
<BulletedList />
</Col2>
<Col2>
<BulletedList />
</Col2>
</Page1>
<Page2>
<Pg2Header />
<Col1>
<BulletedList1>
<Bullet1 />
<Bullet2 />
<Bullet3 />
<Bullet4 />
<Bullet5 />
<Bullet6 />
<Bullet7 />
<Bullet8 />
<Bullet9 />
<Bullet10 />
</BulletedList1>
<NumberedList1>
<Number1 />
<Number2 />
<Number3 />
<Number4 />
<Number5 />
</NumberedList1>
<BulletedList2>
<Bullet1 />
<Bullet2 />
<Bullet3 />
<Bullet4 />
</BulletedList2>
<BulletedList3>
<Bullet1 />
<Bullet2 />
<Bullet3 />
</BulletedList3>
</Col1>
<Col2>
<NumberedList2>
<Number1 />
<Number2 />
<Number3 />
<Number4 />
<Number5 />
</NumberedList2>
<NumberedList3>
<Number1 />
<Number2 />
<Number3 />
<Number4 />
<Number5 />
</NumberedList3>
</Col2>
</Page2>
<Page3>
<Pg3Header />
<Col1>
<BulletedList1>
<Bullet1 />
<Bullet2 />
<Bullet3 />
<Bullet4 />
<Bullet5 />
</BulletedList1>
</Col1>
<Col1>
<BulletedList1>
<Bullet1 />
<Bullet2 />
<Bullet3 />
<Bullet4 />
<Bullet5 />
</BulletedList1>
</Col1>
<Col1>
<BulletedList1>
<Bullet1 />
<Bullet2 />
<Bullet3 />
<Bullet4 />
<Bullet5 />
</BulletedList1>
</Col1>
<Col2>
<Table>
<Header />
<BodyRow1 />
<BodyRow2 />
<BodyRow3 />
<BodyRow4 />
<BodyRow5 />
</Table>
<BulletedList2>
<Bullet1 />
<Bullet2 />
<Bullet3 />
<Bullet4 />
</BulletedList2>
</Col2>
<Col2>
<Table>
<Header />
<BodyRow1 />
<BodyRow2 />
<BodyRow3 />
<BodyRow4 />
<BodyRow5 />
</Table>
<BulletedList2>
<Bullet1 />
<Bullet2 />
<Bullet3 />
<Bullet4 />
</BulletedList2>
</Col2>
<Col2>
<Table>
<Header />
<BodyRow1 />
<BodyRow2 />
<BodyRow3 />
<BodyRow4 />
<BodyRow5 />
</Table>
<BulletedList2>
<Bullet1 />
<Bullet2 />
<Bullet3 />
<Bullet4 />
</BulletedList2>
</Col2>
</Page3>
<Page4>
<Pg4Header />
<Col1>
<Table>
<Header />
<BodyRow1 />
<BodyRow2 />
<BodyRow3 />
<BodyRow4 />
<BodyRow5 />
</Table>
</Col1>
<Col2 />
</Page4>
<Page5>
<Pg5Header />
<Col1>
<NumberedList>
<Number1 />
<Number2 />
<Number3 />
<Number4 />
<Number5 />
</NumberedList>
<Table_SSN>
<Header />
<Row1 />
<Row2 />
<Row3 />
<Row4 />
<Row5a />
<Row5b />
<Row6 />
<Row7 />
</Table_SSN>
</Col1>
<Col1>
<NumberedList>
<Number1 />
<Number2 />
<Number3 />
<Number4 />
<Number5 />
</NumberedList>
<Table_SSN>
<Header />
<Row1 />
<Row2 />
<Row3 />
<Row4 />
<Row5a />
<Row5b />
<Row6 />
<Row7 />
</Table_SSN>
</Col1>
<Col1>
<NumberedList>
<Number1 />
<Number2 />
<Number3 />
<Number4 />
<Number5 />
</NumberedList>
<Table_SSN>
<Header />
<Row1 />
<Row2 />
<Row3 />
<Row4 />
<Row5a />
<Row5b />
<Row6 />
<Row7 />
</Table_SSN>
</Col1>
<Col2>
<Table_EIN>
<Header />
<Row1 />
<Row2 />
<Row3 />
<Row4 />
<Row5 />
<Row6 />
<Row7 />
<Row8 />
</Table_EIN>
<BulletedList>
<Bullet1 />
<Bullet2 />
<Bullet3 />
</BulletedList>
</Col2>
<Col2>
<Table_EIN>
<Header />
<Row1 />
<Row2 />
<Row3 />
<Row4 />
<Row5 />
<Row6 />
<Row7 />
<Row8 />
</Table_EIN>
<BulletedList>
<Bullet1 />
<Bullet2 />
<Bullet3 />
</BulletedList>
</Col2>
<Col2>
<Table_EIN>
<Header />
<Row1 />
<Row2 />
<Row3 />
<Row4 />
<Row5 />
<Row6 />
<Row7 />
<Row8 />
</Table_EIN>
<BulletedList>
<Bullet1 />
<Bullet2 />
<Bullet3 />
</BulletedList>
</Col2>
</Page5>
<Page6>
<Pg6Header />
<Col1 />
<Col2 />
</Page6>
</topmostSubform>
</xfa:data>
@Test
public void testGenerateFilledXfaFormUsingAspose() {
try {
initializeLicense();
com.aspose.pdf.facades.Form form = new com.aspose.pdf.facades.Form();
form.bindPdf("fw9.pdf");
// Open XML file.
java.io.FileInputStream xmlInputStream = new FileInputStream("fwp-new.xml");
// Import XML data
form.importXml(xmlInputStream);
// close file stream
xmlInputStream.close();
// Save updated PDF
form.save("Template_output_new.pdf");
// dispose the form object
form.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public void initializeLicense() {
try {
final InputStream licenseFileStream = new FileInputStream("C:\\webapps\\DCF\\license\\Aspose\\Aspose.PDFforJava.lic");
final License license = new License();
license.setLicense(licenseFileStream);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
fwp-new.zip (999 Bytes)
I added the xml file to the zip and could upload it. Please use the xml file in the zip.
Thanks
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): PDFJAVA-45026
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
Thank you very much for raising the issue. Can you please let me know how long it takes to get this issue resolved, without the paid support?
We are in the process of evaluating Aspose PDF libraries for our Pdf manipulation needs.
The issue resolution will help us in the evaluation.
Thanks
We do understand your concerns and will consider them during the investigation. The issues in free support model are resolved and investigated on a first come first serve basis and resolution of them depends upon the number of issues logged prior. Nevertheless, we will let you know once we have some updates regarding ticket fix. Please be patient and spare us some time.
We are sorry for the inconvenience.