![]() Step 2: click the text box or shape > click Format on the ribbon bar > click Text Direction Type the text into the text box or shape. Insert a text box or draw a shape at cursor position where you want to change text direction. & click Insert> Shapes and choose a style from the drop down menu. Step 1: click Insert in the Ribbon bar > Text Box and choose a style from the drop-down menu. We can use text box or shape to change the direction of text. You still want to keep the setOrient call as well if you want it to behave properly when going to print.As we know, Text Box and Shapes have the function to change the direction of the text. tH(BigInteger.valueOf(12240)) įor Word to recognize it as Landscaped, the width must be greater than the height. For a landscaped LETTER type paper therefore, you'll just: tW(BigInteger.valueOf(15840)) These 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. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |