We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Com.aspose.pdf.kit.lq cannot be cast to com.aspose.pdf.kit.my

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.

becker@neotalogic.com:
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
Hi Jeff,

Sorry for the delayed response.

Aspose.Pdf for Java is autoported from its sibling Aspose.Pdf for .NET. However we have ensured that all the classes which are present in legacy Aspose.Pdf.Kit for Java are ported to this new MergedAPI. Please note that there might a slight change in the names of some methods because this version is ported from Aspose.Pdf for .NET. Concerning to above issue related to getFieldsNames(…) method, the name of method has been updated to getFieldNames().

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??
I think you have downloaded Aspose.Total for Java and it includes Aspose.Pdf for Java 4.2.0. Please note that Aspose.Pdf for Java 4.2.1 is latest hotfix and you can separately download it.

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().
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.

In the event of any further query, please feel free to contact. We are sorry for this inconvenience.

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.