HTML JPG PDF XML OTT
  Product Family
OTT

OTT File Viewer for .NET

View OTT in a browser without requiring Microsoft Word or Office Automation.

How to View OTT File Using C#

In order to view OTT file, we’ll use

Aspose.Words for .NET

API which is a feature-rich, powerful and easy to use API for C# platform to be used with any Viewer. Open

NuGet

package manager, search for Aspose.Words and install. You may also use the following command from the Package Manager Console.

Package Manager Console Command


PM> Install-Package Aspose.Words

Steps to View OTT via C#

Developers can easily view Microsoft Word OTT file with just few lines of code.

  1. Load OTT file with an instance of Document class
  2. Call the Document.Save method
  3. Save OTT file in HTML Fixed format with embedded resources
  4. Call Process.Start with path to resultant HTML to load in default browser

System Requirements

Before integrating code, make sure that you have the following prerequisites.

  • Microsoft Windows or a compatible OS with .NET Framework, .NET Core, Windows Azure, Mono or Xamarin Platforms
  • Development environment like Microsoft Visual Studio
  • Aspose.Words for .NET referenced in your project
 

View OTT file using C# example code


string output = System.IO.Path.GetTempPath() + Guid.NewGuid().ToString() + ".html";
// load OTT via an instance of Document
var document = new Document("template.ott");
// save in HTML Fixed format while embedding all resources
document.Save(output, new Saving.HtmlFixedSaveOptions()
{
    ExportEmbeddedCss = true,
    ExportEmbeddedFonts = true,
    ExportEmbeddedImages = true
}
);
// load resultant HTML in defualt browser
System.Diagnostics.Process.Start(output);
 
  • .NET Words API can be used to load, view and convert Microsoft Word and OpenDocument Formats like DOC, DOCX, ODT to PDF, XPS, HTML and various other formats. You can also create new documents from scratch and save them in the supported formats. It is a standalone API that is suitable for server side and backend systems where high performance is required. It does not depend on any software like Microsoft or OpenOffice. ‎

    Free App to View OTT

    Other Supported Viewer Formats

    Using C#, One can also view many other file formats including.

    DOC (Microsoft Word Binary Format)
    DOCM (Microsoft Word 2007 Marco File)
    DOCX (Office 2007+ Words Document)
    DOT (Microsoft Word Template Files)
    DOTM (Microsoft Word 2007+ Template File)
    DOTX (Microsoft Word Template File)
    HTML (Hyper Text Markup Language)
    MD (Markdown Language)
    MHTML (Web Page Archive Format)
    MOBI (Open Ebook Format)
    ODT (OpenDocument Text File Format)
    PDF (Portable Document Format)
    RTF (Rich Text Format)
    TXT (Text Document)