View Options

View options are used to define document view and zoom when a document is viewed in an application such as Microsoft Word.

Following sample demonstrates how to set document view type and zoom.

Screenshot

View Options Screenshot

See the full code below, use RUN EXAMPLE to execute.


1using System;
2using System.IO;
3using System.Linq;
4using GemBox.Document;
5using GemBox.Document.Drawing;
6
7class Sample
8{
9    [STAThread]
10    static void Main(string[] args)
11    {
12        // If using Professional version, put your serial key below.
13        ComponentInfo.SetLicense("FREE-LIMITED-KEY");
14
15        DocumentModel document = new DocumentModel();
16
17        document.Sections.Add(
18            new Section(document,
19                new Paragraph(document, "GemBox.Document is a .NET component that enables developers to read, write, convert and print document files (DOCX, DOC, PDF, HTML, XPS, RTF and TXT) from .NET applications in a simple and efficient way.")));
20
21        document.ViewOptions.ViewType = ViewType.Print;
22        document.ViewOptions.Zoom = 75;
23
24        document.Save("View Options.docx");
25    }
26}
1Imports System
2Imports System.IO
3Imports System.Linq
4Imports GemBox.Document
5Imports GemBox.Document.Drawing
6
7Module Samples
8
9    Sub Main()
10
11        ' If using Professional version, put your serial key below.
12        ComponentInfo.SetLicense("FREE-LIMITED-KEY")
13
14        Dim document As DocumentModel = New DocumentModel
15
16        document.Sections.Add(
17            New Section(document,
18                New Paragraph(document, "GemBox.Document is a .NET component that enables developers to read, write, convert and print document files (DOCX, DOC, PDF, HTML, XPS, RTF and TXT) from .NET applications in a simple and efficient way.")))
19
20        document.ViewOptions.ViewType = ViewType.Print
21        document.ViewOptions.Zoom = 75
22
23        document.Save("View Options.docx")
24
25    End Sub
26
27End Module

Check next sample or find out more about GemBox.Document and GemBox Software.