ViewerPreferences
Represents the viewer preferences for a document.
public class ViewerPreferences
Public Class ViewerPreferences
Inheritance: ObjectViewerPreferences
Licensing Info
This class is a DynamicPDF Core Suite Essentials feature. One of the following is required for non-evaluation usage:
- Any active DynamicPDF Subscription (Essentials, Professional, Professional Plus or Ultimate).
- A DynamicPDF Core Suite for .NET v12.X Essentials license.
- It can also be used for free with a public link back to www.dynamicpdf.com and with the DynamicPDF Essentials message displaying on the bottom of each page.
Examples
This example shows how to change the viewer preferences associated with a document.Imports System
Imports ceTe.DynamicPDF
Module MyModule
Sub Main()
' Create a PDF Document
Dim MyDocument As Document = New Document
' Create a Page and add it to the document
MyDocument.Pages.Add(New Page(PageSize.Letter))
' Set the viewer preferences
MyDocument.ViewerPreferences.CenterWindow = True
MyDocument.ViewerPreferences.DisplayDocTitle = False
MyDocument.ViewerPreferences.HideMenubar = True
MyDocument.ViewerPreferences.HideToolbar = True
MyDocument.ViewerPreferences.HideWindowUI = True
MyDocument.ViewerPreferences.FitWindow = True
MyDocument.ViewerPreferences.NoPrintScaling = True
' Save the PDF document
MyDocument.Draw("C:\MyDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
public class Example
{
public static void CreatePDF(string outputPath)
{
// Create a PDF Document
Document document = new Document();
// Create a page and add it to the document
document.Pages.Add(new Page(PageSize.Letter));
// Set the viewer preferences
document.ViewerPreferences.CenterWindow = true;
document.ViewerPreferences.DisplayDocTitle = false;
document.ViewerPreferences.HideMenubar = true;
document.ViewerPreferences.HideToolbar = true;
document.ViewerPreferences.HideWindowUI = true;
document.ViewerPreferences.FitWindow = true;
document.ViewerPreferences.NoPrintScaling = true;
// Save the PDF document
document.Draw(outputPath);
}
}
Properties
CenterWindow | A flag specifying whether to position the document?s window in the center of the screen. |
DisplayDocTitle | A flag specifying whether the window?s title bar should display the document title taken from the Title entry of the document of the PDF file containing the document. |
Duplex | Specifies the default duplex printing mode for the document. |
FitWindow | A flag specifying whether to resize the document?s window to fit the size of the first displayed page. |
HideMenubar | A flag specifying whether to hide the viewer application?s menu bar when the document is active. |
HideToolbar | A flag specifying whether to hide the viewer application?s tool bars when the document is active. |
HideWindowUI | A flag specifying whether to hide user interface elements in the document?s window (such as scroll bars and navigation controls), leaving only the document?s contents displayed. |
NonFullScreenPageMode | Specifies the page mode when the documents page mode is set to full screen. |
NoPrintScaling | A flag specifying if scaling should be used when printing the document. |
NumberOfCopies | Specifies the default number of copies to be printed. |
PickTrayByPdfSize | Specifies if the printing tray should be picked based on the size of the PDF document. |
PrintArea | Specifies the print area for the document. |
PrintClip | Specifies the print clip area for the document. |
PrintPageRange | Specifies the default page ranges to be used for printing. |
RightToLeft | A flag specifying if right to left text is predominately used by this document. |
ViewArea | Specifies the view area for the document. |
ViewClip | Specifies the view clip area for the document. |
Methods
Draw(DocumentWriter) | Draws the encrypter viewer preferences dictionary to the given DocumentWriter object. |
Equals(Object) | Determines whether the specified Object is equal to the current Object . (Inherited from Object) |
GetHashCode() | Serves as a hash function for a particular type. (Inherited from Object) |
GetType() | Gets the Type of the current instance. (Inherited from Object) |
ToString() | Returns a String that represents the current Object . (Inherited from Object) |