I'm using latest docx4j (3.3.7) and generate table, which contains one cell with text rotated by 90 degrees. docx
output is correct, but when exported to pdf
, text in this cell isn't rotated, just regular left-to-right direction.
Same behaviour is with Plutext's commercial PDF Converter (enabled by default) and with docx4j-export-fo
.
How can I force text in table cell to rotate?
Code I use to rotate text in tableCell (work fine in docx
, ignored during pdf
export):
TcPr tableCellProperties = tableCell.getTcPr();
if (tableCellProperties == null) {
tableCellProperties = new TcPr();
tableCell.setTcPr(tableCellProperties);
}
TextDirection td = new TextDirection();
td.setVal("tbRl");
tableCellProperties.setTextDirection(td);
I also tried this, with same effect:
TextDirection td = new TextDirection();
td.setVal("tbRl");
paragraph.setPPr(new PPr());
paragraph.getPPr().setTextDirection(td);
I'm exporting to PDF using method:
Docx4J.toPDF(wordprocessingMLPackage, fileOutputStream);