5/28/2023 0 Comments Font orientation in wordThese calls take BigIntegers that are representative of 1/20 Point. This means in addition to your setOrient call, you'll need to both setW and setH. Your CTPageSz object doesn't have that yet. Setting the orientation to landscape describes the general orientation of the paper, but will still need the size of the paper. It's setLandscape() method of .usermodel.PrintSetup interface. But I want to create documents programmatically from scratch in needed orientation.įor instance POI HSSF and XSSF have functionality to toggle between landscape and portrait mode. What could be the problem?Īs a workaround, I'm forced to start work with a blank document created manually in landscape or portrait format. But if I open the saved document I've portrait format. I can set the page orientation to landscape, and when I read the page orientation in the code, I get landscape. tOrient(STPageOrientation.LANDSCAPE) īut this method doesn't work properly. But I didn't find in the documentation how to change the page orientation.Īpparently this way should make it: XWPFDocument doc = new XWPFDocument() ĬTDocument1 document = doc.getDocument() I use Apache POI XWPF to create and handle MS Word documents.
0 Comments
Leave a Reply. |