[]
        
(Showing Draft Content)

IPageSetup

Interface IPageSetup


public interface IPageSetup
Represents the page setup description.

Provides access to worksheet print and pagination settings, including paper size, orientation, margins, headers and footers, print area, repeated title rows and columns, page order, and scaling options used when printing or exporting a worksheet.

Use IWorksheet.getPageSetup() to obtain the page setup for a worksheet and configure its printing behavior.


 IPageSetup pageSetup = worksheet.getPageSetup();
 pageSetup.setOrientation(PageOrientation.Landscape);
 pageSetup.setPrintTitleRows("$1:$1");
 pageSetup.setFitToPagesWide(1);
 pageSetup.setFitToPagesTall(0);
 
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    customPaperSize(double width, double height)
    Sets the custom paper size, in unit of inches.
    void
    Generates the page setup from the specified JSON string.
    boolean
    Gets whether the header and footer are aligned with the margins set in the page setup options.
    boolean
    Gets whether column widths are adjusted to fit the longest text width for printing.
    boolean
    Gets whether row heights are adjusted to fit the tallest text height for printing.
    boolean
    Gets whether elements of the document will be printed in black and white.
    double
    Gets the size of the bottom margin, in points.
    Gets the text in the center footer section of the IPageSetup object.
    Gets a IGraphic object that represents the picture for the center section of the footer.
    Gets the text in the center header section of the IPageSetup object.
    Gets a IGraphic object that represents the picture for the center section of the header.
    boolean
    Gets whether the sheet is centered horizontally on the page when it's printed.
    boolean
    Gets whether the sheet is centered vertically on the page when it's printed.
    boolean
    Gets whether a different header or footer is used on the first page.
    boolean
    Gets whether the sheet will be printed without graphics.
    Gets the alignment of text on the even IPage of a workbook or section.
    Gets the alignment of text on the first IPage of a workbook or section.
    int
    Gets the first page number that will be used when this sheet is printed.
    int
    Gets the number of pages tall the worksheet will be scaled to when it's printed.
    int
    Gets the number of pages wide the worksheet will be scaled to when it's printed.
    double
    Gets the size of the footer margin, in points.
    double
    Gets the size of the header margin, in points.
    boolean
    Gets whether the first page number is automatically assigned.
    boolean
    Gets whether the worksheet is scaled as a percentage.
    Gets the text in the left footer section of the IPageSetup object.
    Gets a IGraphic object that represents the picture for the left section of the footer.
    Gets the text in the left header section of the IPageSetup object.
    Gets a IGraphic object that represents the picture for the left section of the header.
    double
    Gets the size of the left margin, in points.
    boolean
    Gets whether the specified PageSetup object has different headers and footers for odd-numbered and even-numbered pages.
    Gets a Order value that represents the order used to number pages when printing a large worksheet.
    Gets a PageOrientation value that represents the portrait or landscape printing mode.
    double
    Gets the height in inches of the paper, considering page orientation.
    Gets the size of the paper.
    double
    Gets the width in inches of the paper, considered page orientation.
    Gets the range to be printed, as a string using A1-style references in the language of the macro.
    Gets the way comments are printed with the sheet.
    int
    Gets the number of copies to print.
    Gets a PrintErrors constant specifying how cell error values are displayed when the worksheet is printed.
    boolean
    Gets whether cell gridlines are printed on the page.
    boolean
    Gets whether row and column headings are printed with this page.
    boolean
    Gets whether cell notes are printed as end notes with the sheet.
    Gets the range of pages to print, where page numbers or page ranges are separated by commas and counted from the beginning of the document.
    Gets a PrintQuality value that represents the print quality of this page.
    Gets the columns that contain the cells to be repeated on the right side of each page, as a string in A1-style notation in the language of the macro.
    Gets the rows that contain the cells to be repeated on the bottom of each page, as a string in A1-style notation in the language of the macro.
    Gets the columns that contain the cells to be repeated on the left side of each page, as a string in A1-style notation in the language of the macro.
    Gets the rows that contain the cells to be repeated at the top of each page, as a string in A1-style notation in the language of the macro.
    Gets the text in the right footer section of the IPageSetup object.
    Gets a IGraphic object that represents the picture for the right section of the footer.
    Gets the text in the right header section of the IPageSetup object.
    Gets a IGraphic object that represents the picture for the right section of the header.
    double
    Gets the size of the right margin, in points.
    boolean
    Gets whether the header and footer are scaled with the document when the document size changes.
    double
    Gets the size of the top margin, in points.
    int
    Gets a Variant value that represents a percentage (between 10 and 400 percent) by which Document Solutions for Excel will scale the worksheet for printing.
    void
    Sets whether the header and footer are aligned with the margins set in the page setup options.
    void
    setBestFitColumns(boolean value)
    Sets whether column widths are adjusted to fit the longest text width for printing.
    void
    setBestFitRows(boolean value)
    Sets whether row heights are adjusted to fit the tallest text height for printing.
    void
    setBlackAndWhite(boolean value)
    Sets whether elements of the document will be printed in black and white.
    void
    setBottomMargin(double value)
    Sets the size of the bottom margin, in points.
    void
    Sets the center footer text in the PageSetup object.
    void
    Sets the text in the center header section of the IPageSetup object.
    void
    setCenterHorizontally(boolean value)
    Sets whether the sheet is centered horizontally on the page when it's printed.
    void
    setCenterVertically(boolean value)
    Sets whether the sheet is centered vertically on the page when it's printed.
    void
    Sets whether a different header or footer is used on the first page.
    void
    setDraft(boolean value)
    Sets whether the sheet will be printed without graphics.
    void
    setFirstPageNumber(int value)
    Sets the first page number that will be used when this sheet is printed.
    void
    setFitToPagesTall(int value)
    Sets the number of pages tall the worksheet will be scaled to when it's printed.
    void
    setFitToPagesWide(int value)
    Sets the number of pages wide the worksheet will be scaled to when it's printed.
    void
    setFooterMargin(double value)
    Sets the size of the footer margin, in points.
    void
    setHeaderMargin(double value)
    Sets the size of the header margin, in points.
    void
    setIsAutoFirstPageNumber(boolean value)
    Sets whether the first page number is automatically assigned.
    void
    setIsPercentScale(boolean value)
    Sets whether the worksheet is scaled as a percentage.
    void
    Sets the text in the left footer section of the IPageSetup object.
    void
    Sets the alignment of text on the left header of a workbook or section.
    void
    setLeftMargin(double value)
    Sets the size of the left margin, in points.
    void
    Sets whether the specified PageSetup object has different headers and footers for odd-numbered and even-numbered pages.
    void
    setOrder(Order value)
    Sets a Order value that represents the order used to number pages when printing a large worksheet.
    void
    Sets a PageOrientation value that represents the portrait or landscape printing mode.
    void
    Sets the size of the paper.
    void
    Sets the range to be printed, as a string using A1-style references in the language of the macro.
    void
    Sets the way comments are printed with the sheet.
    void
    setPrintCopies(int value)
    Sets the number of copies to print.
    void
    Sets a PrintErrors constant specifying how print errors are displayed.
    void
    setPrintGridlines(boolean value)
    Sets whether cell gridlines are printed on the page.
    void
    setPrintHeadings(boolean value)
    Sets whether row and column headings are printed with this page.
    void
    setPrintNotes(boolean value)
    Sets whether cell notes are printed as end notes with the sheet.
    void
    Sets the range of pages to print, where page numbers or page ranges are separated by commas and counted from the beginning of the document.
    void
    Sets the PrintQuality value that represents the print quality of this page.
    void
    Sets the columns that contain the cells to be repeated on the right side of each page, as a string in A1-style notation in the language of the macro.
    void
    Sets the rows that contain the cells to be repeated on the bottom of each page, as a string in A1-style notation in the language of the macro.
    void
    Sets the columns that contain the cells to be repeated on the left side of each page, as a string in A1-style notation in the language of the macro.
    void
    Sets the rows that contain the cells to be repeated at the top of each page, as a string in A1-style notation in the language of the macro.
    void
    Sets the text in the right footer section of the IPageSetup object.
    void
    Sets the right part of the header.
    void
    setRightMargin(double value)
    Sets the size of the right margin, in points.
    void
    Sets whether the header and footer are scaled with the document when the document size changes.
    void
    setTopMargin(double value)
    Sets the size of the top margin, in points.
    void
    setZoom(int value)
    Sets a Variant value that represents a percentage (between 10 and 400 percent) by which Document Solutions for Excel will scale the worksheet for printing.
    Generates a JSON string from the page setup.
  • Method Details

    • getPrintQuality

      PrintQuality getPrintQuality()
      Gets a PrintQuality value that represents the print quality of this page. Default is 600 dpi.

      Use this property to determine the current page print resolution that will be applied when the worksheet is printed.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setPrintQuality(PrintQuality.Dpi144);
       PrintQuality printQuality = pageSetup.getPrintQuality();
       
      Returns:
      The PrintQuality value for this page. The default value is PrintQuality.Dpi600.
    • setPrintQuality

      void setPrintQuality(PrintQuality value)
      Sets the PrintQuality value that represents the print quality of this page.

      Default is 600 dpi.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setPrintQuality(PrintQuality.Dpi144);
       
      Parameters:
      value - The PrintQuality value that represents the print quality of this page.
    • getBlackAndWhite

      boolean getBlackAndWhite()
      Gets whether elements of the document will be printed in black and white.
      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setBlackAndWhite(true);
       boolean blackAndWhite = pageSetup.getBlackAndWhite();
       
      Returns:
      true if elements of the document will be printed in black and white; otherwise, false.
    • setBlackAndWhite

      void setBlackAndWhite(boolean value)
      Sets whether elements of the document will be printed in black and white.
      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setBlackAndWhite(true);
       
      Parameters:
      value - true if elements of the document will be printed in black and white; otherwise, false.
    • getLeftMargin

      double getLeftMargin()
      Gets the size of the left margin, in points.

      This value specifies the left page margin used for printing and can be configured with setLeftMargin(double).

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setLeftMargin(36);
       double leftMargin = pageSetup.getLeftMargin();
       
      Returns:
      The size of the left margin, in points.
    • setLeftMargin

      void setLeftMargin(double value)
      Sets the size of the left margin, in points.
      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setLeftMargin(36);
       
      Parameters:
      value - The size of the left margin, in points.
    • getRightMargin

      double getRightMargin()
      Gets the size of the right margin, in points.

      This value specifies the right page margin used for printing and can be configured with setRightMargin(double).

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setRightMargin(36);
       double rightMargin = pageSetup.getRightMargin();
       
      Returns:
      The size of the right margin, in points.
    • setRightMargin

      void setRightMargin(double value)
      Sets the size of the right margin, in points.
      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setRightMargin(36);
       
      Parameters:
      value - The size of the right margin, in points.
    • getTopMargin

      double getTopMargin()
      Gets the size of the top margin, in points.

      This value specifies the top page margin used for printing and can be configured with setTopMargin(double).

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setTopMargin(36);
       double topMargin = pageSetup.getTopMargin();
       
      Returns:
      The size of the top margin, in points.
    • setTopMargin

      void setTopMargin(double value)
      Sets the size of the top margin, in points.
      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setTopMargin(36);
       
      Parameters:
      value - The size of the top margin, in points.
    • getBottomMargin

      double getBottomMargin()
      Gets the size of the bottom margin, in points.

      This value specifies the bottom page margin used for printing and can be configured with setBottomMargin(double).

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setBottomMargin(36);
       double bottomMargin = pageSetup.getBottomMargin();
       
      Returns:
      The size of the bottom margin, in points.
    • setBottomMargin

      void setBottomMargin(double value)
      Sets the size of the bottom margin, in points.
      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setBottomMargin(36);
       
      Parameters:
      value - The size of the bottom margin, in points.
    • getHeaderMargin

      double getHeaderMargin()
      Gets the size of the header margin, in points.

      Use this method to retrieve the current header margin configured in the page setup for printing.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setHeaderMargin(18);
       double headerMargin = pageSetup.getHeaderMargin();
       
      Returns:
      The size of the header margin, in points.
    • setHeaderMargin

      void setHeaderMargin(double value)
      Sets the size of the header margin, in points.

      Use this method to set the header margin configured in the page setup for printing.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setHeaderMargin(18);
       
      Parameters:
      value - The size of the header margin, in points.
    • getFooterMargin

      double getFooterMargin()
      Gets the size of the footer margin, in points.

      Use this method to retrieve the current distance configured for the footer margin in the page setup.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setFooterMargin(93.6);
       double footerMargin = pageSetup.getFooterMargin();
       
      Returns:
      The size of the footer margin, in points.
    • setFooterMargin

      void setFooterMargin(double value)
      Sets the size of the footer margin, in points.

      Use this method to set the distance configured for the footer margin in the page setup.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setFooterMargin(93.6);
       
      Parameters:
      value - The size of the footer margin, in points.
    • getCenterFooter

      String getCenterFooter()
      Gets the text in the center footer section of the IPageSetup object.

      The returned string specifies the content printed in the center section of the footer. It can include header and footer codes such as page number placeholders.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setCenterFooter("Page &P of &N");
       String centerFooter = pageSetup.getCenterFooter();
       
      Returns:
      The text in the center footer section. Returns an empty string if no center footer text is set.
    • setCenterFooter

      void setCenterFooter(String value)
      Sets the center footer text in the PageSetup object.

      The returned string specifies the content printed in the center section of the footer. It can include header and footer codes such as page number placeholders that are supported by page setup footer text.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setCenterFooter("Page &P of &N");
       
      Parameters:
      value - The center footer text. Sets an empty string if no center footer text is set.
    • getCenterHeader

      String getCenterHeader()
      Gets the text in the center header section of the IPageSetup object.

      Use this property to retrieve the centered header content for the worksheet's page setup.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setCenterHeader("Quarterly Report");
       String centerHeader = pageSetup.getCenterHeader();
       
      Returns:
      The text in the center header section. Returns an empty string if no center header text is set.
    • setCenterHeader

      void setCenterHeader(String value)
      Sets the text in the center header section of the IPageSetup object.

      Use this property to set the centered header content for the worksheet's page setup.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setCenterHeader("Quarterly Report");
       
      Parameters:
      value - The text in the center header section. Sets an empty string if no center header text is set.
    • getLeftFooter

      String getLeftFooter()
      Gets the text in the left footer section of the IPageSetup object.

      The returned string represents the current left footer content configured in the page setup. It can include header and footer formatting codes.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setLeftFooter("&\"Arial,Italic\"Confidential");
       String leftFooter = pageSetup.getLeftFooter();
       
      Returns:
      The text in the left footer section. Returns an empty string if no left footer text is set.
    • setLeftFooter

      void setLeftFooter(String value)
      Sets the text in the left footer section of the IPageSetup object.

      Use this method to configure the left footer content for the worksheet's page setup. The value can include header and footer formatting codes, such as page-number placeholders or formatting instructions.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setLeftFooter("&\"Arial,Italic\"Confidential");
       
      Parameters:
      value - The text to set in the left footer section. Set an empty string if no left footer text is needed.
    • getLeftHeader

      String getLeftHeader()
      Gets the text in the left header section of the IPageSetup object.

      The returned string represents the current left header content configured in the page setup. It can include header text and any header codes that were set for printing.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setLeftHeader("&\"Arial,Italic\"Sales Report");
       String leftHeader = pageSetup.getLeftHeader();
       
      Returns:
      The text in the left header section. Returns an empty string if no left header text is set.
    • setLeftHeader

      void setLeftHeader(String value)
      Sets the alignment of text on the left header of a workbook or section.

      Sets the string configured for the left header when the worksheet is printed. The returned value can include header text and any header codes that were set for printing.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setLeftHeader("&\"Arial,Italic\"Sales Report");
       
      Parameters:
      value - The left header string for the page setup.
    • getRightFooter

      String getRightFooter()
      Gets the text in the right footer section of the IPageSetup object.

      The returned string represents the footer content configured for the right section of the page footer, including any supported header or footer formatting codes.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setRightFooter("&D");
       String rightFooter = pageSetup.getRightFooter();
       
      Returns:
      The text in the right footer section. Returns an empty string if no right footer text is set.
    • setRightFooter

      void setRightFooter(String value)
      Sets the text in the right footer section of the IPageSetup object.

      Use this method to configure the right footer content for the worksheet's page setup. The value can include header and footer formatting codes, such as page-number placeholders or formatting instructions.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setRightFooter("&D");
       
      Parameters:
      value - The text to set in the right footer section. Set an empty string if no right footer text is needed.
    • getRightHeader

      String getRightHeader()
      Gets the text in the right header section of the IPageSetup object.

      Use this method to retrieve the text displayed in the right section of the page header.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setRightHeader("Page &[Page]");
       String rightHeader = pageSetup.getRightHeader();
       
      Returns:
      The text in the right header section. Returns an empty string if no right header text is set.
    • setRightHeader

      void setRightHeader(String value)
      Sets the right part of the header.

      Sets the text displayed in the right section of the page header.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setRightHeader("Page &[Page]");
       
      Parameters:
      value - The text in the right section of the page header. Sets an empty string if the right header is not set.
    • getCenterHorizontally

      boolean getCenterHorizontally()
      Gets whether the sheet is centered horizontally on the page when it's printed.

      This property indicates whether the worksheet content is horizontally centered within the printable page area during printing.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setCenterHorizontally(true);
       boolean centerHorizontally = pageSetup.getCenterHorizontally();
       
      Returns:
      true if the sheet is centered horizontally on the page when printed; otherwise, false.
    • setCenterHorizontally

      void setCenterHorizontally(boolean value)
      Sets whether the sheet is centered horizontally on the page when it's printed.

      This property indicates whether the worksheet content is horizontally centered within the printable page area during printing.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setCenterHorizontally(true);
       
      Parameters:
      value - true if the sheet is centered horizontally on the page when printed; otherwise, false.
    • getCenterVertically

      boolean getCenterVertically()
      Gets whether the sheet is centered vertically on the page when it's printed.

      This property indicates whether the worksheet content is vertically centered within the printable page area during printing.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setCenterVertically(true);
       boolean centerVertically = pageSetup.getCenterVertically();
       
      Returns:
      true if the sheet is centered vertically on the printed page; otherwise, false.
    • setCenterVertically

      void setCenterVertically(boolean value)
      Sets whether the sheet is centered vertically on the page when it's printed.

      This property indicates whether the worksheet content is vertically centered within the printable page area during printing.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setCenterVertically(true);
       
      Parameters:
      value - true if the sheet is centered vertically on the printed page; otherwise, false.
    • getOddAndEvenPagesHeaderFooter

      boolean getOddAndEvenPagesHeaderFooter()
      Gets whether the specified PageSetup object has different headers and footers for odd-numbered and even-numbered pages.

      When this property is true, the worksheet can use separate header and footer settings for even pages, such as those exposed through getEvenPage().

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setOddAndEvenPagesHeaderFooter(true);
       boolean oddAndEvenPagesHeaderFooter = pageSetup.getOddAndEvenPagesHeaderFooter();
       
      Returns:
      true if different headers and footers are used for odd-numbered and even-numbered pages; otherwise, false.
    • setOddAndEvenPagesHeaderFooter

      void setOddAndEvenPagesHeaderFooter(boolean value)
      Sets whether the specified PageSetup object has different headers and footers for odd-numbered and even-numbered pages.

      When this property is true, the worksheet can use separate header and footer settings for even pages, such as those exposed through getEvenPage().

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setOddAndEvenPagesHeaderFooter(true);
       
      Parameters:
      value - true if different headers and footers are used for odd-numbered and even-numbered pages; otherwise, false.
    • getDifferentFirstPageHeaderFooter

      boolean getDifferentFirstPageHeaderFooter()
      Gets whether a different header or footer is used on the first page.

      When this property is true, the first page can use its own header and footer settings instead of the default page header and footer. Use setDifferentFirstPageHeaderFooter(boolean) to enable this behavior before configuring the first page through getFirstPage().

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setDifferentFirstPageHeaderFooter(true);
       pageSetup.getFirstPage().getCenterHeader().setText("Cover Page");
       boolean differentFirstPageHeaderFooter = pageSetup.getDifferentFirstPageHeaderFooter();
       
      Returns:
      true if a different header or footer is used on the first page; otherwise, false.
    • setDifferentFirstPageHeaderFooter

      void setDifferentFirstPageHeaderFooter(boolean value)
      Sets whether a different header or footer is used on the first page.
      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setDifferentFirstPageHeaderFooter(true);
       pageSetup.getFirstPage().getCenterHeader().setText("Cover Page");
       
      Parameters:
      value - true if a different header or footer is used on the first page; otherwise, false.
    • getScaleWithDocHeaderFooter

      boolean getScaleWithDocHeaderFooter()
      Gets whether the header and footer are scaled with the document when the document size changes.

      This setting affects whether header and footer content follows the document scaling applied during printing.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setScaleWithDocHeaderFooter(true);
       boolean scaleWithDocHeaderFooter = pageSetup.getScaleWithDocHeaderFooter();
       
      Returns:
      true if the header and footer are scaled with the document when the document size changes; otherwise, false.
    • setScaleWithDocHeaderFooter

      void setScaleWithDocHeaderFooter(boolean value)
      Sets whether the header and footer are scaled with the document when the document size changes.

      This setting affects whether header and footer content follows the document scaling applied during printing.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setScaleWithDocHeaderFooter(true);
       
      Parameters:
      value - true if the header and footer are scaled with the document when the document size changes; otherwise, false.
    • getAlignMarginsHeaderFooter

      boolean getAlignMarginsHeaderFooter()
      Gets whether the header and footer are aligned with the margins set in the page setup options.

      When this property is true, the header and footer use the page margins defined in the current IPageSetup settings for alignment when the worksheet is printed.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setAlignMarginsHeaderFooter(true);
       boolean alignMarginsHeaderFooter = pageSetup.getAlignMarginsHeaderFooter();
       
      Returns:
      true if the header and footer are aligned with the margins set in the page setup options; otherwise, false.
    • setAlignMarginsHeaderFooter

      void setAlignMarginsHeaderFooter(boolean value)
      Sets whether the header and footer are aligned with the margins set in the page setup options.

      When this property is true, the header and footer use the page margins defined in the current IPageSetup settings for alignment when the worksheet is printed.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setAlignMarginsHeaderFooter(true);
       
      Parameters:
      value - true if the header and footer are aligned with the margins set in the page setup options; otherwise, false.
    • getDraft

      boolean getDraft()
      Gets whether the sheet will be printed without graphics.

      When this property returns true, the worksheet is printed in draft mode.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setDraft(true);
       boolean draft = pageSetup.getDraft();
       
      Returns:
      true if the sheet is printed without graphics; otherwise, false.
    • setDraft

      void setDraft(boolean value)
      Sets whether the sheet will be printed without graphics.

      When this property Sets true, the worksheet is printed in draft mode.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setDraft(true);
       
      Parameters:
      value - true if the sheet is printed without graphics; otherwise, false.
    • getFirstPageNumber

      int getFirstPageNumber()
      Gets the first page number that will be used when this sheet is printed.

      If Automatic, Document Solutions for Excel chooses the first page number. The default is Automatic.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setIsAutoFirstPageNumber(false);
       pageSetup.setFirstPageNumber(3);
       int firstPageNumber = pageSetup.getFirstPageNumber();
       
      Returns:
      The first page number to use when this sheet is printed. If automatic page numbering is enabled, Document Solutions for Excel chooses the first page number.
    • setFirstPageNumber

      void setFirstPageNumber(int value)
      Sets the first page number that will be used when this sheet is printed.

      If Automatic, Document Solutions for Excel chooses the first page number. The default is Automatic.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setIsAutoFirstPageNumber(false);
       pageSetup.setFirstPageNumber(3);
       
      Parameters:
      value - The first page number to use when this sheet is printed. If automatic page numbering is enabled, Document Solutions for Excel chooses the first page number.
    • getIsAutoFirstPageNumber

      boolean getIsAutoFirstPageNumber()
      Gets whether the first page number is automatically assigned.

      The default value is true. When the first page number is specified, this method returns false.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setFirstPageNumber(3);
       boolean isAutoFirstPageNumber = pageSetup.getIsAutoFirstPageNumber();
       
      Returns:
      true if the first page number is assigned automatically; false if a specific first page number has been specified.
    • setIsAutoFirstPageNumber

      void setIsAutoFirstPageNumber(boolean value)
      Sets whether the first page number is automatically assigned.

      The default value is true. When the first page number is specified, this method Sets false.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setFirstPageNumber(3);
       pageSetup.setIsAutoFirstPageNumber(true);
       
      Parameters:
      value - true if the first page number is assigned automatically; false if a specific first page number has been specified.
    • getFitToPagesTall

      int getFitToPagesTall()
      Gets the number of pages tall the worksheet will be scaled to when it's printed. Applies only to worksheets.

      This setting is used when worksheet scaling is controlled by setIsPercentScale(boolean) instead of a zoom percentage.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setIsPercentScale(false);
       pageSetup.setFitToPagesTall(2);
       int pagesTall = pageSetup.getFitToPagesTall();
       
      Returns:
      The number of pages tall the worksheet will be scaled to when printed.
    • setFitToPagesTall

      void setFitToPagesTall(int value)
      Sets the number of pages tall the worksheet will be scaled to when it's printed. Applies only to worksheets.

      This setting is used when worksheet scaling is controlled by setIsPercentScale(boolean) instead of a zoom percentage.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setIsPercentScale(false);
       pageSetup.setFitToPagesTall(2);
       
      Parameters:
      value - The number of pages tall the worksheet will be scaled to when printed.
    • getFitToPagesWide

      int getFitToPagesWide()
      Gets the number of pages wide the worksheet will be scaled to when it's printed. Applies only to worksheets.

      This value specifies the maximum number of pages for horizontal pagination. When getIsPercentScale() returns false, the worksheet uses getFitToPagesWide() together with getFitToPagesTall() to control fit-to-page scaling.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setIsPercentScale(false);
       pageSetup.setFitToPagesWide(3);
       int pagesWide = pageSetup.getFitToPagesWide();
       
      Returns:
      The number of pages wide the worksheet will be scaled to when printed.
    • setFitToPagesWide

      void setFitToPagesWide(int value)
      Sets the number of pages wide the worksheet will be scaled to when it's printed. Applies only to worksheets.

      This value specifies the maximum number of pages for horizontal pagination. When getIsPercentScale() Sets false, the worksheet uses getFitToPagesWide() together with getFitToPagesTall() to control fit-to-page scaling.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setIsPercentScale(false);
       pageSetup.setFitToPagesWide(3);
       
      Parameters:
      value - The number of pages wide the worksheet will be scaled to when printed.
    • getIsPercentScale

      boolean getIsPercentScale()
      Gets whether the worksheet is scaled as a percentage.

      If this property is true, the worksheet uses percentage-based scaling. If this property is false, the getFitToPagesWide() and getFitToPagesTall() settings control how the worksheet is scaled.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setIsPercentScale(true);
       boolean isPercentScale = pageSetup.getIsPercentScale();
       
      Returns:
      true if the worksheet is scaled as a percentage; false if getFitToPagesWide() and getFitToPagesTall() control how the worksheet is scaled.
    • setIsPercentScale

      void setIsPercentScale(boolean value)
      Sets whether the worksheet is scaled as a percentage.

      If this property is true, the worksheet uses percentage-based scaling. If this property is false, the getFitToPagesWide() and getFitToPagesTall() settings control how the worksheet is scaled.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setIsPercentScale(true);
       
      Parameters:
      value - If this property is true, the worksheet is scaled as a percentage; getFitToPagesWide() and getFitToPagesTall() control how the worksheet is scaled.
    • getOrder

      Order getOrder()
      Gets a Order value that represents the order used to number pages when printing a large worksheet.

      This property determines whether pages are numbered down the rows before moving across columns, or across columns before moving down the rows.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setOrder(Order.OverThenDown);
       Order order = pageSetup.getOrder();
       
      Returns:
      The page numbering order for printing a large worksheet. Returns Order.DownThenOver when the page order is not explicitly set.
    • setOrder

      void setOrder(Order value)
      Sets a Order value that represents the order used to number pages when printing a large worksheet.

      Use this method to control whether pages are numbered down the rows first or across the columns first when the worksheet spans multiple printed pages.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setOrder(Order.OverThenDown);
       
      Parameters:
      value - The page numbering order to use when printing a large worksheet.
    • getOrientation

      PageOrientation getOrientation()
      Gets a PageOrientation value that represents the portrait or landscape printing mode.

      Use this method to retrieve the current page orientation configured for the worksheet's page setup.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setOrientation(PageOrientation.Landscape);
       PageOrientation orientation = pageSetup.getOrientation();
       
      Returns:
      A PageOrientation value that represents the portrait or landscape printing mode.
    • setOrientation

      void setOrientation(PageOrientation value)
      Sets a PageOrientation value that represents the portrait or landscape printing mode.

      Use this method to control how the worksheet page is oriented when it is printed or exported to paginated formats.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setOrientation(PageOrientation.Landscape);
       
      Parameters:
      value - The page orientation to apply.
    • getPaperSize

      PaperSize getPaperSize()
      Gets the size of the paper.

      Use this method to retrieve the current PaperSize setting that is used for page setup when the worksheet is printed.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setPaperSize(PaperSize.A4);
       PaperSize paperSize = pageSetup.getPaperSize();
       
      Returns:
      The current paper size setting.
    • setPaperSize

      void setPaperSize(PaperSize value)
      Sets the size of the paper.

      Use this method to select a built-in PaperSize for printing or page layout. To define a custom size in inches, use customPaperSize(double,double) instead.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setPaperSize(PaperSize.A4);
       
      Parameters:
      value - The built-in paper size to use.
    • customPaperSize

      void customPaperSize(double width, double height)
      Sets the custom paper size, in unit of inches.

      This method applies a user-defined paper size for the page setup. After calling this method, getPaperWidth() and getPaperHeight() return the specified custom dimensions.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.customPaperSize(8.5, 13);
       double paperWidth = pageSetup.getPaperWidth();
       double paperHeight = pageSetup.getPaperHeight();
       
      Parameters:
      width - The paper width, in inches. Must be greater than 0.
      height - The paper height, in inches. Must be greater than 0.
      Throws:
      RuntimeException - if width or height is less than or equal to 0.
    • getPaperWidth

      double getPaperWidth()
      Gets the width in inches of the paper, considered page orientation.

      If a custom paper size is set by customPaperSize(double,double), this method returns the configured paper width.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.customPaperSize(8.5, 13);
       double paperWidth = pageSetup.getPaperWidth();
       
      Returns:
      The paper width, in inches, based on the current page orientation.
    • getPaperHeight

      double getPaperHeight()
      Gets the height in inches of the paper, considering page orientation.

      If a custom paper size is set by customPaperSize(double,double), this method returns the configured paper height.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.customPaperSize(8.5, 13);
       double paperHeight = pageSetup.getPaperHeight();
       
      Returns:
      The paper height, in inches, considering the current page orientation.
    • getPrintGridlines

      boolean getPrintGridlines()
      Gets whether cell gridlines are printed on the page. Applies only to worksheets.

      Use this method to determine whether worksheet gridlines are included in printed output.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setPrintGridlines(true);
       boolean printGridlines = pageSetup.getPrintGridlines();
       
      Returns:
      true if cell gridlines are printed on the page; otherwise, false.
    • setPrintGridlines

      void setPrintGridlines(boolean value)
      Sets whether cell gridlines are printed on the page. Applies only to worksheets.

      Use this method to set whether worksheet gridlines are included in printed output.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setPrintGridlines(true);
       
      Parameters:
      value - true if cell gridlines are printed on the page; otherwise, false.
    • getPrintHeadings

      boolean getPrintHeadings()
      Gets whether row and column headings are printed with this page.

      Applies only to worksheets.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setPrintHeadings(true);
       boolean printHeadings = pageSetup.getPrintHeadings();
       
      Returns:
      true if row and column headings are printed with the page; otherwise, false.
    • setPrintHeadings

      void setPrintHeadings(boolean value)
      Sets whether row and column headings are printed with this page.

      Applies only to worksheets.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setPrintHeadings(true);
       
      Parameters:
      value - true if row and column headings are printed with the page; otherwise, false.
    • getPrintNotes

      boolean getPrintNotes()
      Gets whether cell notes are printed as end notes with the sheet. Applies only to worksheets.
      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setPrintNotes(true);
       boolean printNotes = pageSetup.getPrintNotes();
       
      Returns:
      true if cell notes are printed as end notes with the sheet; otherwise, false.
    • setPrintNotes

      void setPrintNotes(boolean value)
      Sets whether cell notes are printed as end notes with the sheet. Applies only to worksheets.
      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setPrintNotes(true);
       
      Parameters:
      value - true if cell notes are printed as end notes with the sheet; otherwise, false.
    • getPrintArea

      String getPrintArea()
      Gets the range to be printed, as a string using A1-style references in the language of the macro.

      If the print area is not specified, the used range of the worksheet is printed by default.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setPrintArea("$A$1:$C$10");
       String printArea = pageSetup.getPrintArea();
       
      Returns:
      The print area as an A1-style reference string in the language of the macro.
    • setPrintArea

      void setPrintArea(String value)
      Sets the range to be printed, as a string using A1-style references in the language of the macro.

      If the print area is not specified, the used range of the worksheet is printed by default.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setPrintArea("$A$1:$C$10");
       
      Parameters:
      value - The print area as an A1-style reference string in the language of the macro.
    • getPrintTitleColumns

      String getPrintTitleColumns()
      Gets the columns that contain the cells to be repeated on the left side of each page, as a string in A1-style notation in the language of the macro.

      Use setPrintTitleColumns(String) to define the repeated columns for printed pages.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setPrintTitleColumns("$A:$B");
       String printTitleColumns = pageSetup.getPrintTitleColumns();
       
      Returns:
      A string in A1-style notation that specifies the print title columns.
    • setPrintTitleColumns

      void setPrintTitleColumns(String value)
      Sets the columns that contain the cells to be repeated on the left side of each page, as a string in A1-style notation in the language of the macro.
      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setPrintTitleColumns("$A:$B");
       
      Parameters:
      value - A string in A1-style notation that specifies the print title columns.
    • getPrintTitleRows

      String getPrintTitleRows()
      Gets the rows that contain the cells to be repeated at the top of each page, as a string in A1-style notation in the language of the macro.

      Use this method to retrieve the current repeating row setting for the worksheet page setup.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setPrintTitleRows("$1:$2");
       String printTitleRows = pageSetup.getPrintTitleRows();
       
      Returns:
      The rows to repeat at the top of each page, expressed as an A1-style row reference string in the language of the macro.
    • setPrintTitleRows

      void setPrintTitleRows(String value)
      Sets the rows that contain the cells to be repeated at the top of each page, as a string in A1-style notation in the language of the macro.

      Use this method to set the repeating row setting for the worksheet page setup.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setPrintTitleRows("$1:$2");
       
      Parameters:
      value - The rows to repeat at the top of each page, expressed as an A1-style row reference string in the language of the macro.
    • getPrintTailColumns

      String getPrintTailColumns()
      Gets the columns that contain the cells to be repeated on the right side of each page, as a string in A1-style notation in the language of the macro.

      Use this property to read the current right-side repeating column setting for the worksheet page setup.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setPrintTailColumns("$I:$J");
       String printTailColumns = pageSetup.getPrintTailColumns();
       
      Returns:
      A string that specifies the columns to repeat on the right side of each page in A1-style notation.
    • setPrintTailColumns

      void setPrintTailColumns(String value)
      Sets the columns that contain the cells to be repeated on the right side of each page, as a string in A1-style notation in the language of the macro.

      Use this property to set the right-side repeating column setting for the worksheet page setup.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setPrintTailColumns("$I:$J");
       
      Parameters:
      value - A string that specifies the columns to repeat on the right side of each page in A1-style notation.
    • getPrintTailRows

      String getPrintTailRows()
      Gets the rows that contain the cells to be repeated on the bottom of each page, as a string in A1-style notation in the language of the macro.

      Use this method to retrieve the bottom repeating rows configured for the worksheet page setup.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setPrintTailRows("$50:$50");
       String printTailRows = pageSetup.getPrintTailRows();
       
      Returns:
      A string that specifies the bottom repeating rows in A1-style notation in the language of the macro.
    • setPrintTailRows

      void setPrintTailRows(String value)
      Sets the rows that contain the cells to be repeated on the bottom of each page, as a string in A1-style notation in the language of the macro.

      Use this method to set the bottom repeating rows configured for the worksheet page setup.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setPrintTailRows("$50:$50");
       
      Parameters:
      value - A string that specifies the bottom repeating rows in A1-style notation in the language of the macro.
    • getPrintCopies

      int getPrintCopies()
      Gets the number of copies to print.

      Returns the print copies setting for the worksheet page setup. If no page setup has been created, this method returns 1.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setPrintCopies(3);
       int printCopies = pageSetup.getPrintCopies();
       
      Returns:
      The number of copies to print. Returns 1 if no page setup has been created.
    • setPrintCopies

      void setPrintCopies(int value)
      Sets the number of copies to print.

      Sets the print copies setting for the worksheet page setup. If no page setup has been created, this method Sets 1.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setPrintCopies(3);
       
      Parameters:
      value - The number of copies to print. Sets 1 if no page setup has been created.
    • getPrintPageRange

      String getPrintPageRange()
      Gets the range of pages to print, where page numbers or page ranges are separated by commas and counted from the beginning of the document.

      Use this property to retrieve the page-range string that controls which pages are included in the print operation. For example, "1,3,5-12" prints page 1, page 3, and pages 5 through 12.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setPrintPageRange("1,3-5");
       String printPageRange = pageSetup.getPrintPageRange();
       
      Returns:
      The print page range string.
    • setPrintPageRange

      void setPrintPageRange(String value)
      Sets the range of pages to print, where page numbers or page ranges are separated by commas and counted from the beginning of the document.

      Use this property to set the page-range string that controls which pages are included in the print operation.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setPrintPageRange("1,3-5");
       
      Parameters:
      value - The print page range string.
    • getZoom

      int getZoom()
      Gets a Variant value that represents a percentage (between 10 and 400 percent) by which Document Solutions for Excel will scale the worksheet for printing.

      This property is used when the worksheet is scaled as a percentage. If getIsPercentScale() returns false, scaling is controlled by getFitToPagesWide() and getFitToPagesTall() instead.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setIsPercentScale(true);
       pageSetup.setZoom(125);
       int zoom = pageSetup.getZoom();
       
      Returns:
      The print scaling percentage, from 10 to 400.
    • setZoom

      void setZoom(int value)
      Sets a Variant value that represents a percentage (between 10 and 400 percent) by which Document Solutions for Excel will scale the worksheet for printing.

      This property is used when the worksheet is scaled as a percentage. If getIsPercentScale() Sets false, scaling is controlled by getFitToPagesWide() and getFitToPagesTall() instead.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setIsPercentScale(true);
       pageSetup.setZoom(125);
       
      Parameters:
      value - The print scaling percentage, from 10 to 400.
    • getPrintComments

      PrintLocation getPrintComments()
      Gets the way comments are printed with the sheet.

      Use this property to determine whether comments are not printed, printed as end notes, or printed in place on the worksheet. If the page setup has not been initialized, this method returns PrintLocation.NoComments.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setPrintComments(PrintLocation.SheetEnd);
       PrintLocation printComments = pageSetup.getPrintComments();
       
      Returns:
      A PrintLocation value that indicates how comments are printed with the sheet.
    • setPrintComments

      void setPrintComments(PrintLocation value)
      Sets the way comments are printed with the sheet.

      Use this method to control whether worksheet comments are printed in place, printed as end notes, or omitted when the worksheet is printed.

      
       IRange cell = worksheet.getRange("A1");
       cell.addComment("Check the total before printing.");
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setPrintComments(PrintLocation.SheetEnd);
       
      Parameters:
      value - The print location to apply to worksheet comments when printing. Must be a valid PrintLocation value; null is not supported.
    • getPrintErrors

      PrintErrors getPrintErrors()
      Gets a PrintErrors constant specifying how cell error values are displayed when the worksheet is printed.

      This setting can be used to suppress the display of error values during printing, for example by showing blanks, dashes, or #N/A instead of the original error values.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setPrintErrors(PrintErrors.Dash);
       PrintErrors printErrors = pageSetup.getPrintErrors();
       
      Returns:
      A PrintErrors value that specifies how print errors are displayed. Returns PrintErrors.Displayed if no explicit page setup has been created.
    • setPrintErrors

      void setPrintErrors(PrintErrors value)
      Sets a PrintErrors constant specifying how print errors are displayed.

      This feature allows users to suppress the display of error values when printing a worksheet.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setPrintErrors(PrintErrors.Dash);
       
      Parameters:
      value - The print error display mode.
    • getCenterHeaderPicture

      IGraphic getCenterHeaderPicture()
      Gets a IGraphic object that represents the picture for the center section of the header. Used to set attributes about the picture.

      Use the returned IGraphic object to set attributes of the picture, such as the image source or size.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       IGraphic picture = pageSetup.getCenterHeaderPicture();
       picture.setFilename(java.nio.file.Paths.get("Users", "DefaultApps", "Documents", "logo.png").toString());
       picture.setWidth(36);
       
      Returns:
      The IGraphic object that represents the picture for the center section of the header.
    • getCenterFooterPicture

      IGraphic getCenterFooterPicture()
      Gets a IGraphic object that represents the picture for the center section of the footer. Used to set attributes about the picture.

      Use the returned IGraphic object to set attributes of the picture, such as the image source or size.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       IGraphic picture = pageSetup.getCenterFooterPicture();
       picture.setFilename(java.nio.file.Paths.get("Users", "DefaultApps", "Documents", "logo.png").toString());
       picture.setWidth(36);
       
      Returns:
      The IGraphic object that represents the picture for the center section of the footer.
    • getLeftHeaderPicture

      IGraphic getLeftHeaderPicture()
      Gets a IGraphic object that represents the picture for the left section of the header. Used to set attributes about the picture.

      Use the returned IGraphic object to set attributes of the picture, such as the image source or size.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       IGraphic picture = pageSetup.getLeftHeaderPicture();
       picture.setFilename(java.nio.file.Paths.get("Users", "DefaultApps", "Documents", "logo.png").toString());
       picture.setWidth(36);
       
      Returns:
      The IGraphic object that represents the picture for the left section of the header.
    • getLeftFooterPicture

      IGraphic getLeftFooterPicture()
      Gets a IGraphic object that represents the picture for the left section of the footer. Used to set attributes about the picture.

      Use the returned IGraphic object to set attributes of the picture, such as the image source or size.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       IGraphic picture = pageSetup.getLeftFooterPicture();
       picture.setFilename(java.nio.file.Paths.get("Users", "DefaultApps", "Documents", "logo.png").toString());
       picture.setWidth(36);
       
      Returns:
      The IGraphic object that represents the picture for the left section of the footer.
    • getRightHeaderPicture

      IGraphic getRightHeaderPicture()
      Gets a IGraphic object that represents the picture for the right section of the header. Used to set attributes of the picture.

      Use the returned IGraphic object to set attributes of the picture, such as the image source or size.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       IGraphic picture = pageSetup.getRightHeaderPicture();
       picture.setFilename(java.nio.file.Paths.get("Users", "DefaultApps", "Documents", "logo.png").toString());
       picture.setWidth(36);
       
      Returns:
      The IGraphic object that represents the picture for the right section of the header.
    • getRightFooterPicture

      IGraphic getRightFooterPicture()
      Gets a IGraphic object that represents the picture for the right section of the footer.

      Use the returned IGraphic object to set attributes of the picture, such as the image source or size.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       IGraphic picture = pageSetup.getRightFooterPicture();
       picture.setFilename(java.nio.file.Paths.get("Users", "DefaultApps", "Documents", "logo.png").toString());
       picture.setWidth(36);
       
      Returns:
      The IGraphic object that represents the picture for the right section of the footer.
    • getEvenPage

      IPage getEvenPage()
      Gets the alignment of text on the even IPage of a workbook or section.

      Use the returned IPage object to configure headers and footers for even pages when odd and even page headers and footers are enabled.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setOddAndEvenPagesHeaderFooter(true);
       IPage evenPage = pageSetup.getEvenPage();
       evenPage.getCenterHeader().setText("Even Page");
       
      Returns:
      The IPage object that represents the even page header and footer settings.
    • getFirstPage

      IPage getFirstPage()
      Gets the alignment of text on the first IPage of a workbook or section.

      Use the returned IPage object to configure headers and footers for the first page when a different first page header and footer is enabled.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setDifferentFirstPageHeaderFooter(true);
       IPage firstPage = pageSetup.getFirstPage();
       firstPage.getCenterHeader().setText("Cover Page");
       
      Returns:
      The IPage object that represents the first page header and footer settings.
    • getBestFitColumns

      boolean getBestFitColumns()
      Gets whether column widths are adjusted to fit the longest text width for printing.

      When this property is true, the worksheet uses best-fit column widths during printing.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setBestFitColumns(true);
       boolean bestFitColumns = pageSetup.getBestFitColumns();
       
      Returns:
      true if column widths are adjusted to fit the longest text width for printing; otherwise, false.
    • setBestFitColumns

      void setBestFitColumns(boolean value)
      Sets whether column widths are adjusted to fit the longest text width for printing.

      When this property is true, the worksheet uses best-fit column widths during printing.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setBestFitColumns(true);
       
      Parameters:
      value - true if column widths are adjusted to fit the longest text width for printing; otherwise, false.
    • getBestFitRows

      boolean getBestFitRows()
      Gets whether row heights are adjusted to fit the tallest text height for printing.

      When this property is true, the page setup automatically adjusts row heights to accommodate the tallest text when the worksheet is printed.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setBestFitRows(true);
       boolean bestFitRows = pageSetup.getBestFitRows();
       
      Returns:
      true if row heights are adjusted to fit the tallest text height for printing; otherwise, false.
    • setBestFitRows

      void setBestFitRows(boolean value)
      Sets whether row heights are adjusted to fit the tallest text height for printing.

      When this property is true, the page setup automatically adjusts row heights to accommodate the tallest text when the worksheet is printed.

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setBestFitRows(true);
       
      Parameters:
      value - true if row heights are adjusted to fit the tallest text height for printing; otherwise, false.
    • fromJson

      void fromJson(String json)
      Generates the page setup from the specified JSON string.

      Use this method to apply page setup settings from serialized JSON data, such as JSON produced by toJson().

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       String json = "{\"bestFitRows\":true,\"bestFitColumns\":true,"
           + "\"margin\":{\"top\":36,\"bottom\":36,\"left\":30,\"right\":30}}";
       pageSetup.fromJson(json);
       
      Parameters:
      json - The JSON string representing the page setup.
    • toJson

      String toJson()
      Generates a JSON string from the page setup.

      Use this method to serialize the current page setup settings to JSON so that they can be stored or later applied by using fromJson(String).

      
       IPageSetup pageSetup = worksheet.getPageSetup();
       pageSetup.setBlackAndWhite(true);
       pageSetup.setLeftHeader("Quarterly Report");
       String json = pageSetup.toJson();
       
      Returns:
      The JSON string representing the page setup.