Package com.lowagie.text.pdf.internal
Class PdfViewerPreferencesImp
java.lang.Object
com.lowagie.text.pdf.internal.PdfViewerPreferencesImp
- All Implemented Interfaces:
PdfViewerPreferences
Stores the information concerning viewer preferences, and contains the business logic that allows you to set viewer
preferences.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PdfName[]
A series of viewer preferences.static final PdfName[]
A series of viewer preferences.static final PdfName[]
A series of viewer preferences.static final PdfName[]
A series of viewer preferences.private int
This value will hold the viewer preferences for the page layout and page mode.static final PdfName[]
A series of viewer preferencesstatic final PdfName[]
private PdfDictionary
This dictionary holds the viewer preferences (other than page layout and page mode).private static final int
The mask to decide if a ViewerPreferences dictionary is needed -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addToCatalog
(PdfDictionary catalog) Adds the viewer preferences defined in the preferences parameter to a PdfDictionary (more specifically the root or catalog of a PDF file).void
addViewerPreference
(PdfName key, PdfObject value) Sets the viewer preferences for printing.private int
Given a key for a viewer preference (a PdfName object), this method returns the index in the VIEWER_PREFERENCES array.int
Returns the page layout and page mode value.Returns the viewer preferences.static PdfViewerPreferencesImp
getViewerPreferences
(PdfDictionary catalog) private boolean
isPossibleValue
(PdfName value, PdfName[] accepted) Checks if some value is valid for a certain key.void
setViewerPreferences
(int preferences) Sets the viewer preferences as the sum of several constants.
-
Field Details
-
VIEWER_PREFERENCES
-
NONFULLSCREENPAGEMODE_PREFERENCES
A series of viewer preferences. -
DIRECTION_PREFERENCES
A series of viewer preferences. -
PAGE_BOUNDARIES
A series of viewer preferences. -
PRINTSCALING_PREFERENCES
A series of viewer preferences -
DUPLEX_PREFERENCES
A series of viewer preferences. -
viewerPreferencesMask
private static final int viewerPreferencesMaskThe mask to decide if a ViewerPreferences dictionary is needed- See Also:
-
pageLayoutAndMode
private int pageLayoutAndModeThis value will hold the viewer preferences for the page layout and page mode. -
viewerPreferences
This dictionary holds the viewer preferences (other than page layout and page mode).
-
-
Constructor Details
-
PdfViewerPreferencesImp
public PdfViewerPreferencesImp()
-
-
Method Details
-
getViewerPreferences
-
getPageLayoutAndMode
public int getPageLayoutAndMode()Returns the page layout and page mode value.- Returns:
- an int that hold the viewer preferences for the page layout and page mode.
-
getViewerPreferences
Returns the viewer preferences.- Returns:
- a PdfDictionary containing the viewer's preferences.
-
setViewerPreferences
public void setViewerPreferences(int preferences) Sets the viewer preferences as the sum of several constants.- Specified by:
setViewerPreferences
in interfacePdfViewerPreferences
- Parameters:
preferences
- the viewer preferences- See Also:
-
getIndex
Given a key for a viewer preference (a PdfName object), this method returns the index in the VIEWER_PREFERENCES array.- Parameters:
key
- a PdfName referring to a viewer preference- Returns:
- an index in the VIEWER_PREFERENCES array
-
isPossibleValue
Checks if some value is valid for a certain key. -
addViewerPreference
Sets the viewer preferences for printing.- Specified by:
addViewerPreference
in interfacePdfViewerPreferences
- Parameters:
key
- the name of the viewer preferencevalue
- the value of the viewer preference- See Also:
-
addToCatalog
Adds the viewer preferences defined in the preferences parameter to a PdfDictionary (more specifically the root or catalog of a PDF file).- Parameters:
catalog
- The PdfDictionary to add the viewer preferences to
-