cete.dynamicpdf.viewerpreferences
ViewerPreferences
- Namespace: ceTe.DynamicPDF
- Assemblies: DynamicPDF.NETFramework40.dll, DynamicPDF.NETStandard20.dll
Represents the viewer preferences for a document.
public class ViewerPreferences
Public Class ViewerPreferences
Inheritance: Object → ViewerPreferences
Licensing
This class is a DynamicPDF Generator Community Edition feature.
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.
public bool CenterWindow { get; set; }
Public Property CenterWindow As Boolean
Property Value
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.
public bool DisplayDocTitle { get; set; }
Public Property DisplayDocTitle As Boolean
Property Value
Remarks
This does not affect the title bar of most web browsers. The title bar in most web browsers will display the file's URL and ignore this setting.
Duplex
Specifies the default duplex printing mode for the document.
public Duplex Duplex { get; set; }
Public Property Duplex As Duplex
Property Value
Remarks
NOTE: This feature is only recognized by Acrobat 8 or greater.
FitWindow
A flag specifying whether to resize the document�s window to fit the size of the first displayed page.
public bool FitWindow { get; set; }
Public Property FitWindow As Boolean
Property Value
HideMenubar
A flag specifying whether to hide the viewer application�s menu bar when the document is active.
public bool HideMenubar { get; set; }
Public Property HideMenubar As Boolean
Property Value
HideToolbar
A flag specifying whether to hide the viewer application�s tool bars when the document is active.
public bool HideToolbar { get; set; }
Public Property HideToolbar As Boolean
Property Value
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.
public bool HideWindowUI { get; set; }
Public Property HideWindowUI As Boolean
Property Value
NonFullScreenPageMode
Specifies the page mode when the documents page mode is set to full screen.
public NonFullScreenPageMode NonFullScreenPageMode { get; set; }
Public Property NonFullScreenPageMode As NonFullScreenPageMode
Property Value
Remarks
This value is ignored if the documents page mode is not set to full screen.
NoPrintScaling
A flag specifying if scaling should be used when printing the document.
public bool NoPrintScaling { get; set; }
Public Property NoPrintScaling As Boolean
Property Value
NumberOfCopies
Specifies the default number of copies to be printed.
public int NumberOfCopies { get; set; }
Public Property NumberOfCopies As Int32
Property Value
Remarks
NOTE: This feature is only recognized by Acrobat 8 or greater.
PickTrayByPdfSize
Specifies if the printing tray should be picked based on the size of the PDF document.
public PickTrayByPdfSize PickTrayByPdfSize { get; set; }
Public Property PickTrayByPdfSize As PickTrayByPdfSize
Property Value
Remarks
NOTE: This feature is only recognized by Acrobat 8 or greater.
PrintArea
Specifies the print area for the document.
public PageBoundary PrintArea { get; set; }
Public Property PrintArea As PageBoundary
Property Value
PrintClip
Specifies the print clip area for the document.
public PageBoundary PrintClip { get; set; }
Public Property PrintClip As PageBoundary
Property Value
PrintPageRange
Specifies the default page ranges to be used for printing.
public Int32[] PrintPageRange { get; set; }
Public Property PrintPageRange As Int32[]
Property Value
Remarks
NOTE: This feature is only recognized by Acrobat 8 or greater.
RightToLeft
A flag specifying if right to left text is predominately used by this document.
public bool RightToLeft { get; set; }
Public Property RightToLeft As Boolean
Property Value
Remarks
This does not affect the right to left property of text objects for text added to the document.
ViewArea
Specifies the view area for the document.
public PageBoundary ViewArea { get; set; }
Public Property ViewArea As PageBoundary
Property Value
ViewClip
Specifies the view clip area for the document.
public PageBoundary ViewClip { get; set; }
Public Property ViewClip As PageBoundary
Property Value
Methods
Draw(DocumentWriter)
Draws the encrypter viewer preferences dictionary to the given DocumentWriter object.
public void Draw(DocumentWriter writer)
Sub Draw(writer As DocumentWriter)
Parameters
- writer: DocumentWriter
DocumentWriter object to receive the output.
Equals(Object)
Determines whether the specified Object is equal to the current Object . (Inherited from Object)
public bool Equals(Object obj)
Function Equals(obj As Object) As Boolean
Parameters
- obj: Object
The Object to compare with the current Object .
Returns
true if the specified Object is equal to the current Object ; otherwise, false.
GetHashCode()
Serves as a hash function for a particular type. (Inherited from Object)
public int GetHashCode()
Function GetHashCode() As Integer
Returns
A hash code for the current Object .
GetType()
Gets the Type of the current instance. (Inherited from Object)
public Type GetType()
Function GetType() As Type
Returns
The Type instance that represents the exact runtime type of the current instance.
ToString()
Returns a String that represents the current Object . (Inherited from Object)
public string ToString()
Function ToString() As String
Returns
A String that represents the current Object .