PdfViewerPreferences Class
The viewer preferences of a document (/ViewerPreferences, ISO 32000-2, 12.2): how viewers show the document and the settings of their print dialog. The dictionary is created when a value is set, and removed when its last entry is.
public sealed class PdfViewerPreferencesProperties
| Name | Description |
|---|---|
| CenterWindow | Gets or sets a value indicating whether viewers center their window on the screen (/CenterWindow). |
| Dictionary | Gets the viewer preferences dictionary of the catalog, or null when the document has none. |
| Direction | Gets or sets the reading order of the text (/Direction), which sets how viewers lay out pages side by side. |
| DisablePrintScaling | Gets or sets a value indicating whether the print dialog prints the pages at their size, without scaling them to the paper (/PrintScaling /None). |
| DisplayDocumentTitle | Gets or sets a value indicating whether viewers show the title of the document in their title bar instead of the name of the file (/DisplayDocTitle), which PDF/UA requires. |
| Duplex | Gets or sets how the print dialog prints the pages on the sides of the sheets (/Duplex). |
| EnforcedPreferences | Gets the names of the preferences viewers must not let the user override (/Enforce, PDF 2.0), such as PrintScaling. |
| FitWindow | Gets or sets a value indicating whether viewers resize their window to the first page (/FitWindow). |
| HideMenubar | Gets or sets a value indicating whether viewers hide their menu bar (/HideMenubar). |
| HideToolbar | Gets or sets a value indicating whether viewers hide their toolbars (/HideToolbar). |
| HideWindowUI | Gets or sets a value indicating whether viewers hide the elements of their window, such as the scroll bars, to show only the pages (/HideWindowUI). |
| NonFullScreenPageMode | Gets or sets what viewers show when they leave full-screen mode (/NonFullScreenPageMode), when PdfDocument.PageMode is PdfPageMode.FullScreen. The default is PdfPageMode.UseNone. |
| NumberOfCopies | Gets or sets the number of copies the print dialog selects (/NumCopies), from 1 to 5; null to let the print dialog choose. |
| PickTrayByPdfSize | Gets or sets whether the print dialog picks the paper tray from the size of the pages (/PickTrayByPDFSize), or null when the document does not say. |
| PrintPageRanges | Gets or sets the pages the print dialog selects (/PrintPageRange): ranges of zero-based page indexes, both ends included; an empty list for all the pages. |
CenterWindow
PdfViewerPreferences.csDictionary
PdfViewerPreferences.csGets the viewer preferences dictionary of the catalog, or null when the document has none.
public PdfDictionary? Dictionary { get; }Property value
Direction
PdfViewerPreferences.csGets or sets the reading order of the text (/Direction), which sets how viewers lay out pages side by side.
public PdfReadingDirection Direction { get; set; }Property value
DisablePrintScaling
PdfViewerPreferences.csDisplayDocumentTitle
PdfViewerPreferences.csDuplex
PdfViewerPreferences.csGets or sets how the print dialog prints the pages on the sides of the sheets (/Duplex).
public PdfDuplexMode Duplex { get; set; }Property value
EnforcedPreferences
PdfViewerPreferences.csGets the names of the preferences viewers must not let the user override (/Enforce, PDF 2.0), such as PrintScaling.
public IReadOnlyList<string> EnforcedPreferences { get; }Property value
FitWindow
PdfViewerPreferences.csHideMenubar
PdfViewerPreferences.csHideToolbar
PdfViewerPreferences.csHideWindowUI
PdfViewerPreferences.csNonFullScreenPageMode
PdfViewerPreferences.csGets or sets what viewers show when they leave full-screen mode (/NonFullScreenPageMode), when PdfDocument.PageMode is PdfPageMode.FullScreen. The default is PdfPageMode.UseNone.
public PdfPageMode NonFullScreenPageMode { get; set; }Property value
Exceptions
NumberOfCopies
PdfViewerPreferences.csGets or sets the number of copies the print dialog selects (/NumCopies), from 1 to 5; null to let the print dialog choose.
public int? NumberOfCopies { get; set; }PickTrayByPdfSize
PdfViewerPreferences.csPrintPageRanges
PdfViewerPreferences.csGets or sets the pages the print dialog selects (/PrintPageRange): ranges of zero-based page indexes, both ends included; an empty list for all the pages.
public IReadOnlyList<(int First, int Last)> PrintPageRanges { get; set; }Property value
IReadOnlyList<(int First, int Last)>
Exceptions
ArgumentException- A range is negative or reversed.