Hi Team,
I’m planning to use Text Orientation in a table cell. I didn’t get much help from the documentation - API Reference|Aspose.Words for .NET
I wrote a sample code with various text orientation. Could you help on the following?
- The font looks different for Horizontal, Upwards, Downward orientation. If I create a MS Word document manually, the font looks cleaner. Is there any setting to see text stable across different text orientation?
- How to set auto height of the row? I tried with RowFormat.setHeightRule(), but it didn’t help. I don’t want to set height to X pt. I’m looking for some auto option here.
- The PDF table goes out of the page.
Thanks,
Kumar
private static void writeTableWithTextOrientation(DocumentBuilder docBuilder) throws Exception
{
Table table = docBuilder.startTable();
docBuilder.insertCell();
docBuilder.getCellFormat().setOrientation(com.aspose.words.TextOrientation.DOWNWARD);
docBuilder.write(“Downward text”);
docBuilder.insertCell();
docBuilder.getCellFormat().setOrientation(com.aspose.words.TextOrientation.UPWARD);
docBuilder.write(“Upward text”);
docBuilder.insertCell();
docBuilder.getCellFormat().setOrientation(com.aspose.words.TextOrientation.HORIZONTAL_ROTATED_FAR_EAST);
docBuilder.write(“HORIZONTAL_ROTATED_FAR_EAST”);
docBuilder.insertCell();
docBuilder.getCellFormat().setOrientation(com.aspose.words.TextOrientation.VERTICAL_FAR_EAST);
docBuilder.write(“VERTICAL_FAR_EAST”);
docBuilder.insertCell();
docBuilder.getCellFormat().setOrientation(com.aspose.words.TextOrientation.HORIZONTAL);
docBuilder.write(“HORIZONTAL text”);
Row row = docBuilder.endRow();
// row.getRowFormat().setHeightRule(HeightRule.AUTO);
docBuilder.endTable();
table.setPreferredWidth(PreferredWidth.AUTO);
table.setAllowAutoFit(true);
}