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

Free Support Forum - aspose.com

Storing doc as html messes up image

Hello

I’m trying to store the attached word file as html. Aspose somehow cuts off two of the three circles and does not convert the text.
Storing as PDF works fine.

Hi

Thanks for your request. But unfortunately, I cannot reproduce the problem on my side. I use the latest version of Aspose.Words for testing. You can download it from here:

http://www.aspose.com/community/files/72/java-components/aspose.words-for-java/category1378.aspx

I also attached the output HTML produced on my side.

In addition, you can try installing JAI on your side. This might help to resolve the problem.

Best regards,

I just updated to version 10.4.0 we have JAI installed, but the problem remains. I found a stacktrace which may help:

java.lang.NullPointerException
at asposewobfuscated.hh.a(GdiRenderer.java:176)
at asposewobfuscated.s.a(ApsGlyphs.java:48)
at asposewobfuscated.p.a(ApsCompositeNode.java:22)
at asposewobfuscated.u.a(ApsGroup.java:17)
at asposewobfuscated.p.a(ApsCompositeNode.java:22)
at asposewobfuscated.m.a(ApsCanvas.java:18)
at asposewobfuscated.p.a(ApsCompositeNode.java:22)
at asposewobfuscated.m.a(ApsCanvas.java:18)
at asposewobfuscated.p.a(ApsCompositeNode.java:22)
at asposewobfuscated.m.a(ApsCanvas.java:18)
at asposewobfuscated.p.a(ApsCompositeNode.java:22)
at asposewobfuscated.u.a(ApsGroup.java:17)
at asposewobfuscated.p.a(ApsCompositeNode.java:22)
at asposewobfuscated.m.a(ApsCanvas.java:18)
at asposewobfuscated.p.a(ApsCompositeNode.java:22)
at asposewobfuscated.m.a(ApsCanvas.java:18)
at asposewobfuscated.hh.a(GdiRenderer.java:49)
at com.aspose.words.ux.a(ImageTransform.java:119)
at com.aspose.words.uw.b(ImageResourceWriter.java:535)
at com.aspose.words.uw.a(ImageResourceWriter.java:105)
at com.aspose.words.sl.b(HtmlWriter.java:1195)
at com.aspose.words.sl.a(HtmlWriter.java:1133)
at com.aspose.words.sl.visitGroupShapeStart(HtmlWriter.java:1094)
at com.aspose.words.GroupShape.a(GroupShape.java:54)
at com.aspose.words.CompositeNode.acceptCore(CompositeNode.java:631)
at com.aspose.words.GroupShape.accept(GroupShape.java:49)
at com.aspose.words.CompositeNode.acceptChildren(CompositeNode.java:667)
at com.aspose.words.CompositeNode.acceptCore(CompositeNode.java:638)
at com.aspose.words.Paragraph.accept(Paragraph.java:301)
at com.aspose.words.CompositeNode.acceptChildren(CompositeNode.java:667)
at com.aspose.words.CompositeNode.acceptCore(CompositeNode.java:638)
at com.aspose.words.Body.accept(Body.java:57)
at com.aspose.words.sl.a(HtmlWriter.java:443)
at com.aspose.words.sl.a(HtmlWriter.java:390)
at com.aspose.words.sl.b(HtmlWriter.java:361)
at com.aspose.words.sl.writeBody(HtmlWriter.java:261)
at com.aspose.words.sl.NC(HtmlWriter.java:110)
at com.aspose.words.sl.a(HtmlWriter.java:61)
at com.aspose.words.sl.a(HtmlWriter.java:36)
at com.aspose.words.Document.a(Document.java:1345)
at com.aspose.words.Document.save(Document.java:738)
at com.aspose.words.Document.save(Document.java:710)


I’m using the following code:

Document doc = new Document(stream);
doc.save(outputFile.toString(), SaveFormat.HTML);

Hello

Thank you for additional information. I also have tried one more time with your document, but still cannot reproduce the problem on my side. Please make sure that you are using the latest version of Aspose.Words.


I use the following code for testing:

Document doc = new Document("C:\\Temp\\ImageExample.doc");

doc.save("C:\\Temp\\out.html", SaveFormat.HTML);


Best regards,

Just to make sure, this is what I get as output (see attachment).
One circle instead of three, without text.

This is what my MANIFEST says.
Implementation-Version: 10.4.0.0
Implementation-Vendor: Aspose Pty Ltd
Release-Date: 2011.08.30

I’m in an OSGI environment. To make sure that this does not interfere I made a separated test, with a simple main() method, placing the JAI jars into the project. Same result…

Are you testing with a “trunk” version of the current development? If so, maybe there is a snapshot I could test with?

Hello

Thanks for your request. I use the latest version of Aspose.Words 10.4.0. And my output HTML contains the following tag:

<meta name="generator" content="Aspose.Words for Java 10.4.0.0" />

Your HTML contains this tag:

<meta name="generator" content="SCODi4P (www.scodi.ch)" />

Could you please try using the following code without any post-processing?

Document doc = new Document("C:\\Temp\\ImageExample.doc");

doc.save("C:\\Temp\\out.html", SaveFormat.HTML);

Best regards,

I’m getting the same output. Scodi in that case only manipulates the html afterwards. The problem is the image.

We tested now on three different machines (JRE 1.6 and 1.7). Always with the same result. Is there some hint in the stacktrace?

We are using JAI 1.1.3.

Hi

Thank you for additional information. I got the same exception as you mentioned when try converting your document to HTML in Linux environment. I will consult with our lead Java developer regarding this matter and let you know once I get some feedback from him.

Best regards,

Hi

I consulted with our lead Java developer. I logged this issue in our defect database. We will let you know once it is resolved.

The problem occurs only with Java 1.6 and newer. It will be fixed in the next version of Aspose.Words. As a workaround, you can try using Java 1.5.

Best regards,

Ok, I am relieved that you can reproduce the bug and that you will fix it.

I hope that you can fix ist realy soon.

Please keep in mind that we have priority support!
Thank you.

Hi

The fix will be included into the next version of Aspose.Words that comes out at the end of September.

Best regards,

The issues you have found earlier (filed as WORDSJAVA-423) have been fixed in this .NET update and in this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.