org.apache.poi.xssf.usermodel

## Class XSSFPrintSetup

- java.lang.Object
- - org.apache.poi.xssf.usermodel.XSSFPrintSetup

- All Implemented Interfaces:
    PrintSetup

      public class XSSFPrintSetup
      extends java.lang.Object
      implements PrintSetup

  Page setup and page margins settings for the worksheet.

- - ### 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 and Description
    --- | ---
    `protected` | `XSSFPrintSetup(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet worksheet)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `getBottomMargin()` Returns the bottom margin.
    `PrintCellComments` | `getCellComment()`
    `short` | `getCopies()` Returns the number of copies.
    `boolean` | `getDraft()` Returns the draft mode.
    `short` | `getFitHeight()` Returns the number of pages high to fit the sheet in.
    `short` | `getFitWidth()` Returns the number of pages wide to fit sheet in.
    `double` | `getFooterMargin()` Returns the footer margin.
    `double` | `getHeaderMargin()` Returns the header margin.
    `short` | `getHResolution()` Returns the horizontal resolution.
    `boolean` | `getLandscape()` Returns the landscape mode.
    `double` | `getLeftMargin()` Returns the left margin.
    `boolean` | `getLeftToRight()` Returns the left to right print order.
    `boolean` | `getNoColor()` Returns the black and white setting.
    `boolean` | `getNoOrientation()` Returns the no orientation.
    `boolean` | `getNotes()` Returns the print notes.
    `PrintOrientation` | `getOrientation()` Orientation of the page: landscape - portrait.
    `PageOrder` | `getPageOrder()` get print page order.
    `short` | `getPageStart()` Set the page numbering start.
    `short` | `getPaperSize()` Returns the paper size.
    `PaperSize` | `getPaperSizeEnum()` Returns the paper size as enum.
    `double` | `getRightMargin()` Returns the right margin.
    `short` | `getScale()` Returns the scale.
    `double` | `getTopMargin()` Returns the top margin.
    `boolean` | `getUsePage()` Returns the use page numbers.
    `boolean` | `getValidSettings()` Use the printer's defaults settings for page setup values and don't use the default values specified in the schema.
    `short` | `getVResolution()` Returns the vertical resolution.
    `void` | `setBottomMargin(double bottomMargin)` Sets the bottom margin.
    `void` | `setCopies(short copies)` Sets the number of copies.
    `void` | `setDraft(boolean d)` Set whether it is in draft mode
    `void` | `setFitHeight(short height)` Set the number of pages high to fit the sheet in
    `void` | `setFitWidth(short width)` Set the number of pages wide to fit the sheet in
    `void` | `setFooterMargin(double footerMargin)` Sets the footer margin.
    `void` | `setHeaderMargin(double headerMargin)` Sets the header margin.
    `void` | `setHResolution(short resolution)` Sets the horizontal resolution.
    `void` | `setLandscape(boolean ls)` Set whether to print in landscape
    `void` | `setLeftMargin(double leftMargin)` Sets the left margin.
    `void` | `setLeftToRight(boolean leftToRight)` Set whether to go left to right or top down in ordering
    `void` | `setNoColor(boolean mono)` Set whether it is black and white
    `void` | `setNoOrientation(boolean orientation)` Set no orientation.
    `void` | `setNotes(boolean printNotes)` Print the include notes
    `void` | `setOrientation(PrintOrientation orientation)` Orientation of the page: landscape - portrait.
    `void` | `setPageOrder(PageOrder pageOrder)` Set print page order.
    `void` | `setPageStart(short start)` Set the page numbering start.
    `void` | `setPaperSize(PaperSize size)` Set the paper size as enum value.
    `void` | `setPaperSize(short size)` Set the paper size.
    `void` | `setRightMargin(double rightMargin)` Sets the right margin.
    `void` | `setScale(short scale)` Set the scale.
    `void` | `setTopMargin(double topMargin)` Sets the top margin.
    `void` | `setUsePage(boolean page)` Set whether to use page start
    `void` | `setValidSettings(boolean valid)` Use the printer's defaults settings for page setup values and don't use the default values specified in the schema.
    `void` | `setVResolution(short resolution)` Sets the vertical resolution.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### XSSFPrintSetup

          protected XSSFPrintSetup(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet worksheet)

  - ### Method Detail

    - #### setPaperSize

          public void setPaperSize(short size)

      Set the paper size.
      Specified by:
        `setPaperSize` in interface `PrintSetup`
      Parameters:
        `size` - the paper size.

    - #### setPaperSize

          public void setPaperSize(PaperSize size)

      Set the paper size as enum value.
      Parameters:
        `size` - value for the paper size.

    - #### setScale

          public void setScale(short scale)

      Set the scale. Valid values range from 10 to 400. This setting is overridden when fitToWidth and/or fitToHeight are in use
      Specified by:
        `setScale` in interface `PrintSetup`
      Parameters:
        `scale` - the scale to use

    - #### setPageStart

          public void setPageStart(short start)

      Set the page numbering start. Page number for first printed page. If no value is specified, then 'automatic' is assumed.
      Specified by:
        `setPageStart` in interface `PrintSetup`
      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:
        `setFitWidth` in interface `PrintSetup`
      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:
        `setFitHeight` in interface `PrintSetup`
      Parameters:
        `height` - the number of pages

    - #### setLeftToRight

          public void setLeftToRight(boolean leftToRight)

      Set whether to go left to right or top down in ordering
      Specified by:
        `setLeftToRight` in interface `PrintSetup`
      Parameters:
        `leftToRight` - left to right

    - #### setLandscape

          public void setLandscape(boolean ls)

      Set whether to print in landscape
      Specified by:
        `setLandscape` in interface `PrintSetup`
      Parameters:
        `ls` - landscape

    - #### setValidSettings

          public void setValidSettings(boolean valid)

      Use the printer's defaults settings for page setup values and don't use the default values specified in the schema. For example, if dpi is not present or specified in the XML, the application shall not assume 600dpi as specified in the schema as a default and instead shall let the printer specify the default dpi.
      Specified by:
        `setValidSettings` in interface `PrintSetup`
      Parameters:
        `valid` - Valid

    - #### setNoColor

          public void setNoColor(boolean mono)

      Set whether it is black and white
      Specified by:
        `setNoColor` in interface `PrintSetup`
      Parameters:
        `mono` - Black and white

    - #### setDraft

          public void setDraft(boolean d)

      Set whether it is in draft mode
      Specified by:
        `setDraft` in interface `PrintSetup`
      Parameters:
        `d` - draft

    - #### setNotes

          public void setNotes(boolean printNotes)

      Print the include notes
      Specified by:
        `setNotes` in interface `PrintSetup`
      Parameters:
        `printNotes` - print the notes

    - #### setNoOrientation

          public void setNoOrientation(boolean orientation)

      Set no orientation.
      Specified by:
        `setNoOrientation` in interface `PrintSetup`
      Parameters:
        `orientation` - Orientation.

    - #### setUsePage

          public void setUsePage(boolean page)

      Set whether to use page start
      Specified by:
        `setUsePage` in interface `PrintSetup`
      Parameters:
        `page` - Use page start

    - #### setHResolution

          public void setHResolution(short resolution)

      Sets the horizontal resolution.
      Specified by:
        `setHResolution` in interface `PrintSetup`
      Parameters:
        `resolution` - horizontal resolution

    - #### setVResolution

          public void setVResolution(short resolution)

      Sets the vertical resolution.
      Specified by:
        `setVResolution` in interface `PrintSetup`
      Parameters:
        `resolution` - vertical resolution

    - #### setHeaderMargin

          public void setHeaderMargin(double headerMargin)

      Sets the header margin.
      Specified by:
        `setHeaderMargin` in interface `PrintSetup`
      Parameters:
        `headerMargin` - header margin

    - #### setFooterMargin

          public void setFooterMargin(double footerMargin)

      Sets the footer margin.
      Specified by:
        `setFooterMargin` in interface `PrintSetup`
      Parameters:
        `footerMargin` - footer margin

    - #### setCopies

          public void setCopies(short copies)

      Sets the number of copies.
      Specified by:
        `setCopies` in interface `PrintSetup`
      Parameters:
        `copies` - number of copies

    - #### setOrientation

          public void setOrientation(PrintOrientation orientation)

      Orientation of the page: landscape - portrait.
      Parameters:
        `orientation` - - Orientation of the page
      See Also:
        `PrintOrientation`

    - #### getOrientation

          public PrintOrientation getOrientation()

      Orientation of the page: landscape - portrait.
      Returns:
        Orientation of the page
      See Also:
        `PrintOrientation`

    - #### getCellComment

          public PrintCellComments getCellComment()

    - #### setPageOrder

          public void setPageOrder(PageOrder pageOrder)

      Set print page order.
      Parameters:
        `pageOrder` - An enum indicating the wanted ordering of printed pages

    - #### getPageOrder

          public PageOrder getPageOrder()

      get print page order.
      Returns:
        The currently set ordering of printed pages

    - #### getPaperSize

          public short getPaperSize()

      Returns the paper size.
      Specified by:
        `getPaperSize` in interface `PrintSetup`
      Returns:
        short - paper size

    - #### getPaperSizeEnum

          public PaperSize getPaperSizeEnum()

      Returns the paper size as enum.
      Returns:
        PaperSize paper size
      See Also:
        `PaperSize`

    - #### getScale

          public short getScale()

      Returns the scale.
      Specified by:
        `getScale` in interface `PrintSetup`
      Returns:
        short - scale

    - #### getPageStart

          public short getPageStart()

      Set the page numbering start. Page number for first printed page. If no value is specified, then 'automatic' is assumed.
      Specified by:
        `getPageStart` in interface `PrintSetup`
      Returns:
        page number for first printed page

    - #### getFitWidth

          public short getFitWidth()

      Returns the number of pages wide to fit sheet in.
      Specified by:
        `getFitWidth` in interface `PrintSetup`
      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:
        `getFitHeight` in interface `PrintSetup`
      Returns:
        number of pages high to fit the sheet in

    - #### getLeftToRight

          public boolean getLeftToRight()

      Returns the left to right print order.
      Specified by:
        `getLeftToRight` in interface `PrintSetup`
      Returns:
        left to right print order

    - #### getLandscape

          public boolean getLandscape()

      Returns the landscape mode.
      Specified by:
        `getLandscape` in interface `PrintSetup`
      Returns:
        landscape mode

    - #### getValidSettings

          public boolean getValidSettings()

      Use the printer's defaults settings for page setup values and don't use the default values specified in the schema. For example, if dpi is not present or specified in the XML, the application shall not assume 600dpi as specified in the schema as a default and instead shall let the printer specify the default dpi.
      Specified by:
        `getValidSettings` in interface `PrintSetup`
      Returns:
        valid settings

    - #### getNoColor

          public boolean getNoColor()

      Returns the black and white setting.
      Specified by:
        `getNoColor` in interface `PrintSetup`
      Returns:
        black and white setting

    - #### getDraft

          public boolean getDraft()

      Returns the draft mode.
      Specified by:
        `getDraft` in interface `PrintSetup`
      Returns:
        draft mode

    - #### getNotes

          public boolean getNotes()

      Returns the print notes.
      Specified by:
        `getNotes` in interface `PrintSetup`
      Returns:
        print notes

    - #### getNoOrientation

          public boolean getNoOrientation()

      Returns the no orientation.
      Specified by:
        `getNoOrientation` in interface `PrintSetup`
      Returns:
        no orientation

    - #### getUsePage

          public boolean getUsePage()

      Returns the use page numbers.
      Specified by:
        `getUsePage` in interface `PrintSetup`
      Returns:
        use page numbers

    - #### getHResolution

          public short getHResolution()

      Returns the horizontal resolution.
      Specified by:
        `getHResolution` in interface `PrintSetup`
      Returns:
        horizontal resolution

    - #### getVResolution

          public short getVResolution()

      Returns the vertical resolution.
      Specified by:
        `getVResolution` in interface `PrintSetup`
      Returns:
        vertical resolution

    - #### getHeaderMargin

          public double getHeaderMargin()

      Returns the header margin.
      Specified by:
        `getHeaderMargin` in interface `PrintSetup`
      Returns:
        header margin

    - #### getFooterMargin

          public double getFooterMargin()

      Returns the footer margin.
      Specified by:
        `getFooterMargin` in interface `PrintSetup`
      Returns:
        footer margin

    - #### getCopies

          public short getCopies()

      Returns the number of copies.
      Specified by:
        `getCopies` in interface `PrintSetup`
      Returns:
        number of copies

    - #### setTopMargin

          public void setTopMargin(double topMargin)

      Sets the top margin.
      Parameters:
        `topMargin` - top margin

    - #### getTopMargin

          public double getTopMargin()

      Returns the top margin.
      Returns:
        top margin

    - #### setBottomMargin

          public void setBottomMargin(double bottomMargin)

      Sets the bottom margin.
      Parameters:
        `bottomMargin` - bottom margin

    - #### getBottomMargin

          public double getBottomMargin()

      Returns the bottom margin.
      Returns:
        bottom margin

    - #### setLeftMargin

          public void setLeftMargin(double leftMargin)

      Sets the left margin.
      Parameters:
        `leftMargin` - left margin

    - #### getLeftMargin

          public double getLeftMargin()

      Returns the left margin.
      Returns:
        left margin

    - #### setRightMargin

          public void setRightMargin(double rightMargin)

      Sets the right margin.
      Parameters:
        `rightMargin` - right margin

    - #### getRightMargin

          public double getRightMargin()

      Returns the right margin.
      Returns:
        right margin

Copyright 2020 The Apache Software Foundation or its licensors, as applicable.