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

Free Support Forum - aspose.com

Problem with Text Direction

Hi guys,


I have table html and I insert it into word document by DocumentBuilder.insertHtml() method.
In this table has few columns header display rotate. As I know Aspose has support text direction in table html by the way : Imported from "writing- mode " style attribute
But when I use : style=“writing-mode: vertical-lr” attribute to header which I want rotate, this header not rotate as my expect output

Please help me to get solution.

Thanks,
Hanh

Hi Hanh,


Thanks for your inquiry. You issue pertains to Aspose.Words, so I am moving your query to related forum. There one of my colleague from Aspose.Words will guide you appropriately.

Best Regards,

Hi Hanh,

Please share your input HTML and a screenshot to display the issue.

Best Regards,

Hi guys,


Following is my input HTML:
table class=‘table-dynamic table table-striped table-bordered resizable dataTable projectListTableCsm no-footer’>
Threat
Vulnerabilities
Recommendations
Impact
Probability
Risk
T1: Incidence response failure
L
H
H
T3: Employee Theft
L H
H
T4: Disaster impact on business processes
L
H
H

This attach file is my screenshot to display my issue.
As you see I want 3 final header columns display vertical so I’ve used style=‘writing-mode: vertical-lr’ attribute. But They still display horizontal.

Please help me to fix it soon.

Thanks,
Hanh

Hi Hanh,

We are investigating the issue and will update you soon.

Best Regards,

Hi Hanh,

Sorry for the delay. If you open this HTML in browser or MS Word, you will see the same output. You can use the following code to change the orientation of last three cells of the header row.

Document doc = new Document();

DocumentBuilder builder = new DocumentBuilder(doc);

builder.PageSetup.Orientation = Orientation.Landscape;

builder.InsertHtml(System.IO.File.ReadAllText("Input.html"),true);

<?xml:namespace prefix = "o" ns = "urn:schemas-microsoft-com:office:office" />

foreach (Table table in doc.GetChildNodes(NodeType.Table, true))

{

Row headerRow = table.FirstRow;

headerRow.RowFormat.Height = 100;

for (int i = headerRow.Cells.Count - 1; i > headerRow.Cells.Count - 4; i--)

{

headerRow.Cells[i].CellFormat.Orientation = TextOrientation.VerticalFarEast;

}

//foreach (Cell cell in table.FirstRow.Cells)

//{

// cell.CellFormat.Orientation = TextOrientation.VerticalFarEast;

//}

}

doc.Save("Out.docx");

Best Regards,

Hi Muhammad,

This topic is very useful to me.
But your code above direct the text from Top to Bottom, now I want to direct the text from Bottom to Top but it still does not work.
Please help,
Thanks!

Hi Huy,

You can set TextOrientation.Upward in the above mentioned code e.g.

headerRow.Cells[i].CellFormat.Orientation = TextOrientation.Upward;

Best Regards,


Thanks for you help, Muhammad.