Apache POI. How do I set the page layout / paper size for a Word document? -


I am trying to create a Word document with scratch using Apache POI package. Outputing a simple formatted text does not prove a problem, but I would like to change the page size.

How do I set up page layouts / paper sizes for Word document?

Can someone tell me useful examples for using POI to create Word documents?

For example if you want to set the A4 format, you can use this code Are:

  document document = new document (pages A4);  

Comments