com.lowagie.text.pdf.internal

Class PdfViewerPreferencesImp

public class PdfViewerPreferencesImp extends Object implements PdfViewerPreferences

Stores the information concerning viewer preferences, and contains the business logic that allows you to set viewer preferences.
Field Summary
static PdfName[]DIRECTION_PREFERENCES
A series of viewer preferences.
static PdfName[]DUPLEX_PREFERENCES
A series of viewer preferences.
static PdfName[]NONFULLSCREENPAGEMODE_PREFERENCES
A series of viewer preferences.
intpageLayoutAndMode
This value will hold the viewer preferences for the page layout and page mode.
static PdfName[]PAGE_BOUNDARIES
A series of viewer preferences.
static PdfName[]PRINTSCALING_PREFERENCES
A series of viewer preferences
PdfDictionaryviewerPreferences
This dictionary holds the viewer preferences (other than page layout and page mode).
static intviewerPreferencesMask
The mask to decide if a ViewerPreferences dictionary is needed
static PdfName[]VIEWER_PREFERENCES
Method Summary
voidaddToCatalog(PdfDictionary catalog)
Adds the viewer preferences defined in the preferences parameter to a PdfDictionary (more specifically the root or catalog of a PDF file).
voidaddViewerPreference(PdfName key, PdfObject value)
Sets the viewer preferences for printing.
intgetIndex(PdfName key)
Given a key for a viewer preference (a PdfName object), this method returns the index in the VIEWER_PREFERENCES array.
intgetPageLayoutAndMode()
Returns the page layout and page mode value.
PdfDictionarygetViewerPreferences()
Returns the viewer preferences.
static PdfViewerPreferencesImpgetViewerPreferences(PdfDictionary catalog)
booleanisPossibleValue(PdfName value, PdfName[] accepted)
Checks if some value is valid for a certain key.
voidsetViewerPreferences(int preferences)
Sets the viewer preferences as the sum of several constants.

Field Detail

DIRECTION_PREFERENCES

public static final PdfName[] DIRECTION_PREFERENCES
A series of viewer preferences.

DUPLEX_PREFERENCES

public static final PdfName[] DUPLEX_PREFERENCES
A series of viewer preferences.

NONFULLSCREENPAGEMODE_PREFERENCES

public static final PdfName[] NONFULLSCREENPAGEMODE_PREFERENCES
A series of viewer preferences.

pageLayoutAndMode

private int pageLayoutAndMode
This value will hold the viewer preferences for the page layout and page mode.

PAGE_BOUNDARIES

public static final PdfName[] PAGE_BOUNDARIES
A series of viewer preferences.

PRINTSCALING_PREFERENCES

public static final PdfName[] PRINTSCALING_PREFERENCES
A series of viewer preferences

viewerPreferences

private PdfDictionary viewerPreferences
This dictionary holds the viewer preferences (other than page layout and page mode).

viewerPreferencesMask

private static final int viewerPreferencesMask
The mask to decide if a ViewerPreferences dictionary is needed

VIEWER_PREFERENCES

public static final PdfName[] VIEWER_PREFERENCES

Method Detail

addToCatalog

public void 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).

Parameters: catalog

addViewerPreference

public void addViewerPreference(PdfName key, PdfObject value)
Sets the viewer preferences for printing.

getIndex

private int getIndex(PdfName key)
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

getPageLayoutAndMode

public int getPageLayoutAndMode()
Returns the page layout and page mode value.

getViewerPreferences

public PdfDictionary getViewerPreferences()
Returns the viewer preferences.

getViewerPreferences

public static PdfViewerPreferencesImp getViewerPreferences(PdfDictionary catalog)

isPossibleValue

private boolean isPossibleValue(PdfName value, PdfName[] accepted)
Checks if some value is valid for a certain key.

setViewerPreferences

public void setViewerPreferences(int preferences)
Sets the viewer preferences as the sum of several constants.

Parameters: preferences the viewer preferences

See Also: PdfViewerPreferences