Free Support Forum - aspose.com

XML parsing error (incorrect token - error code 4) - When Acrobat Reader X/XI open form filled by pdf.kit

Hi,

I tried evaluate form fill design by Adobe LiveCycle Designer ES2 using below code.
It’s filling is ok and well open in FoxIt except Acrobat X/XI (also include Reader).

When I open form pdf file in Acrobat, It warning 3 times same error dialoge - "Xml parsing error (incorrect token/error code 4) 49 lines; I don’t know exactly english message, because I translated local to english - and than show correctly.

I guess that error cause by evaluation statement generated by Aspose.Pdf.Kit because that “evaulation only” message showed in Acrobat but didn’t show in Foxit.

Please support to resolve this problem.
Thanks

— test code —

package com.henc.aspose;

import com.aspose.pdf.kit.*;


/**
* Hello world!
*
*/
public class App
{
public static String inFile = “c://work//visa_application.pdf”;
public static String outFile = “c://work///visa_submit.pdf”;


public App() throws Exception {
fillForm();
}

public void fillForm() throws Exception {
Form form = new Form (inFile, outFile);
String[] fieldNames = form.getFieldsNames();

for (int fieldIdx = 0; fieldIdx <fieldNames.length; fieldIdx++) {
System.out.println(“field:” + fieldNames[fieldIdx]
+ “, type:” + form.getFieldType(fieldNames[fieldIdx]));
try {
if (fieldNames[fieldIdx].indexOf(“RadioButtonList”) > 0 ||
fieldNames[fieldIdx].indexOf(“AddSubformButton”) > 0) {

}
} catch (ClassCastException ex_cast) {
ex_cast.printStackTrace();
}
form.fillField (“form1[0].#subform[1].#field[58]”, "A " + fieldIdx);
}
form.close();

}

public static void main( String[] args ) throws Exception
{
new App();
}
}

Hi Jun,


Thanks for your inquiry. Could you please share your source document here? So we test it at our end and provide you more information accordingly.

Sorry for the inconvenience faced.

Best Regards,

Hi,

Please refer attahced source form and code.
Additionally, I’m looking for pdf.kit API for recognize radio and combo(list) box object.
I tried each correct value not only text field also several object, but not yet found adoptable APIs.

Thanks

Hi Jun,


Thanks for sharing the resource files.

I
have tested the scenario and I am able to notice the same problem. For the sake
of correction, I have logged this issue as
PDFKITJAVA-33315 in
our issue tracking system. We will further look into the details of this problem
and will keep you updated on the status of correction. Please be patient and
spare us little time.

We are sorry for this inconvenience.