Vertical Text in HTML Not Translated To Word Table

When an HTML source file contains a table which has text formatted to be rotated vertically, the format is ignored when the HTML is inserted via DocumentBuilder.

To reproduce this behavior:

  1. Copy the attached HTML source file “VerticalText.html” to the file system…
  2. Use the sample code below to generate a new Word document which inserts the given HTML via the DocumentBuilder.insertHtml API.
  3. Examine the generated document and notice that the cell with vertical text has horizontal alignment.

Notes:

  • If you preview the HTML in any major browser, you can see it will show a text heading to be vertically formatted
  • It’s clear that Aspose Words supports vertical text in cells via the TextOrientation class, but for some reason, this is not applied when the insertHtml API is used.
  • The sample code was tested on the latest Aspose Words version 17.7.

Sample Code:

 public static void verticalTextHtml() {
    // add full path as necessary
    final String htmlSrc = "VerticalText.html";
    try {

       // create new blank document
       Document wdDoc = new Document();
       DocumentBuilder builder = new DocumentBuilder(wdDoc);

       // load the html
       final String html = new String(Files.readAllBytes(Paths.get(htmlSrc)));

       // add the paragraph to the document
       Paragraph para = builder.insertParagraph();
       builder.moveTo(para);
       // insert the HTML into the doc - keep HTML formatting intact
       builder.insertHtml(html, false);

       wdDoc.save(htmlSrc.replace(".html", ".docx"));
       System.out.println("Saved Document: " + htmlSrc.replace(".html", ".docx"));

    } catch (Exception ex) {
       ex.printStackTrace();
    }
 }

Attachment:
VerticalText.zip (3.2 KB)

Thanks.

@oraspose

Thanks for your inquiry. We have tested the scenario and noticed the reported issue. So we have logged a ticket WORDSNET-15759 in our issue tracking system for further investigation and rectification. We will notify you as soon as it is resolved.

We are sorry for the inconvenience.

Any update on this issue?

@oraspose,

This problem (WORDSNET-15759) actually requires us to implement a new feature in Aspose.Words API and we regret to share with you that the implementation of this issue has been postponed till a later date. However, the fix of this problem may definitely come onto the product roadmap in the future. Unfortunately, we cannot currently promise a resolution date (ETA). We apologize for your inconvenience.

We are actively looking into upgrade of Aspose Words product and wondering if there are any updates on this problem? Are there any plans to include it in the upcoming release?
Thank you.

@oraspose Unfortunately, there are no news regarding this issue yet. The issue is still postponed and is not yet scheduled for development. it is linked to the main feature request WORDSNET-10399 - Add support of MSO attributes during HTML import.