How to Convert DOCX to PDF using ByteScout PDF SDK - ByteScout

How to Convert DOCX to PDF using ByteScout PDF SDK

  • Home
  • /
  • Articles
  • /
  • How to Convert DOCX to PDF using ByteScout PDF SDK

The example demonstrates how to convert Microsoft Word DOCX document to PDF document using ByteScout PDF SDK. You can easily follow those step-by-step recommendations for DOCX converting and other tips on PDF Generation C#.

Program.vb:
VB

'*******************************************************************
'       ByteScout PDF SDK
'                                                                   
'       Copyright © 2016 Bytescout, https://bytescout.com        
'       ALL RIGHTS RESERVED                                         
'                                                                   
'*******************************************************************

Imports Bytescout.PDF.Converters

''' <summary>
''' This example demonstrates how to convert Microsoft Word DOCX document to PDF document.
''' </summary>
Class Program

    Shared Sub Main()

        ' Create converter instance
        Using converter As New DocxToPdfConverter()

            ' Perform conversion
            converter.ConvertDocxToPdf("sample.docx", "result.pdf")

        End Using

        ' Open result document in default PDF viewer
        Process.Start("result.pdf")

    End Sub

End Class

Program.cs:
C#

//*******************************************************************
//       ByteScout PDF SDK		                                     
//                                                                   
//       Copyright © 2016 ByteScout - https://bytescout.com       
//       ALL RIGHTS RESERVED                                         
//                                                                   
//*******************************************************************

using System.Diagnostics;
using Bytescout.PDF.Converters;

namespace ConvertDocxToPdf
{
	/// <summary>
	/// This example demonstrates how to convert Microsoft Word DOCX document to PDF document.
	/// </summary>
	class Program
	{
		static void Main()
		{
            // Create converter instance
            using (DocxToPdfConverter converter = new DocxToPdfConverter())
		    {
                // Perform conversion
		        converter.ConvertDocxToPdf("sample.docx", "result.pdf");
		    }

		    // Open result document in default PDF viewer
		    Process.Start("result.pdf");
		}
	}
}

Tutorials:

prev
next