Convert Word document to PDF in C#

25 Jun 20263 minutes to read

The Word document files can be efficiently converted to PDF format using the .NET Word (DocIO) library. With just a few lines of code, you can seamlessly create a PDF document from scratch or convert an existing Word document. By leveraging the capabilities of Essential® DocIO, the conversion process is executed flawlessly.

The .NET Word Libraryto PDF converter is highly versatile, ensuring seamless performance across a range of platforms, including Azure Cloud, Amazon Web Service (AWS),Google Cloud Platform (GCP), ASP.NET Core, ASP.NET MVC, ASP.NET, Blazor, Xamarin, Windows Forms, WPF, UWP, WinUI, .NET MAUI, Linux, Mac. It guarantees compatibility with Windows, Linux, and macOS, making it a reliable choice for diverse operating environments.

Key features for Word Converter

Key features for Word Converter

NuGet packages to convert Word to PDF

For converting Word document into PDF, the following NuGet packages need to be installed in your application.

Platform(s) Package name Package manager console command

Windows Forms

, Console Application (Targeting .NET Framework)
Syncfusion.DocToPdfConverter.WinForms.nupkg Install-Package Syncfusion.DocToPdfConverter.WinForms

WPF

Syncfusion.DocToPdfConverter.Wpf.nupkg Install-Package Syncfusion.DocToPdfConverter.Wpf
.NET Framework 3.5 or 4.0 Client Profile Syncfusion.DocToPdfConverter.ClientProfile.nupkg Install-Package Syncfusion.DocToPdfConverter.ClientProfile

ASP.NET

Syncfusion.DocToPdfConverter.AspNet.nupkg Install-Package Syncfusion.DocToPdfConverter.AspNet

ASP.NET MVC4

Syncfusion.DocToPdfConverter.AspNet.Mvc4.nupkg Install-Package Syncfusion.DocToPdfConverter.AspNet.Mvc4

ASP.NET MVC5

Syncfusion.DocToPdfConverter.AspNet.Mvc5.nupkg Install-Package Syncfusion.DocToPdfConverter.AspNet.Mvc5

ASP.NET Core

, Console Application (Targeting .NET Core) and

Blazor

Syncfusion.DocIORenderer.Net.Core.nupkg

Note:
Please refer

here

to know about the NuGet packages that need to be installed to perform Word to PDF conversion in Linux OS.
Install-Package Syncfusion.DocIORenderer.Net.Core

Xamarin

Syncfusion.Xamarin.DocIORenderer.nupkg Install-Package Syncfusion.Xamarin.DocIORenderer

Windows UI Library (WinUI)


.NET Multi-platform App UI (.NET MAUI)

Syncfusion.DocIORenderer.NET Install-Package Syncfusion.DocIORenderer.NET

NOTE

  1. Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you also have to add “Syncfusion.Licensing” assembly reference and include a license key in your projects. Please refer to this link to know about registering Syncfusion® license key in your application to use our components.
  2. Syncfusion® components are available in nuget.org
  3. Please refer the procedure to deploy your .NET Core application in Linux OS from here.
  4. From v20.3.0.56, the dependent package SkiaSharp is upgraded from 2.88.0-preview.209 to 2.88.2 version and it is mandatory to use SkiaSharp.NativeAssets.Linux v2.88.2 and HarfBuzzSharp.NativeAssets.Linux v2.8.2.2 packages for converting Word documents into PDF in Linux environment.