Package org.apache.poi.hssf.usermodel
Class HSSFPrintSetup
- java.lang.Object
-
- org.apache.poi.hssf.usermodel.HSSFPrintSetup
-
- All Implemented Interfaces:
PrintSetup
public class HSSFPrintSetup extends Object implements PrintSetup
Used to modify the print setup.Paper size constants have been added for the ones I have access to. They follow as:
public static final short PRINTER_DEFAULT_PAPERSIZE = 0;
public static final short LETTER_PAPERSIZE = 1;
public static final short LEGAL_PAPERSIZE = 5;
public static final short EXECUTIVE_PAPERSIZE = 7;
public static final short A4_PAPERSIZE = 9;
public static final short A5_PAPERSIZE = 11;
public static final short ENVELOPE_10_PAPERSIZE = 20;
public static final short ENVELOPE_DL_PAPERSIZE = 27;
public static final short ENVELOPE_CS_PAPERSIZE = 28;
public static final short ENVELOPE_MONARCH_PAPERSIZE = 37;
-
-
Field Summary
-
Fields inherited from interface org.apache.poi.ss.usermodel.PrintSetup
A3_PAPERSIZE, A4_EXTRA_PAPERSIZE, A4_PAPERSIZE, A4_PLUS_PAPERSIZE, A4_ROTATED_PAPERSIZE, A4_SMALL_PAPERSIZE, A4_TRANSVERSE_PAPERSIZE, A5_PAPERSIZE, B4_PAPERSIZE, B5_PAPERSIZE, ELEVEN_BY_SEVENTEEN_PAPERSIZE, ENVELOPE_10_PAPERSIZE, ENVELOPE_9_PAPERSIZE, ENVELOPE_C3_PAPERSIZE, ENVELOPE_C4_PAPERSIZE, ENVELOPE_C5_PAPERSIZE, ENVELOPE_C6_PAPERSIZE, ENVELOPE_CS_PAPERSIZE, ENVELOPE_DL_PAPERSIZE, ENVELOPE_MONARCH_PAPERSIZE, EXECUTIVE_PAPERSIZE, FOLIO8_PAPERSIZE, LEDGER_PAPERSIZE, LEGAL_PAPERSIZE, LETTER_PAPERSIZE, LETTER_ROTATED_PAPERSIZE, LETTER_SMALL_PAGESIZE, NOTE8_PAPERSIZE, PRINTER_DEFAULT_PAPERSIZE, QUARTO_PAPERSIZE, STATEMENT_PAPERSIZE, TABLOID_PAPERSIZE, TEN_BY_FOURTEEN_PAPERSIZE
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedHSSFPrintSetup(PrintSetupRecord printSetupRecord)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetCommentsMode()shortgetCopies()Returns the number of copies.booleangetDraft()Returns the draft mode.intgetErrorsMode()shortgetFitHeight()Returns the number of pages high to fit the sheet in.shortgetFitWidth()Returns the number of pages wide to fit sheet in.doublegetFooterMargin()Returns the footer margin.doublegetHeaderMargin()Returns the header margin.shortgetHResolution()Returns the horizontal resolution.booleangetLandscape()Returns the landscape mode.booleangetLeftToRight()Returns the left to right print order.booleangetNoColor()Returns the black and white setting.booleangetNoOrientation()Returns the no orientation.booleangetNotes()Returns the print notes.shortgetOptions()Returns the bit flags for the options.shortgetPageStart()Returns the page start.shortgetPaperSize()Returns the paper size.shortgetScale()Returns the scale.booleangetUsePage()Returns the use page numbers.booleangetValidSettings()Returns the valid settings.shortgetVResolution()Returns the vertical resolution.voidsetCommentsMode(int mode)voidsetCopies(short copies)Sets the number of copies.voidsetDraft(boolean d)Set whether it is in draft modevoidsetErrorsMode(int mode)voidsetFitHeight(short height)Set the number of pages high to fit the sheet invoidsetFitWidth(short width)Set the number of pages wide to fit the sheet invoidsetFooterMargin(double footermargin)Sets the footer margin.voidsetHeaderMargin(double headermargin)Sets the header margin.voidsetHResolution(short resolution)Sets the horizontal resolution.voidsetLandscape(boolean ls)Set whether to print in landscapevoidsetLeftToRight(boolean ltor)Set whether to go left to right or top down in orderingvoidsetNoColor(boolean mono)Set whether it is black and whitevoidsetNoOrientation(boolean orientation)Set no orientation.voidsetNotes(boolean printnotes)Print the include notesvoidsetOptions(short options)Sets the options flags.voidsetPageStart(short start)Set the page numbering start.voidsetPaperSize(short size)Set the paper size.voidsetScale(short scale)Set the scale.voidsetUsePage(boolean page)Set whether to use page startvoidsetValidSettings(boolean valid)Valid settings.voidsetVResolution(short resolution)Sets the vertical resolution.
-
-
-
Constructor Detail
-
HSSFPrintSetup
protected HSSFPrintSetup(PrintSetupRecord printSetupRecord)
Constructor. Takes the low level print setup record.- Parameters:
printSetupRecord- the low level print setup record
-
-
Method Detail
-
setPaperSize
public void setPaperSize(short size)
Set the paper size.- Specified by:
setPaperSizein interfacePrintSetup- Parameters:
size- the paper size.
-
setScale
public void setScale(short scale)
Set the scale.- Specified by:
setScalein interfacePrintSetup- Parameters:
scale- the scale to use
-
setPageStart
public void setPageStart(short start)
Set the page numbering start.- Specified by:
setPageStartin interfacePrintSetup- Parameters:
start- the page numbering start
-
setFitWidth
public void setFitWidth(short width)
Set the number of pages wide to fit the sheet in- Specified by:
setFitWidthin interfacePrintSetup- Parameters:
width- the number of pages
-
setFitHeight
public void setFitHeight(short height)
Set the number of pages high to fit the sheet in- Specified by:
setFitHeightin interfacePrintSetup- Parameters:
height- the number of pages
-
setOptions
public void setOptions(short options)
Sets the options flags. Not advisable to do it directly.- Parameters:
options- The bit flags for the options
-
setLeftToRight
public void setLeftToRight(boolean ltor)
Set whether to go left to right or top down in ordering- Specified by:
setLeftToRightin interfacePrintSetup- Parameters:
ltor- left to right
-
setLandscape
public void setLandscape(boolean ls)
Set whether to print in landscape- Specified by:
setLandscapein interfacePrintSetup- Parameters:
ls- landscape
-
setValidSettings
public void setValidSettings(boolean valid)
Valid settings. I'm not for sure.- Specified by:
setValidSettingsin interfacePrintSetup- Parameters:
valid- Valid
-
setNoColor
public void setNoColor(boolean mono)
Set whether it is black and white- Specified by:
setNoColorin interfacePrintSetup- Parameters:
mono- Black and white
-
setDraft
public void setDraft(boolean d)
Set whether it is in draft mode- Specified by:
setDraftin interfacePrintSetup- Parameters:
d- draft
-
setNotes
public void setNotes(boolean printnotes)
Print the include notes- Specified by:
setNotesin interfacePrintSetup- Parameters:
printnotes- print the notes
-
setNoOrientation
public void setNoOrientation(boolean orientation)
Set no orientation. ?- Specified by:
setNoOrientationin interfacePrintSetup- Parameters:
orientation- Orientation.
-
setUsePage
public void setUsePage(boolean page)
Set whether to use page start- Specified by:
setUsePagein interfacePrintSetup- Parameters:
page- Use page start
-
setHResolution
public void setHResolution(short resolution)
Sets the horizontal resolution.- Specified by:
setHResolutionin interfacePrintSetup- Parameters:
resolution- horizontal resolution
-
setVResolution
public void setVResolution(short resolution)
Sets the vertical resolution.- Specified by:
setVResolutionin interfacePrintSetup- Parameters:
resolution- vertical resolution
-
setHeaderMargin
public void setHeaderMargin(double headermargin)
Sets the header margin.- Specified by:
setHeaderMarginin interfacePrintSetup- Parameters:
headermargin- header margin
-
setFooterMargin
public void setFooterMargin(double footermargin)
Sets the footer margin.- Specified by:
setFooterMarginin interfacePrintSetup- Parameters:
footermargin- footer margin
-
setCopies
public void setCopies(short copies)
Sets the number of copies.- Specified by:
setCopiesin interfacePrintSetup- Parameters:
copies- number of copies
-
getPaperSize
public short getPaperSize()
Returns the paper size.- Specified by:
getPaperSizein interfacePrintSetup- Returns:
- paper size
-
getScale
public short getScale()
Returns the scale.- Specified by:
getScalein interfacePrintSetup- Returns:
- scale
-
getPageStart
public short getPageStart()
Returns the page start.- Specified by:
getPageStartin interfacePrintSetup- Returns:
- page start
-
getFitWidth
public short getFitWidth()
Returns the number of pages wide to fit sheet in.- Specified by:
getFitWidthin interfacePrintSetup- Returns:
- number of pages wide to fit sheet in
-
getFitHeight
public short getFitHeight()
Returns the number of pages high to fit the sheet in.- Specified by:
getFitHeightin interfacePrintSetup- Returns:
- number of pages high to fit the sheet in
-
getOptions
public short getOptions()
Returns the bit flags for the options.- Returns:
- bit flags for the options
-
getLeftToRight
public boolean getLeftToRight()
Returns the left to right print order.- Specified by:
getLeftToRightin interfacePrintSetup- Returns:
- left to right print order
-
getLandscape
public boolean getLandscape()
Returns the landscape mode.- Specified by:
getLandscapein interfacePrintSetup- Returns:
- landscape mode
-
getValidSettings
public boolean getValidSettings()
Returns the valid settings.- Specified by:
getValidSettingsin interfacePrintSetup- Returns:
- valid settings
-
getNoColor
public boolean getNoColor()
Returns the black and white setting.- Specified by:
getNoColorin interfacePrintSetup- Returns:
- black and white setting
-
getDraft
public boolean getDraft()
Returns the draft mode.- Specified by:
getDraftin interfacePrintSetup- Returns:
- draft mode
-
getNotes
public boolean getNotes()
Returns the print notes.- Specified by:
getNotesin interfacePrintSetup- Returns:
- print notes
-
getNoOrientation
public boolean getNoOrientation()
Returns the no orientation.- Specified by:
getNoOrientationin interfacePrintSetup- Returns:
- no orientation
-
getUsePage
public boolean getUsePage()
Returns the use page numbers.- Specified by:
getUsePagein interfacePrintSetup- Returns:
- use page numbers
-
getHResolution
public short getHResolution()
Returns the horizontal resolution.- Specified by:
getHResolutionin interfacePrintSetup- Returns:
- horizontal resolution
-
getVResolution
public short getVResolution()
Returns the vertical resolution.- Specified by:
getVResolutionin interfacePrintSetup- Returns:
- vertical resolution
-
getHeaderMargin
public double getHeaderMargin()
Returns the header margin.- Specified by:
getHeaderMarginin interfacePrintSetup- Returns:
- header margin
-
getFooterMargin
public double getFooterMargin()
Returns the footer margin.- Specified by:
getFooterMarginin interfacePrintSetup- Returns:
- footer margin
-
getCopies
public short getCopies()
Returns the number of copies.- Specified by:
getCopiesin interfacePrintSetup- Returns:
- number of copies
-
getCommentsMode
public int getCommentsMode()
- Since:
- 3.9.5
-
setCommentsMode
public void setCommentsMode(int mode)
- Since:
- 3.9.5
-
getErrorsMode
public int getErrorsMode()
- Since:
- 3.9.5
-
setErrorsMode
public void setErrorsMode(int mode)
- Since:
- 3.9.5
-
-