Apache POI setPrintArea for A4 page format

I am working with the Apache POI API to create .xls files and I want to set printArea of ​​my file.

I know that there is a function called setPrintArea() , but it receives as the parameters the beginning and end of the row and column of my printable area. A.

I want to know if there is a way to set the print area for each A4 sheet (210 mm x 290 mm)

Thanks.

+4
source share
1 answer

For each Sheet in the book, find your PrintSetup object and call setPaperSize , passing in the appropriate PrintSetup constant: A4_PAPERSIZE .

 mySheet.getPrintSetup().setPaperSize(PrintSetup.A4_PAPERSIZE); 
+8
source

All Articles