Class PdfViewerPreferences

java.lang.Object
com.itextpdf.kernel.pdf.PdfObjectWrapper<PdfDictionary>
com.itextpdf.kernel.pdf.PdfViewerPreferences

public class PdfViewerPreferences extends PdfObjectWrapper<PdfDictionary>
  • Constructor Details

    • PdfViewerPreferences

      public PdfViewerPreferences()
    • PdfViewerPreferences

      public PdfViewerPreferences (PdfDictionary pdfObject)
  • Method Details

    • setHideToolbar

      public PdfViewerPreferences setHideToolbar (boolean hideToolbar)
      This method sets HideToolBar flag to true or false
      Parameters:
      hideToolbar - HideToolBar flag's boolean value
      Returns:
      current instance of PdfViewerPreferences
    • setHideMenubar

      public PdfViewerPreferences setHideMenubar (boolean hideMenubar)
      This method sets HideMenuBar flag to true or false
      Parameters:
      hideMenubar - HideMenuBar flag's boolean value
      Returns:
      current instance of PdfViewerPreferences
    • setHideWindowUI

      public PdfViewerPreferences setHideWindowUI (boolean hideWindowUI)
      This method sets HideWindowUI flag to true or false
      Parameters:
      hideWindowUI - HideWindowUI flag's boolean value
      Returns:
      current instance of PdfViewerPreferences
    • setFitWindow

      public PdfViewerPreferences setFitWindow (boolean fitWindow)
      This method sets FitWindow flag to true or false
      Parameters:
      fitWindow - FitWindow flag's boolean value
      Returns:
      current instance of PdfViewerPreferences
    • setCenterWindow

      public PdfViewerPreferences setCenterWindow (boolean centerWindow)
      This method sets CenterWindow flag to true or false
      Parameters:
      centerWindow - CenterWindow flag's boolean value
      Returns:
      current instance of PdfViewerPreferences
    • setDisplayDocTitle

      public PdfViewerPreferences setDisplayDocTitle (boolean displayDocTitle)
      This method sets DisplayDocTitle flag to true or false
      Parameters:
      displayDocTitle - DisplayDocTitle flag's boolean value
      Returns:
      current instance of PdfViewerPreferences
    • setNonFullScreenPageMode

      public PdfViewerPreferences setNonFullScreenPageMode (PdfViewerPreferences.PdfViewerPreferencesConstants nonFullScreenPageMode)
      This method sets NonFullScreenPageMode property. Allowed values are UseNone, UseOutlines, useThumbs, UseOC. This entry is meaningful only if the value of the PageMode entry in the Catalog dictionary is FullScreen
      Parameters:
      nonFullScreenPageMode - NonFullScreenPageMode property type value
      Returns:
      current instance of PdfViewerPreferences
    • setDirection

      This method sets predominant reading order of text.
      Parameters:
      direction - reading order type value
      Returns:
      current instance of PdfViewerPreferences
    • setViewArea

      This method sets the name of the page boundary representing the area of a page that shall be displayed when viewing the document on the screen. Deprecated in PDF 2.0.
      Parameters:
      pageBoundary - page boundary type value
      Returns:
      current instance of PdfViewerPreferences
    • setViewClip

      This method sets the name of the page boundary to which the contents of a page shall be clipped when viewing the document on the screen. Deprecated in PDF 2.0.
      Parameters:
      pageBoundary - page boundary type value
      Returns:
      current instance of PdfViewerPreferences
    • setPrintArea

      This method sets the name of the page boundary representing the area of a page that shall be rendered when printing the document. Deprecated in PDF 2.0.
      Parameters:
      pageBoundary - page boundary type value
      Returns:
      current instance of PdfViewerPreferences
    • setPrintClip

      This method sets the name of the page boundary to which the contents of a page shall be clipped when printing the document. Deprecated in PDF 2.0.
      Parameters:
      pageBoundary - page boundary type value
      Returns:
      current instance of PdfViewerPreferences
    • setPrintScaling

      This method sets the page scaling option that shall be selected when a print dialog is displayed for this document. Valid values are None and AppDefault.
      Parameters:
      printScaling - page scaling option's type value
      Returns:
      current instance of PdfViewerPreferences
    • setDuplex

      This method sets the paper handling option that shall be used when printing the file from the print dialog. The following values are valid: Simplex, DuplexFlipShortEdge, DuplexFlipLongEdge.
      Parameters:
      duplex - paper handling option's type value
      Returns:
      current instance of PdfViewerPreferences
    • setPickTrayByPDFSize

      public PdfViewerPreferences setPickTrayByPDFSize (boolean pickTrayByPdfSize)
      This method sets PickTrayByPDFSize flag to true or false.
      Parameters:
      pickTrayByPdfSize - PickTrayByPDFSize flag's boolean value
      Returns:
      current instance of PdfViewerPreferences
    • setPrintPageRange

      public PdfViewerPreferences setPrintPageRange (int[] printPageRange)
      This method sets the page numbers used to initialize the print dialog box when the file is printed.
      Parameters:
      printPageRange - the array of page numbers
      Returns:
      current instance of PdfViewerPreferences
    • setNumCopies

      public PdfViewerPreferences setNumCopies (int numCopies)
      This method sets the number of copies that shall be printed when the print dialog is opened for this file.
      Parameters:
      numCopies - the number of copies to print when the print dialog is opened
      Returns:
      current instance of PdfViewerPreferences
    • setEnforce

      public PdfViewerPreferences setEnforce (PdfArray enforce)
      PDF 2.0. Sets an array of names of Viewer preference settings that shall be enforced by PDF processors and that shall not be overridden by subsequent selections in the application user interface
      Parameters:
      enforce - array of names specifying settings to enforce in the PDF processors
      Returns:
      this PdfViewerPreferences instance
    • getEnforce

      public PdfArray getEnforce()
      PDF 2.0. Gets an array of names of Viewer preference settings that shall be enforced by PDF processors and that shall not be overridden by subsequent selections in the application user interface
      Returns:
      array of names specifying settings to enforce in the PDF processors
    • put

      public PdfViewerPreferences put (PdfName key, PdfObject value)
    • isWrappedObjectMustBeIndirect

      protected boolean isWrappedObjectMustBeIndirect()
      Description copied from class: PdfObjectWrapper
      Defines if the object behind this wrapper must be an indirect object in the resultant document.

      If this method returns true it doesn't necessarily mean that object must be in the indirect state at any moment, but rather defines that when the object will be written to the document it will be transformed into indirect object if it's not indirect yet.

      Return value of this method shouldn't depend on any logic, it should return always true or false.
      Specified by:
      isWrappedObjectMustBeIndirect in class PdfObjectWrapper<PdfDictionary>
      Returns:
      true if in the resultant document the object behind the wrapper must be indirect, otherwise false.