I am wondering if there is a way to convert the word document to HTML and go through the HTML node. I notice that I have to call doc.Save() to do some conversion. Does that mean it is storing the file into the hard drive? K thanks and do let me know.
This Topic is created by imran.rafique using the Email to Topic plugin.
I am trying to call this via ColdFusion and am having some difficulty. I can do the above, but when I try to take it from html and convert it back to doc or rtf, I get errors.
The error I get is:
Object Instantiation Exception.
An exception occurred when instantiating a Java object. The class must not be an interface or an abstract class. Error: ‘’.
Hi Alexey,
Just gave that a try and it still gave me the same error:
Object Instantiation Exception.
An exception occurred when instantiating a Java object. The class must not be an interface or an abstract class. Error: ‘’.
Hi again Alexey,
Just wanted to check back in and see how this issue was progressing. My manager’s looking for a demonstration soon so we can show the proof-of-concept and this is the last step for me
Thanks
Thanks for your inquiry. Unfortunately, the issue is still unresolved. But we have released new version of Aspose.Words for Java, so you can try it. You can download it from here:
I switched back to the .Net dll and it is (sort of) working with that. It opens the original rtf document as an HTML file, I make a change then try to save it back. However, the .doc (and .rtf) files are blank. They are 10 and 7K files, and when I view them in notepad there is a binary data in them, just nothing is displayed in MS Word.
OK, sorry for the multiple posts. I played around a little with it on my own and found a new issue.
If I set up the class instantiation like this:
Then it works (according to the docs, the namespace should be class=“Aspose.Words.Document”, but when I do that I get
500
ROOT CAUSE:
java.lang.ClassFormatError: Illegal method name “?” in class Aspose/Words/Document
I guess I should use the com.aspose.words namespace to prevent the above issue?
I didn’t know if this was the reason that the save didn’t work, but apparently it’s not
as the class won’t instantiate using that namespace.
I had not removed the Java class from my classes directory in ColdFusion, so when I was referencing com.aspose.words.Document, it was still using the Java object. I was not calling “init”, so thus the reason for the blank document. I guess it does create the file though, so it’s definitely an issue with how the jar converts an html document to another format.
Once I switched to the DLL and restarted coldfusion, I changed the class to class=“Aspose.Words.Document” and now I get the 500 error that I mentioned previously.
“Illegal method name “?” in class Aspose/Words/Document”
So still an issue, but perhaps something you guys can assist me with?
Thank you for additional information. Most likely this is the same problem with obfuscation of the library. I suppose all commercial libraries are also obfuscated and maybe the problem should be actually fixed in ColdFusion. Because both .NET and Java version works without any issues in other environments. The problem occurs only in ColdFusion.
That may be it. It just seems strange that the obfuscation is causing these errors to occur when other commercial libraries I’ve used seem to work fine in ColdFusion (and ColdFusion is built on top of Java, so that’s usually the fall back to get something working in ColdFusion). Also, the initial conversion to HTML using the Aspose.Words Java library works, just not from HTML back to doc/rtf/etc, so it can’t be completely related to the obfuscation.
If you guys do get it working in ColdFusion, please let me know as I’m still looking to demo this to my manager (as it is halfway there with the conversion of rtf to HTML).
Thank you for additional information. I am sure the problem occurs because obfuscation. I tried with unobfuscated version of Aspose.Words and all works fine with it.
Anyway, I think, ColdFusion should work with obfuscated libraries, since these libraries work without any issues is other environments.