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

Free Support Forum - aspose.com

Wrong id in table after converted by Aspose

Hi

After we use Aspose to convert the input.html file into output.html, the id in the table is displayed wrong. The Aspose version we use is Words for Java.13.7.0. Files are attached, and the main code for generating is as blow:

Document template;
template = new Document();
DocumentBuilder builder = new DocumentBuilder(template);
String html = ReadAllText("filepath\\input.html");
builder.insertHtml(html);

HtmlSaveOptions htmlSaveOptions = new HtmlSaveOptions();
htmlSaveOptions.setExportXhtmlTransitional(true);
htmlSaveOptions.setSaveFormat(SaveFormat.HTML);
template.save("filepath\\output.html", htmlSaveOptions);

public String ReadAllText(String filename) throws IOException {
String s = "";
InputStreamReader isr = new InputStreamReader(new FileInputStream(filename));
BufferedReader br = new BufferedReader(isr);
StringBuilder html = new StringBuilder(10000);
while ((s = br.readLine()) != null)
html.append(s);
return html.toString(); }

Thanks for your answering

Hi Daniel,

Thanks for your inquiry. I have tested the scenario using latest version of Aspose.Words for Java 14.9.0 and have not found the shared issue. Please use Aspose.Words for Java 14.9.0. I have attached the output html with this post for your kind reference.

Thanks. By any chance we can have a hot-fix for this issue on top of 13.7.0? It will take us a long time to upgrade while our customer is pushing for a fix of this.

Hi Daniel,

Thanks for your inquiry. We
don’t provide support for older released versions of Aspose.Words.
Please note that we do not provide any fixes or patches for old versions
of Aspose products either. All fixes and new features are always added
into new versions of our products.

Please let us know if you have any more queries.

Hi

After we update Aspose to 14.10.0, the problem for output html file is solved, but new problem occurs for output DOC and DOCX, the main code is as blow
Document template;
template = new Document();
DocumentBuilder builder = new DocumentBuilder(template);
String html = ReadAllText(“C:\Users\ywang32\Desktop\input.html”);
Charset.forName(“UTF-8”));
builder.insertHtml(html);


DocSaveOptions docSaveOptions=new DocSaveOptions();
docSaveOptions.setSaveFormat(SaveFormat.DOC);;
template.save(“C:\Users\ywang32\Desktop\output.doc”, htmlSaveOptions);

The id dispears in the created doc file, the input and output files are attched. Please give us a hand for this ASAP

Hi Daniel,

Thanks for your inquiry. I have tested the scenario using latest version of Aspose.Words for Java 14.11.0 and have not found the shared issue. Please use Aspose.Words for Java 14.11.0.

Moreover, please note that Aspose.Words mimics the same behavior as MS Word does. If you convert your html document to Doc/Docx using MS Word, you will get the same output.

Please let us know if you have any more queries.