From 512a6f2bb57a75943628d0d451a6a7e5c22ff37a Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Tue, 30 Mar 2010 10:05:53 +0000 Subject: [PATCH] Fix bug #48485 - Add extra paper size constans to PrintSetup, such as A3, B4 and B5 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@929064 13f79535-47bb-0310-9956-ffa450edef68 --- src/documentation/content/xdocs/status.xml | 1 + .../poi/hssf/record/PrintSetupRecord.java | 3 + .../apache/poi/ss/usermodel/PrintSetup.java | 61 ++++++++++++++++--- 3 files changed, 57 insertions(+), 8 deletions(-) diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index 4498876f5..50bc1cd62 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -34,6 +34,7 @@ + 48485 - Add extra paper size constans to PrintSetup, such as A3, B4 and B5 Make poifs.filesystem.DirectoryNode preserve the original ordering of its files, which HSMF needs to be able to correctly match up chunks Support evaluation of indirect defined names in INDIRECT 43670 - Improve HDGF ChunkV11 separator detection, and short string detection, to solve the "Negative length of ChunkHeader" problem diff --git a/src/java/org/apache/poi/hssf/record/PrintSetupRecord.java b/src/java/org/apache/poi/hssf/record/PrintSetupRecord.java index 08dafd4e0..96f52b767 100644 --- a/src/java/org/apache/poi/hssf/record/PrintSetupRecord.java +++ b/src/java/org/apache/poi/hssf/record/PrintSetupRecord.java @@ -17,6 +17,7 @@ package org.apache.poi.hssf.record; +import org.apache.poi.ss.usermodel.PrintSetup; import org.apache.poi.util.LittleEndianOutput; import org.apache.poi.util.BitField; import org.apache.poi.util.BitFieldFactory; @@ -25,12 +26,14 @@ import org.apache.poi.util.BitFieldFactory; * Title: PAGESETUP (0x00A1)

* Description: Stores print setup options -- bogus for HSSF (and marked as such)

* REFERENCE: PG 385 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)

+ * REFERENCE: PG 412 Microsoft Excel Binary File Format Structure v20091214

* @author Andrew C. Oliver (acoliver at apache dot org) * @author Jason Height (jheight at chariot dot net dot au) * @version 2.0-pre */ public final class PrintSetupRecord extends StandardRecord { public final static short sid = 0x00A1; + /** Constants for this are held in {@link PrintSetup} */ private short field_1_paper_size; private short field_2_scale; private short field_3_page_start; diff --git a/src/java/org/apache/poi/ss/usermodel/PrintSetup.java b/src/java/org/apache/poi/ss/usermodel/PrintSetup.java index 0d8aa74bb..4857df4d8 100644 --- a/src/java/org/apache/poi/ss/usermodel/PrintSetup.java +++ b/src/java/org/apache/poi/ss/usermodel/PrintSetup.java @@ -18,24 +18,69 @@ package org.apache.poi.ss.usermodel; public interface PrintSetup { - + /** US Letter 8 1/2 x 11 in */ public static final short LETTER_PAPERSIZE = 1; - + /** US Letter Small 8 1/2 x 11 in */ + public static final short LETTER_SMALL_PAGESIZE = 2; + /** US Tabloid 11 x 17 in */ + public static final short TABLOID_PAPERSIZE = 3; + /** US Ledger 17 x 11 in */ + public static final short LEDGER_PAPERSIZE = 4; + /** US Legal 8 1/2 x 14 in */ public static final short LEGAL_PAPERSIZE = 5; - + /** US Statement 5 1/2 x 8 1/2 in */ + public static final short STATEMENT_PAPERSIZE = 6; + /** US Executive 7 1/4 x 10 1/2 in */ public static final short EXECUTIVE_PAPERSIZE = 7; - + /** A3 - 297x420 mm */ + public static final short A3_PAPERSIZE = 8; + /** A4 - 210x297 mm */ public static final short A4_PAPERSIZE = 9; - + /** A4 Small - 210x297 mm */ + public static final short A4_SMALL_PAPERSIZE = 10; + /** A5 - 148x210 mm */ public static final short A5_PAPERSIZE = 11; - + /** B4 (JIS) 250x354 mm */ + public static final short B4_PAPERSIZE = 12; + /** B5 (JIS) 182x257 mm */ + public static final short B5_PAPERSIZE = 13; + /** Folio 8 1/2 x 13 in */ + public static final short FOLIO8_PAPERSIZE = 14; + /** Quarto 215x275 mm */ + public static final short QUARTO_PAPERSIZE = 15; + /** 10 x 14 in */ + public static final short TEN_BY_FOURTEEN_PAPERSIZE = 16; + /** 11 x 17 in */ + public static final short ELEVEN_BY_SEVENTEEN_PAPERSIZE = 17; + /** US Note 8 1/2 x 11 in */ + public static final short NOTE8_PAPERSIZE = 18; + /** US Envelope #9 3 7/8 x 8 7/8 */ + public static final short ENVELOPE_9_PAPERSIZE = 19; + /** US Envelope #10 4 1/8 x 9 1/2 */ public static final short ENVELOPE_10_PAPERSIZE = 20; - + /** Envelope DL 110x220 mm */ public static final short ENVELOPE_DL_PAPERSIZE = 27; - + /** Envelope C5 162x229 mm */ public static final short ENVELOPE_CS_PAPERSIZE = 28; + public static final short ENVELOPE_C5_PAPERSIZE = 28; + /** Envelope C3 324x458 mm */ + public static final short ENVELOPE_C3_PAPERSIZE = 29; + /** Envelope C4 229x324 mm */ + public static final short ENVELOPE_C4_PAPERSIZE = 30; + /** Envelope C6 114x162 mm */ + public static final short ENVELOPE_C6_PAPERSIZE = 31; public static final short ENVELOPE_MONARCH_PAPERSIZE = 37; + /** A4 Extra - 9.27 x 12.69 in */ + public static final short A4_EXTRA_PAPERSIZE = 53; + /** A4 Transverse - 210x297 mm */ + public static final short A4_TRANSVERSE_PAPERSIZE = 55; + /** A4 Plus - 210x330 mm */ + public static final short A4_PLUS_PAPERSIZE = 60; + /** US Letter Rotated 11 x 8 1/2 in */ + public static final short LETTER_ROTATED_PAPERSIZE = 75; + /** A4 Rotated - 297x210 mm */ + public static final short A4_ROTATED_PAPERSIZE = 77; /** * Set the paper size.