Package com.itextpdf.kernel.pdf
Class PdfViewerPreferences
- java.lang.Object
-
- com.itextpdf.kernel.pdf.PdfObjectWrapper<PdfDictionary>
-
- com.itextpdf.kernel.pdf.PdfViewerPreferences
-
public class PdfViewerPreferences extends PdfObjectWrapper<PdfDictionary>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PdfViewerPreferences.PdfViewerPreferencesConstants
-
Constructor Summary
Constructors Constructor Description PdfViewerPreferences()
PdfViewerPreferences(PdfDictionary pdfObject)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PdfArray
getEnforce()
PDF 2.0.protected boolean
isWrappedObjectMustBeIndirect()
Defines if the object behind this wrapper must be an indirect object in the resultant document.PdfViewerPreferences
put(PdfName key, PdfObject value)
PdfViewerPreferences
setCenterWindow(boolean centerWindow)
This method sets CenterWindow flag to true or falsePdfViewerPreferences
setDirection(PdfViewerPreferences.PdfViewerPreferencesConstants direction)
This method sets predominant reading order of text.PdfViewerPreferences
setDisplayDocTitle(boolean displayDocTitle)
This method sets DisplayDocTitle flag to true or falsePdfViewerPreferences
setDuplex(PdfViewerPreferences.PdfViewerPreferencesConstants duplex)
This method sets the paper handling option that shall be used when printing the file from the print dialog.PdfViewerPreferences
setEnforce(PdfArray enforce)
PDF 2.0.PdfViewerPreferences
setFitWindow(boolean fitWindow)
This method sets FitWindow flag to true or falsePdfViewerPreferences
setHideMenubar(boolean hideMenubar)
This method sets HideMenuBar flag to true or falsePdfViewerPreferences
setHideToolbar(boolean hideToolbar)
This method sets HideToolBar flag to true or falsePdfViewerPreferences
setHideWindowUI(boolean hideWindowUI)
This method sets HideWindowUI flag to true or falsePdfViewerPreferences
setNonFullScreenPageMode(PdfViewerPreferences.PdfViewerPreferencesConstants nonFullScreenPageMode)
This method sets NonFullScreenPageMode property.PdfViewerPreferences
setNumCopies(int numCopies)
This method sets the number of copies that shall be printed when the print dialog is opened for this file.private PdfViewerPreferences
setPageBoundary(PdfViewerPreferences.PdfViewerPreferencesConstants viewerPreferenceType, PdfViewerPreferences.PdfViewerPreferencesConstants pageBoundary)
PdfViewerPreferences
setPickTrayByPDFSize(boolean pickTrayByPdfSize)
This method sets PickTrayByPDFSize flag to true or false.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.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.PdfViewerPreferences
setPrintPageRange(int[] printPageRange)
This method sets the page numbers used to initialize the print dialog box when the file is printed.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.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.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.-
Methods inherited from class com.itextpdf.kernel.pdf.PdfObjectWrapper
ensureObjectIsAddedToDocument, ensureUnderlyingObjectHasIndirectReference, flush, getPdfObject, isFlushed, makeIndirect, makeIndirect, markObjectAsIndirect, setForbidRelease, setModified, setPdfObject, unsetForbidRelease
-
-
-
-
Constructor Detail
-
PdfViewerPreferences
public PdfViewerPreferences()
-
PdfViewerPreferences
public PdfViewerPreferences(PdfDictionary pdfObject)
-
-
Method Detail
-
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
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
public PdfViewerPreferences setDuplex(PdfViewerPreferences.PdfViewerPreferencesConstants duplex)
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 classPdfObjectWrapper<PdfDictionary>
- Returns:
- true if in the resultant document the object behind the wrapper must be indirect, otherwise false.
-
setPageBoundary
private PdfViewerPreferences setPageBoundary(PdfViewerPreferences.PdfViewerPreferencesConstants viewerPreferenceType, PdfViewerPreferences.PdfViewerPreferencesConstants pageBoundary)
-
-