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
- Customize the embedding of TrueType fonts in two ways.
- Essential® DocIO supports PDF documents for accessibility (508 compliance).
- Restrict all permissions in a PDF document using Pdf Permissions Flags.
- Preserve comments balloons in a generated PDF when converting Word documents with comments.
- Preserve revision marks in a generated PDF when converting Word documents with tracked changes or revisions.
- Hyphenate text in a Word document while converting it to PDF format.
- Preserve the complex script text in the converted PDF document.
- Set the Pdf Conformance Level while converting Word to PDF.
- Reduce the Main Memory usage in Word to PDF conversion.
- Preserve Word document form fields as PDF form fields in the converted PDF document.
Key features for Word Converter
- You can customize the TrueType fonts embedding in two ways.
- Essential® DocIO allows PDF document for accessibility (508 compliance) support.
- You can restrict all the permission in a PDF document using Pdf Permissions Flags.
- You can preserve comments balloon in a generated PDF when converting Word documents with comments.
- You can preserve revision marks in a generated PDF when converting Word documents with tracked changes or revisions.
- Essential® DocIO allows hyphenating text in a Word document while converting it to PDF format.
- You can preserve the complex script text in the converted PDF document.
- You can set the Pdf Conformance Level while converting Word to PDF.
- You can reduces the Main Memory usage in Word to PDF conversion.
- You can preserve Word document form field to PDF form field in the converted PDF document.
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 |
|---|---|---|
| , Console Application (Targeting .NET Framework) | Syncfusion.DocToPdfConverter.WinForms.nupkg | Install-Package Syncfusion.DocToPdfConverter.WinForms |
| 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 |
| Syncfusion.DocToPdfConverter.AspNet.nupkg | Install-Package Syncfusion.DocToPdfConverter.AspNet | |
| Syncfusion.DocToPdfConverter.AspNet.Mvc4.nupkg | Install-Package Syncfusion.DocToPdfConverter.AspNet.Mvc4 | |
| Syncfusion.DocToPdfConverter.AspNet.Mvc5.nupkg | Install-Package Syncfusion.DocToPdfConverter.AspNet.Mvc5 | |
| , Console Application (Targeting .NET Core) and |
Syncfusion.DocIORenderer.Net.Core.nupkg Note: Please refer 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 |
| Syncfusion.Xamarin.DocIORenderer.nupkg | Install-Package Syncfusion.Xamarin.DocIORenderer | |
|
|
Syncfusion.DocIORenderer.NET | Install-Package Syncfusion.DocIORenderer.NET |
NOTE
- 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.
- Syncfusion® components are available in nuget.org
- Please refer the procedure to deploy your .NET Core application in Linux OS from here.
- 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.