Class ViewerPreferencesUtils

java.lang.Object
org.sejda.impl.sambox.util.ViewerPreferencesUtils

public final class ViewerPreferencesUtils extends Object
Utility methods related to the viewer preferences functionalities.
Author:
Andrea Vacondio
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.sejda.sambox.pdmodel.interactive.viewerpreferences.PDViewerPreferences.READING_DIRECTION
    Mapping between Sejda and PDFBox direction constants.
    static org.sejda.sambox.pdmodel.interactive.viewerpreferences.PDViewerPreferences.DUPLEX
    Mapping between Sejda and PDFBox duplex constants
    static org.sejda.sambox.pdmodel.interactive.viewerpreferences.PDViewerPreferences.NON_FULL_SCREEN_PAGE_MODE
    Mapping between Sejda and PDFBox non full screen mode constants
    static org.sejda.sambox.pdmodel.PageLayout
    Mapping between Sejda and PDFBox page layout constants.
    static org.sejda.sambox.pdmodel.PageMode
    Mapping between Sejda and PDFBox page mode constants.
    static org.sejda.sambox.pdmodel.interactive.viewerpreferences.PDViewerPreferences.PRINT_SCALING
    Mapping between Sejda and PDFBox print scaling constants
    static void
    setBooleanPreferences(org.sejda.sambox.pdmodel.interactive.viewerpreferences.PDViewerPreferences preferences, Set<PdfBooleanPreference> enabled)
    Enables the given set of boolean preferences on the given preferences instance and disables the others.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getNFSMode

      public static org.sejda.sambox.pdmodel.interactive.viewerpreferences.PDViewerPreferences.NON_FULL_SCREEN_PAGE_MODE getNFSMode(PdfNonFullScreenPageMode nfsMode)
      Mapping between Sejda and PDFBox non full screen mode constants
      Parameters:
      nfsMode -
      Returns:
      the PDFBox non full screen mode constant.
    • getPageMode

      public static org.sejda.sambox.pdmodel.PageMode getPageMode(PdfPageMode mode)
      Mapping between Sejda and PDFBox page mode constants.
      Parameters:
      mode -
      Returns:
      the PDFBox page mode String constant.
    • getPageLayout

      public static org.sejda.sambox.pdmodel.PageLayout getPageLayout(PdfPageLayout layout)
      Mapping between Sejda and PDFBox page layout constants.
      Parameters:
      layout -
      Returns:
      the PDFBox page layout String constant.
    • getDirection

      public static org.sejda.sambox.pdmodel.interactive.viewerpreferences.PDViewerPreferences.READING_DIRECTION getDirection(PdfDirection direction)
      Mapping between Sejda and PDFBox direction constants.
      Parameters:
      direction -
      Returns:
      the PDFBox direction constant
    • getDuplex

      public static org.sejda.sambox.pdmodel.interactive.viewerpreferences.PDViewerPreferences.DUPLEX getDuplex(PdfDuplex duplex)
      Mapping between Sejda and PDFBox duplex constants
      Parameters:
      duplex -
      Returns:
      the PDFBox duplex constant
    • getPrintScaling

      public static org.sejda.sambox.pdmodel.interactive.viewerpreferences.PDViewerPreferences.PRINT_SCALING getPrintScaling(PdfPrintScaling scaling)
      Mapping between Sejda and PDFBox print scaling constants
      Parameters:
      scaling -
      Returns:
      the PDFBox print scaling constant
    • setBooleanPreferences

      public static void setBooleanPreferences(org.sejda.sambox.pdmodel.interactive.viewerpreferences.PDViewerPreferences preferences, Set<PdfBooleanPreference> enabled) throws TaskException
      Enables the given set of boolean preferences on the given preferences instance and disables the others.
      Parameters:
      preferences -
      enabled -
      Throws:
      TaskException - if the given preferences instance is null.