Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache POI docx - how to set page size?

Does anybody know how to change page size (from letter to A4) for XWPFDocument (docx)?

I cannot find any PrintSetup like it is done in XSSFDocument (xlsx).

Thanks for any help.

like image 482
robson Avatar asked Mar 19 '14 11:03

robson


People also ask

How do I set the page number in Apache POI?

Apache POI Page Number Apache POI allows us to set page number at the footer of the sheet. To set page number getFooter () method creates footer and page () and numPages () both are used to set number. In the following example, we first created a footer and then added page number to it.

How do I change the default page size in Apache OpenOffice?

- Apache OpenOffice Wiki How do I change the default page size? How do I change the default page size? First, create a new template using the preferred new page size: Choose File → New → Text Document . Choose Format → Page . On the page tab, select a page size from the drop-down box.

What is Apache POI for Microsoft Word?

This tutorial focuses on the support of Apache POI for Microsoft Word, the most commonly used Office file format. It walks through steps needed to format and generate an MS Word file and how to parse this file.

What dependencies are required for Apache POI to handle MS Word?

The only dependency that is required for Apache POI to handle MS Word files is: <dependency> <groupId> org.apache.poi </groupId> <artifactId> poi-ooxml </artifactId> <version> 3.15 </version> </dependency> Please click here for the latest version of this artifact. 3.


1 Answers

You'll find similar question like your's here ..You'll find a sample code plus the required page sizes

How to set page orientation for Word document?

I hope this could help!

like image 153
Muhammad Hamed Avatar answered Nov 15 '22 00:11

Muhammad Hamed