Syncfusion Feedback

Trusted by the world’s leading companies

Syncfusion Trusted Companies

Overview

PDF (portable document format) is a standardized format used to present document contents uniformly across various platforms. The Syncfusion .NET Word Library (DocIO) offers powerful APIs for programmatically converting Word documents to PDF with minimal code in C#, without Microsoft Word or interop dependencies. Additionally, it facilitates converting Word documents to PDF/A format for archival purposes and tagged PDFs compliant with Section 508 (PDF/UA).

Convert Word files to PDF using C#

This example code shows how to convert a Word document to PDF using the Syncfusion .NET Word Library with just few lines of code in C#.

using Syncfusion.DocIO;
using Syncfusion.DocIO.DLS;
using Syncfusion.DocIORenderer;
using Syncfusion.Pdf;

//Open the Word document file stream
using (FileStream fileStream = new FileStream("Template.docx", FileMode.Open))
{
    //Load an existing Word document
    using (WordDocument wordDocument = new WordDocument(fileStream, FormatType.Automatic))
    {
        //Create an instance of DocIORenderer
        using (DocIORenderer renderer = new DocIORenderer())
        {
            //Convert Word document into PDF document
            using (PdfDocument pdfDocument = renderer.ConvertToPDF(wordDocument))
            {
                //Save the PDF file to file system
                using (FileStream outputStream = new FileStream("WordToPDF.pdf", FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite))
                {
                    pdfDocument.Save(outputStream);
                }
            }
        }
    }
}

Key features of Word-to-PDF conversion

Accessible or Tagged PDF (PDF/UA)

Design an accessible Word document (508-compliant) using Microsoft Word or the Syncfusion .NET Word Library and convert it to an accessible or tagged PDF (PDF/UA) document.

PDF Conformance (PDF/A)

Configure the conformance level of your converted PDF for long-term archiving and standardization.

Fillable PDF Forms

Design your application forms as Word documents using Microsoft Word and convert them to fillable PDF forms using the Syncfusion .NET Word Library.

Alternate Chunks

Import or ignore the embedded alternate chunks (other Word documents) in a document when converting it to PDF.

Bookmarks

Export the paragraphs with heading styles or bookmarks as PDF bookmarks.

Identical Image Optimization

Enable the settings to reduce main memory usage during Word-to-PDF conversion by reusing identical images in the Word document.

Hyphenation

Enables the addition of hyphens to text within a Word document during Word-to-PDF conversion, using specified language dictionaries.

Track Changes

Preserve revision marks in the converted PDF, retaining tracked changes from the Word document and offering customization options for track changes markup.

Comments

Preserve comment balloons in the converted PDF from the Word document. Also, customize balloon colors for enhanced visual clarity.

Font options in Word-to-PDF conversion

Embed Font Subset

Embeds only the font glyphs from TrueType fonts that are used in the document.

Embed Complete Fonts

Embeds the complete set of TrueType fonts used in the document and allows displaying of the document contents uniformly and independent of whether the font is available or not.

Font Substitution

The built-in font substitution event allows users to choose alternate fonts from the device or upload fonts with a few lines of code.

Fallback fonts

Allows the configuration of fallback fonts for Unicode text. These fallback fonts come into play when the rendering engine encounters Unicode text that lacks a corresponding glyph in the specified fonts.

Explore Word-to-PDF conversion references

Discover these resources from our knowledge base to enhance your efficiency in converting Word documents to PDF:

Convert multiple Word documents to multiple PDFs and then zip the PDFs

Knowledge base

How to convert multiple Word documents to multiple PDFs and then zip the PDFs in C#

Perform a mail merge and then convert the Word document to PDF

Knowledge base

How to perform a mail merge and then convert the Word document to PDF

Preserve markup of tracked changes during Word-to-PDF conversion

Knowledge base

How to preserve simple markup, all markup, and no markup of tracked changes during Word-to-PDF conversion

Add a signature field in a PDF converted from a Word document

Knowledge base

How to add a signature field in a PDF converted from a Word document

Syncfusion .NET Word Library Resources

Explore these resources for comprehensive guides, knowledge base articles, insightful blogs, and ebooks.

Frequently Asked Questions

Word file formats such as DOC, DOT, DOCX, DOTX, DOCM, DOTM, Word Processing 2007 XML, Word 2003 XML Document (*.xml), as well as other formats including HTML, text, and Markdown are supported.

Yes, you can perform Word-to-PDF conversion in Linux and different cloud platforms like Azure, Amazon Web Services, and Google Cloud Platform using the .NET Word Library.

If required fonts aren’t installed, Word Library uses alternatives, possibly causing differences in generated PDFs. Refer to the documentation for solutions to resolve this issue.

Yes, you can programmatically open password-protected Word documents and convert them to PDF using the .NET Word Library.

The .NET Word Library supports converting Word documents to tagged PDFs, ensuring Section 508 compliance for users relying on assistive technologies.

You can access it through the Syncfusion.DocIORenderer.Net.Core NuGet package. Detailed code samples and tutorial video are available in the documentation.

Our Customers Love Us

Having an excellent set of tools and a great support team, Syncfusion® reduces customers’ development time.
Here are some of their experiences.

Rated by users across the globe

Want to create, View, and edit Word documents in C# or VB.NET?

Start a free 30-day evaluation today!
DOWNLOAD FREE TRIAL

No credit card required.

Mobile Free Evaluation Section

Awards

Greatness—it’s one thing to say you have it, but it means more when others recognize it. Syncfusion® is proud to hold the following industry awards.

Scroll up icon