[]
        
(Showing Draft Content)

PageInfo

Class PageInfo

java.lang.Object
com.grapecity.documents.excel.PageInfo

public class PageInfo extends Object
Represents information about a printed page.

A PageInfo object stores the page metadata used during pagination and printing, including the page number, total page count, page content, and page settings. It is typically produced or consumed by PrintManager when working with paginated worksheet content.


 PageInfo pageInfo = new PageInfo();
 pageInfo.setPageNumber(1);
 pageInfo.setPageCount(3);
 pageInfo.setPageSettings(new PageSettings());
 
  • Constructor Details

    • PageInfo

      public PageInfo()
  • Method Details

    • getPageNumber

      public final int getPageNumber()
      Gets the page number.

      Returns the page number stored in this PageInfo instance.

      
       PageInfo pageInfo = new PageInfo();
       pageInfo.setPageNumber(2);
       int pageNumber = pageInfo.getPageNumber();
       
      Returns:
      The page number.
    • setPageNumber

      public final void setPageNumber(int value)
      Sets the page number.

      Sets the page number stored in this PageInfo instance.

      
       PageInfo pageInfo = new PageInfo();
       pageInfo.setPageNumber(2);
       
      Parameters:
      value - The page number.
    • getPageCount

      public final int getPageCount()
      Gets the total number of pages.

      This value represents the total page count stored in the current PageInfo instance.

      
       PageInfo pageInfo = new PageInfo();
       pageInfo.setPageCount(3);
       int pageCount = pageInfo.getPageCount();
       
      Returns:
      The total number of pages.
    • setPageCount

      public final void setPageCount(int value)
      Sets the total number of pages.

      This value represents the total page count stored in the current PageInfo instance.

      
       PageInfo pageInfo = new PageInfo();
       pageInfo.setPageCount(3);
       
      Parameters:
      value - The total number of pages.
    • getPageContent

      public final PageContentInfo getPageContent()
      Gets the page content information for this printed page.

      The returned PageContentInfo describes the worksheet content that belongs to the page during pagination and printing, such as the printed range, repeated title or tail rows and columns, header visibility, and zoom factor.

      
       PageInfo pageInfo = new PageInfo();
       PageContentInfo pageContent = new PageContentInfo();
       pageContent.setRange(worksheet.getRange("A1:C5"));
       pageInfo.setPageContent(pageContent);
       PageContentInfo content = pageInfo.getPageContent();
       
      Returns:
      The PageContentInfo for this page. Returns null if no page content has been assigned.
    • setPageContent

      public final void setPageContent(PageContentInfo value)
      Sets the page content information.

      Use this method to assign the PageContentInfo that defines the data area and related print content settings for the page, such as the printed range, title rows, title columns, and header visibility. A value of null removes the current page content information.

      
       PageInfo pageInfo = new PageInfo();
       PageContentInfo pageContent = new PageContentInfo();
       pageContent.setRange(worksheet.getRange("A1:C10"));
       pageInfo.setPageContent(pageContent);
       
      Parameters:
      value - The page content information to assign to the page; may be null.
    • getPageSettings

      public final PageSettings getPageSettings()
      Gets the settings of the page which will be used when this page is printed.

      This method returns the PageSettings instance currently associated with this PageInfo. If no page settings have been assigned, this method returns null.

      
       PageInfo pageInfo = new PageInfo();
       PageSettings pageSettings = new PageSettings();
       pageInfo.setPageSettings(pageSettings);
       PageSettings settings = pageInfo.getPageSettings();
       
      Returns:
      The page settings used for printing this page, or null if no page settings have been set.
    • setPageSettings

      public final void setPageSettings(PageSettings value)
      Sets the settings of the page which will be used when this page is printed.

      Use this method to assign a PageSettings instance that defines page-level printing settings such as paper size, margins, headers, and footers for this PageInfo.

      
       PageInfo pageInfo = new PageInfo();
       PageSettings pageSettings = new PageSettings();
       pageSettings.setCenterHeader("Budget summary report");
       pageInfo.setPageSettings(pageSettings);
       
      Parameters:
      value - The page settings to assign to this page; may be null to clear the page settings.