View Options

View options are used to define document view and zoom when a document is viewed in an application such as Microsoft Word or Adobe Reader. GemBox.Document represents them with the ViewOptions class.

Note: the ViewType.FullScreen option is only supported for PDF files.

The following example shows how you can set the document view type and zoom.

Word document with set view options like zoom
Screenshot of Word file with specified view options
using GemBox.Document;

class Program
{
    static void Main()
    {
        // If using Professional version, put your serial key below.
        ComponentInfo.SetLicense("FREE-LIMITED-KEY");
        
        var document = new DocumentModel();

        document.Sections.Add(
            new Section(document,
                new Paragraph(document, " ")));

        var viewOptions = document.ViewOptions;
        viewOptions.ViewType = ViewType.Web;
        viewOptions.Zoom = %Zoom%;

        document.Save("View Options.%OutputFileType%");
    }
}
Imports GemBox.Document

Module Program

    Sub Main()

        ' If using Professional version, put your serial key below.
        ComponentInfo.SetLicense("FREE-LIMITED-KEY")

        Dim document As New DocumentModel()

        document.Sections.Add(
            New Section(document,
                New Paragraph(document, " ")))

        Dim viewOptions = document.ViewOptions
        viewOptions.ViewType = ViewType.Web
        viewOptions.Zoom = %Zoom%

        document.Save("View Options.%OutputFileType%")

    End Sub
End Module

Want more?

Next example GitHub

Check the next example or select an example from the menu. You can also download our examples from the GitHub.


Like it?

Download Buy

If you want to try the GemBox.Document yourself, you can download the free version. It delivers the same performance and set of features as the professional version, but with some operations limited. To remove the limitation, you need to purchase a license.