XtremeDocumentStudio .NET
Next-generation multi-format document-processing component suite for .NET developers
Compatibility
Visual Studio 2010/2012/2013/2015

A WPF viewer control to display DOCX, DOC, PDF documents and image formats

Learn to use XtremeDocumentStudio .NET's WPF document viewer control.

In May this year, we released a new version of XtremeDocumentStudio .NET in which we introduced a new WPF multi-format document control. We have not said much about it. So, in this article, we will demonstrate how to create a simple document viewer application with the control. You can then build bigger and better applications with it.

Well... here we go!

  1. Open Visual Studio and create a new WPF application.
  2. Add reference to the following DLLs:
    • Gnostice.Core.dll
    • Gnostice.Documents.dll
    • Gnostice.Documents.Controls.WPF.dll
  3. Drop the following components into the form:
    • A Stack Panel.
    • A Button inside the stack panel.
    • Gnostice.Documents.Controls.WPF.DocumentViewer inside the stack panel.
  4. In the XAML code view, set the VerticalAlignment and HorizontalAlignment properties of the stack panel to "Stretch".
  5. Set the name of the Button control to as "Button1".
  6. Name the WPF viewer control as "WpfDocumentViewer".
  7. Double-click the button and add the following handler for the click event.
    private void Button1_Click(object sender, RoutedEventArgs e)
    {
        WpfDocumentViewer.LoadDocument("sample.docx");
    }
    
    Change the argument to the LoadDocument() method to the pathname of an existing file.
  8. In the MainWindow() method, activate your license key.
    public MainWindow() {
      InitializeComponent();
      Gnostice.Documents.Framework.ActivateLicense("your-license-key");
    }
    
    If you are using the trial version, you can use the key XtremeDocumentStudio downloads page. If you are using a registered version, please use the license key in the delivery note you received after purchasing the product.
  9. Build the project and run it.
  10. Click the button to see the WPF viewer application display the specified file.

---o0O0o---

Our .NET Developer Tools
XtremeDocumentStudio .NET

Multi-format document-processing component suite for .NET developers.

PDFOne .NET

A .NET PDF component suite to create, edit, view, print, reorganize, encrypt, annotate, and bookmark PDF documents in .NET applications.

Our Delphi/C++Builder developer tools
XtremeDocumentStudio Delphi

Multi-format document-processing component suite for Delphi/C++Builder developers, covering both VCL and FireMonkey platforms.

eDocEngine VCL

A Delphi/C++Builder component suite for creating documents in over 20 formats and also export reports from popular Delphi reporting tools.

PDFtoolkit VCL

A Delphi/C++Builder component suite to edit, enhance, view, print, merge, split, encrypt, annotate, and bookmark PDF documents.

Our Java developer tools
XtremeDocumentStudio (for Java)

Multi-format document-processing component suite for Java developers.

PDFOne (for Java)

A Java PDF component suite to create, edit, view, print, reorganize, encrypt, annotate, bookmark PDF documents in Java applications.

Our Platform-Agnostic Cloud and On-Premises APIs
StarDocs

Cloud-hosted and On-Premises REST-based document-processing and document-viewing APIs

Privacy | Legal | Feedback | Newsletter | Blog | Resellers © 2002-2017 Gnostice Information Technologies Private Limited. All rights reserved.