Viewer preferences
editSet the viewer preferences
document.PageLayout = PdfPageLayout.TwoPageRight;
document.PageMode = PdfPageMode.UseOutlines;
var preferences = document.ViewerPreferences;
preferences.DisplayDocumentTitle = true;
preferences.HideToolbar = true;
preferences.Direction = PdfReadingDirection.RightToLeft;
preferences.DisablePrintScaling = true;
preferences.Duplex = PdfDuplexMode.DuplexFlipLongEdge;
preferences.PrintPageRanges = [(0, 0), (2, 4)];
preferences.NumberOfCopies = 2;| Property | Effect |
|---|---|
| PdfDocument.PageLayout | One page at a time, one column, or two pages side by side |
| PdfDocument.PageMode | The panel next to the pages: the bookmarks, the thumbnails, the layers, the attachments, or full screen |
| HideToolbar, HideMenubar, HideWindowUI | Hide the elements of the viewer |
| FitWindow, CenterWindow | Resize the window to the first page, center it |
| DisplayDocumentTitle | Show the title of the document instead of the file name, which PDF/UA requires |
| Direction | The reading order, which sets the side of the pages shown side by side |
| DisablePrintScaling, Duplex, PrintPageRanges, NumberOfCopies | The settings of the print dialog |
- The page ranges are zero-based page indexes, both ends included; the file stores page numbers.
- The dictionary is created when a value is set, and removed when the last one is reset.
- EnforcedPreferences lists the preferences viewers must not let the user override.
- Viewers may ignore any of these preferences.