Class SheetSelectorFactory

java.lang.Object
com.itextpdf.pdfoffice.SheetSelectorFactory

public final class SheetSelectorFactory extends Object
Factory class for creating SheetSelector instances.
  • Method Details

    • createAllSheetsSelector

      public static SheetSelector createAllSheetsSelector()
      Creates SheetSelector instance with all sheets selected.

      Resulting sheet order will be the same as in the original spreadsheet document.

      Returns:
      new SheetSelector instance, with all sheets selected
    • createActiveSheetSelector

      public static SheetSelector createActiveSheetSelector()
      Creates SheetSelector instance with active sheet selected.
      Returns:
      new SheetSelector instance, with active sheet selected
    • createSheetsSelector

      public static SheetSelector createSheetsSelector (Set<String> sheetNames)
      Creates SheetSelector instance with specified sheet names selected.

      Resulting sheet order will be the same as in the original spreadsheet document. All sheet names are case-insensitive, i.e. if there is a "Test" sheet in the spreadsheet, then any of "test", "Test", "TEST" etc. will work for selection.

      Duplicate sheets will be printed only once regardless of how much times a sheet name is passed.

      Parameters:
      sheetNames - sheet names to select
      Returns:
      new SheetSelector instance, with specified sheet names selected