For the attached pdf file:
pdfForm = new Form(pdfFile);
pdfForm.getFieldFacade(“AgentFax”);
causes this error:
com.aspose.pdf.kit.lq cannot be cast to com.aspose.pdf.kit.my
in com.aspose.pdf.kit.Form.getFieldFacade(Unknown Source)
In case it makes a difference, the actual code is looping through the field names, and “AgentFax” is the second field name found:
pdfForm = new Form(pdfFile);
String[] fnames = pdfForm.getFieldsNames();
for(int i=0; i<fnames.length; i++) {
String fname = fnames[i];
fieldInfo.put(fname, pdfForm.getFieldFacade(fname));
}
where fieldInfo is a HashMap
What’s going on? Is there a workaround?
Hi Jeff,
Thanks for contacting support.
I
have tested the scenario using Aspose.Pdf for Java 4.2.1 and I am able to reproduce the same problem. For the
sake of correction, I have logged it in our issue tracking system as PDFNEWJAVA-33759. We
will investigate this issue in details and will keep you updated on the status
of a correction. We
apologize for your inconvenience.
Please note that since April-2013, Aspose.Pdf.Kit for Java has been merged into Aspose.Pdf for Java and all its classes are present under com.aspose.pdf.facades namespace. The separate release of Aspose.Pdf.Kit for Java will be discontinued by the end of this year. For further details, please visit Migration from Aspose.Pdf.Kit for Java
Using aspose-pdf-4.2.0.jar instead of aspose-pdf-kit.4.7.0.jar, following the migration instructions I get a compile error:
[javac] C:\dev\Author\src\com\neota\logic\text\PDFFormEditor.java:415: error
: cannot find symbol
[javac] String[] fnames = pdfForm.getFieldsNames();
[javac] ^
[javac] symbol: method getFieldsNames()
[javac] location: variable pdfForm of type Form
It seems that the PDF Kit classes under pdf.facades are incomplete. I am going back to PDF Kit (evaluation version) for now
I am hearing that PDF Kit is no longer for sale, so it would be good to know what the problem is with this. You mentioned aspose-pdf-4.2.1 in your previous message, but when I download the eval version I get 4.2.0. Maybe this is fixed in 4.2.1??
PDF documentation doesn’t seem to cover PDF Kit classes (particularly
Form, but others as well), so no way for me to check on a changed method
name for Form.getFieldsNames().
Holding off on purchase until this is resolved.
Using aspose-pdf-4.2.0.jar instead of aspose-pdf-kit.4.7.0.jar, following the migration instructions I get a compile error:
[javac] C:\dev\Author\src\com\neota\logic\text\PDFFormEditor.java:415: error
: cannot find symbol
[javac] String[] fnames = pdfForm.getFieldsNames();
[javac] ^
[javac] symbol: method getFieldsNames()
[javac] location: variable pdfForm of type Form
It seems that the PDF Kit classes under pdf.facades are incomplete. I am going back to PDF Kit (evaluation version) for now
I am hearing that PDF Kit is no longer for sale, so it would be good to know what the problem is with this. You mentioned aspose-pdf-4.2.1 in your previous message, but when I download the eval version I get 4.2.0. Maybe this is fixed in 4.2.1??
You can use your existing Aspose.Pdf.Kit for Java code with new MergedAPI release of Aspose.Pdf for Java and the only change which you need to make is to update class names from com.aspose.pdf.kit to com.aspose.pdf.facades.PDF documentation doesn’t seem to cover PDF Kit classes (particularly
Form, but others as well), so no way for me to check on a changed method
name for Form.getFieldsNames().
The issues you have found earlier (filed as PDFNEWJAVA-33759) have been fixed in Aspose.Pdf for Java 10.6.0 .
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.