Document.ViewerPreferences Property

Gets a ViewerPreferences object that represents the viewer preferences of the Document .

public ViewerPreferences ViewerPreferences { get; }
Public Property ViewerPreferences As ViewerPreferences

Property Value


Licensing Info

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:


This example shows how to change the viewer preferences associated with a document.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Imports ceTe.DynamicPDF.PageElements.Html
Module MyModule
    Sub Main()

        'Create a PDF Document
        Dim document As 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

        ' Save the PDF document
    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;

        // Save the PDF document

See Also


In this topic