Hello,
For a client I’m still used the JDK 1.4 to generate document with Aspose Words.
With the latest library and since the “Aspose.Words.Java.10.7.0” Version I can’t anymore generate document image format: TIFF, BMP.
Because this following error occurs:
Exception in thread "main"
java.lang.NoSuchMethodError: java.awt.Font.canDisplay(I) Z
at asposewobfuscated.δH5.δZ(Unknown Source)
at asposewobfuscated.δH1.δZ(Unknown Source)
When I Called:
com.aspose.words.Document doc = new Document("C:\\document.docx");
doc.save("C:\\out.tiff", SaveFormat.TIFF); // or SaveFormat.BMP
It 's seems like you used the following Java method "java.awt.Font.canDisplay(int)"
But it ** canÆ t be used in JDK 1.4 because itÆ s only available in the 1.5. **
http://docs.oracle.com/javase/1.5.0/docs/api/java/awt/Font.html#canDisplay(int)
public boolean canDisplay(int codePoint)
Checks if this Font has a glyph for the specified character.
Parameters:
codePoint - the character (Unicode code point) for which a glyph is needed.
Returns:
true if this Font has a glyph for the character; false otherwise.
Throws:
IllegalArgumentException
- if the code point is not a valid Unicode code point.
Since:
1.5
See Also:
Character.isValidCodePoint(int)
Could you solve this issue ? I think in the previous version „Aspose.Words.Java.10.7.0" you used this other method:
public boolean canDisplay(char c)
Checks if this Font has a glyph for the specified character.
Note: This method cannot handle supplementary characters
. To support all Unicode characters, including supplementary characters, use the canDisplay(int)
method or canDisplayUpTo methods.
Parameters:
c - the character for which a glyph is needed
Returns:
true if this Font has a glyph for this character; false otherwise.
Since:
1.2
Could you
help me please to solve this issue ?
Thanks
and regards,
Mathieu
Hi Mathieu,
Thanks for your inquiry. Please attach your ‘input Word document’ and ‘code to reproduce the issue’ here for testing. I will investigate the issue on my side and provide you more information.
Best regards,
Hi,
Thanks a lot for you reply.
You will find in attachment a simple Word document and here is my test code in Java 1.4.2 :
package test;
import com.aspose.words.SaveFormat;
import java.io.File;
import java.io.FileInputStream;
public class testAspose
{
public static void main(String args[]) throws Exception
{
File fileDoc = new File("C:\\document.docx");
FileInputStream fisDoc = new FileInputStream(fileDoc);
com.aspose.words.Document document = new com.aspose.words.Document(fisDoc);
document.save("C:\\document.tiff", SaveFormat.TIFF);
}
}
Best regards,
Mathieu
Hi Mathieu,
Thanks for the additional information.
After an initial test with Aspose.Words for Java 13.6.0, I was unable to reproduce this issue on my side. Please tell us the details of the development environment e.g. OS (Windows Version or Linux Version) and it’s architecture (32/64 bit) of the machine you’re getting this exception on during rendering DOCX to image formats.
Thank you for your cooperation.
Best regards,
Hi,
Thanks for your help. Here is my configuration:
Windows 7 64 bits
Aspose Words library 1.4
Only JDK 1.4 is installed on this machine and the source code has only version JDK 4.
IDE for my test ist Netbeans 7.3 .1
Best regards,
Mathieu
Hi Mathieu,
Thanks for the additional information. I tested the scenario under JDK1.4.2 and have managed to reproduce the same problem on my side. For the sake of correction, I have logged this problem in our issue tracking system as WORDSJAVA-748. Our development team will further look into the details of this problem and we will keep you updated on the status of correction. We apologize for your inconvenience.
Best regards,
Hi Mathieu,
Thanks for being patient. I’m very sorry to share with you that on further investigation our development team came to know that they won’t be able to implement the fix to your issue. Your issue is now closed with '‘Not a Bug’ resolution. This is because we are going to discontinue jdk1.4 version in near future and won’t fix jdk1.4 specific issues any more. In the future, Aspose.Words for Java will fully support JDK 5, 6, 7 and their OpenJDK versions only. Therefore, we would suggest you please upgrade your JDK to Oracle JDK7 as this is the best option at the moment. If we can help you with anything else, please feel free to ask.
Best regards,