Package com.itextpdf.kernel.pdf
Class PdfViewerPreferences
java.lang.Object
com.itextpdf.kernel.pdf.PdfObjectWrapper<PdfDictionary>
com.itextpdf.kernel.pdf.PdfViewerPreferences
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionPDF 2.0.protected boolean
Defines if the object behind this wrapper must be an indirect object in the resultant document.setCenterWindow
(boolean centerWindow) This method sets CenterWindow flag to true or falseThis method sets predominant reading order of text.setDisplayDocTitle
(boolean displayDocTitle) This method sets DisplayDocTitle flag to true or falseThis method sets the paper handling option that shall be used when printing the file from the print dialog.setEnforce
(PdfArray enforce) PDF 2.0.setFitWindow
(boolean fitWindow) This method sets FitWindow flag to true or falsesetHideMenubar
(boolean hideMenubar) This method sets HideMenuBar flag to true or falsesetHideToolbar
(boolean hideToolbar) This method sets HideToolBar flag to true or falsesetHideWindowUI
(boolean hideWindowUI) This method sets HideWindowUI flag to true or falsesetNonFullScreenPageMode
(PdfViewerPreferences.PdfViewerPreferencesConstants nonFullScreenPageMode) This method sets NonFullScreenPageMode property.setNumCopies
(int numCopies) This method sets the number of copies that shall be printed when the print dialog is opened for this file.setPickTrayByPDFSize
(boolean pickTrayByPdfSize) This method sets PickTrayByPDFSize flag to true or false.This method sets the name of the page boundary representing the area of a page that shall be rendered when printing the document.This method sets the name of the page boundary to which the contents of a page shall be clipped when printing the document.setPrintPageRange
(int[] printPageRange) This method sets the page numbers used to initialize the print dialog box when the file is printed.This method sets the page scaling option that shall be selected when a print dialog is displayed for this document.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.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.Methods inherited from class com.itextpdf.kernel.pdf.PdfObjectWrapper
ensureObjectIsAddedToDocument, ensureUnderlyingObjectHasIndirectReference, flush, getPdfObject, isFlushed, makeIndirect, makeIndirect, markObjectAsIndirect, setForbidRelease, setModified, setPdfObject, unsetForbidRelease
-
Constructor Details
-
PdfViewerPreferences
public PdfViewerPreferences() -
PdfViewerPreferences
-
-
Method Details
-
setHideToolbar
This method sets HideToolBar flag to true or false- Parameters:
-
hideToolbar
- HideToolBar flag's boolean value - Returns:
-
current instance of
PdfViewerPreferences
-
setHideMenubar
This method sets HideMenuBar flag to true or false- Parameters:
-
hideMenubar
- HideMenuBar flag's boolean value - Returns:
-
current instance of
PdfViewerPreferences
-
setHideWindowUI
This method sets HideWindowUI flag to true or false- Parameters:
-
hideWindowUI
- HideWindowUI flag's boolean value - Returns:
-
current instance of
PdfViewerPreferences
-
setFitWindow
This method sets FitWindow flag to true or false- Parameters:
-
fitWindow
- FitWindow flag's boolean value - Returns:
-
current instance of
PdfViewerPreferences
-
setCenterWindow
This method sets CenterWindow flag to true or false- Parameters:
-
centerWindow
- CenterWindow flag's boolean value - Returns:
-
current instance of
PdfViewerPreferences
-
setDisplayDocTitle
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
public PdfViewerPreferences setDirection(PdfViewerPreferences.PdfViewerPreferencesConstants direction) This method sets predominant reading order of text.- Parameters:
-
direction
- reading order type value - Returns:
-
current instance of
PdfViewerPreferences
-
setViewArea
public PdfViewerPreferences setViewArea(PdfViewerPreferences.PdfViewerPreferencesConstants pageBoundary) 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
public PdfViewerPreferences setViewClip(PdfViewerPreferences.PdfViewerPreferencesConstants pageBoundary) 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
public PdfViewerPreferences setPrintArea(PdfViewerPreferences.PdfViewerPreferencesConstants pageBoundary) 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
public PdfViewerPreferences setPrintClip(PdfViewerPreferences.PdfViewerPreferencesConstants pageBoundary) 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
public PdfViewerPreferences setPrintScaling(PdfViewerPreferences.PdfViewerPreferencesConstants printScaling) 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
This method sets PickTrayByPDFSize flag to true or false.- Parameters:
-
pickTrayByPdfSize
- PickTrayByPDFSize flag's boolean value - Returns:
-
current instance of
PdfViewerPreferences
-
setPrintPageRange
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
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
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
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
-
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 classPdfObjectWrapper<PdfDictionary>
- Returns:
- true if in the resultant document the object behind the wrapper must be indirect, otherwise false.
-