Package loci.poi.hssf.usermodel
Class HSSFPrintSetup
- java.lang.Object
-
- loci.poi.hssf.usermodel.HSSFPrintSetup
-
public class HSSFPrintSetup extends java.lang.ObjectUsed 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 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;
- Author:
- Shawn Laubach (slaubach at apache dot org)
-
-
Field Summary
Fields Modifier and Type Field Description static shortA4_PAPERSIZEstatic shortA5_PAPERSIZEstatic shortENVELOPE_10_PAPERSIZEstatic shortENVELOPE_CS_PAPERSIZEstatic shortENVELOPE_DL_PAPERSIZEstatic shortENVELOPE_MONARCH_PAPERSIZEstatic shortEXECUTIVE_PAPERSIZEstatic shortLEGAL_PAPERSIZEstatic shortLETTER_PAPERSIZE
-
Constructor Summary
Constructors Modifier Constructor Description protectedHSSFPrintSetup(PrintSetupRecord printSetupRecord)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description shortgetCopies()Returns the number of copies.booleangetDraft()Returns the draft mode.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.voidsetCopies(short copies)Sets the number of copies.voidsetDraft(boolean d)Set whether it is in draft modevoidsetFitHeight(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.
-
-
-
Field Detail
-
LETTER_PAPERSIZE
public static final short LETTER_PAPERSIZE
- See Also:
- Constant Field Values
-
LEGAL_PAPERSIZE
public static final short LEGAL_PAPERSIZE
- See Also:
- Constant Field Values
-
EXECUTIVE_PAPERSIZE
public static final short EXECUTIVE_PAPERSIZE
- See Also:
- Constant Field Values
-
A4_PAPERSIZE
public static final short A4_PAPERSIZE
- See Also:
- Constant Field Values
-
A5_PAPERSIZE
public static final short A5_PAPERSIZE
- See Also:
- Constant Field Values
-
ENVELOPE_10_PAPERSIZE
public static final short ENVELOPE_10_PAPERSIZE
- See Also:
- Constant Field Values
-
ENVELOPE_DL_PAPERSIZE
public static final short ENVELOPE_DL_PAPERSIZE
- See Also:
- Constant Field Values
-
ENVELOPE_CS_PAPERSIZE
public static final short ENVELOPE_CS_PAPERSIZE
- See Also:
- Constant Field Values
-
ENVELOPE_MONARCH_PAPERSIZE
public static final short ENVELOPE_MONARCH_PAPERSIZE
- See Also:
- Constant Field Values
-
-
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.- Parameters:
size- the paper size.
-
setScale
public void setScale(short scale)
Set the scale.- Parameters:
scale- the scale to use
-
setPageStart
public void setPageStart(short start)
Set the page numbering start.- Parameters:
start- the page numbering start
-
setFitWidth
public void setFitWidth(short width)
Set the number of pages wide to fit the sheet in- Parameters:
width- the number of pages
-
setFitHeight
public void setFitHeight(short height)
Set the number of pages high to fit the sheet in- 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- Parameters:
ltor- left to right
-
setLandscape
public void setLandscape(boolean ls)
Set whether to print in landscape- Parameters:
ls- landscape
-
setValidSettings
public void setValidSettings(boolean valid)
Valid settings. I'm not for sure.- Parameters:
valid- Valid
-
setNoColor
public void setNoColor(boolean mono)
Set whether it is black and white- Parameters:
mono- Black and white
-
setDraft
public void setDraft(boolean d)
Set whether it is in draft mode- Parameters:
d- draft
-
setNotes
public void setNotes(boolean printnotes)
Print the include notes- Parameters:
printnotes- print the notes
-
setNoOrientation
public void setNoOrientation(boolean orientation)
Set no orientation. ?- Parameters:
orientation- Orientation.
-
setUsePage
public void setUsePage(boolean page)
Set whether to use page start- Parameters:
page- Use page start
-
setHResolution
public void setHResolution(short resolution)
Sets the horizontal resolution.- Parameters:
resolution- horizontal resolution
-
setVResolution
public void setVResolution(short resolution)
Sets the vertical resolution.- Parameters:
resolution- vertical resolution
-
setHeaderMargin
public void setHeaderMargin(double headermargin)
Sets the header margin.- Parameters:
headermargin- header margin
-
setFooterMargin
public void setFooterMargin(double footermargin)
Sets the footer margin.- Parameters:
footermargin- footer margin
-
setCopies
public void setCopies(short copies)
Sets the number of copies.- Parameters:
copies- number of copies
-
getPaperSize
public short getPaperSize()
Returns the paper size.- Returns:
- paper size
-
getScale
public short getScale()
Returns the scale.- Returns:
- scale
-
getPageStart
public short getPageStart()
Returns the page start.- Returns:
- page start
-
getFitWidth
public short getFitWidth()
Returns the number of pages wide to fit sheet in.- Returns:
- number of pages wide to fit sheet in
-
getFitHeight
public short getFitHeight()
Returns the number of pages high to fit the sheet in.- 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.- Returns:
- left to right print order
-
getLandscape
public boolean getLandscape()
Returns the landscape mode.- Returns:
- landscape mode
-
getValidSettings
public boolean getValidSettings()
Returns the valid settings.- Returns:
- valid settings
-
getNoColor
public boolean getNoColor()
Returns the black and white setting.- Returns:
- black and white setting
-
getDraft
public boolean getDraft()
Returns the draft mode.- Returns:
- draft mode
-
getNotes
public boolean getNotes()
Returns the print notes.- Returns:
- print notes
-
getNoOrientation
public boolean getNoOrientation()
Returns the no orientation.- Returns:
- no orientation
-
getUsePage
public boolean getUsePage()
Returns the use page numbers.- Returns:
- use page numbers
-
getHResolution
public short getHResolution()
Returns the horizontal resolution.- Returns:
- horizontal resolution
-
getVResolution
public short getVResolution()
Returns the vertical resolution.- Returns:
- vertical resolution
-
getHeaderMargin
public double getHeaderMargin()
Returns the header margin.- Returns:
- header margin
-
getFooterMargin
public double getFooterMargin()
Returns the footer margin.- Returns:
- footer margin
-
getCopies
public short getCopies()
Returns the number of copies.- Returns:
- number of copies
-
-