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

Converting From DOCX To PDF Using XtremeDocumentStudio .NET

No software printer. No ActiveX. No Office Automation… No headaches! Just a few lines of C# to convert DOCX to PDF.
By V. Subhash

In Version 2013 R1 of XtremeDocumentStudio .NET, we introduced a new component for converting from PDF, DOCX, BMP, PNG, JPEG and TIFF formats to PDF, BMP, PNG, JPEG and TIFF. In this article, you will learn how to use the component and convert a DOCX document to PDF.

  1. Start Visual Studio and create a new "Windows Form" application.
  2. In Solution Explorer, add a reference to Gnostice.Documents.dll.
  3. Drop the following components on to the form.
    1. System.Windows.Forms.Button
    2. System.Windows.Forms.OpenFileDialog
    3. Gnostice.Documents.DocumentConverter
  4. Double-click the button to switch to Code view.
  5. In the Form constructor, add the following code below the InitializeComponent() statement. Please update it with the correct license key.
    If you are using the trial version, you can use the key from XtremeDocumentStudio downloads page. If you are using a registered version, please use the license key from the delivery note you received after purchasing the product.
  6. In the button-click handler, add the following lines:
    openFileDialog1.FileName = "";
    openFileDialog1.Filter = "DOCX Files|*.docx|All files|*.*";
    if (openFileDialog1.ShowDialog() == DialogResult.OK) {
      documentConverter1.ConvertToFile(openFileDialog1.FileName, "converted.pdf");
  7. Run the project, select a DOCX file, and check the Debug or Release folder where the executable has been created by Visual Studio. You will find the converted.pdf document there.

Here is an animation showing a DOCX that was converted to PDF by XtremeDocumentStudio .NET.


Our .NET Developer Tools
XtremeDocumentStudio .NET

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


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

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

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