◆SelectPdf.Universal · Word to PDF DOCX · DOC · RTF · Markdown

Word to PDF for .NET.
DOCX, DOC and RTF, on every platform.

Convert Word documents to PDF in C# and VB.NET with SelectPdf.Universal, our new flagship library (commercial edition), on Windows, Linux and macOS on Apple Silicon. The Word engine is part of the library, so there is no browser to start, no network access and no native package to deploy. Page sizes follow the document, headings become bookmarks, and the output can be tagged PDF/UA or archival PDF/A.

COMMERCIAL · SELECTPDF.UNIVERSAL ●

Add Word to PDF to your project

One package — no Office to install, no browser to start.

$ dotnet add package SelectPdf.Universal
 
# Word to PDF needs no native package. Add
# SelectPdf.Universal.Native.<rid> when you also convert HTML.
DOCX · DOC · RTF C# & VB.NET Windows · Linux · macOS PDF/UA · PDF/A
↳Quick start

Convert Word to PDF in C# and VB.NET.

ConvertStream and ConvertBytes take the same document from memory; the format comes from the file extension or is detected from the bytes.

Program.cs
using SelectPdf.Universal;

WordToPdf converter = new WordToPdf();
PdfDocument doc = converter.ConvertFile("contract.docx");
doc.Save("contract.pdf");
doc.Close();
Program.vb
Imports SelectPdf.Universal

Dim converter As New WordToPdf()
Dim doc As PdfDocument = converter.ConvertFile("contract.docx")
doc.Save("contract.pdf")
doc.Close()
§FORMATS

Convert DOCX, DOC and RTF to PDF — and eight more formats.

Let the library detect the format, or name it yourself with WordFormat.

Word DOCX · DOCM · DOTX · DOTM Word documents, macro-enabled documents and templates.
Word 97–2003 DOC · DOT The binary Word format and its templates.
Rich Text RTF Rich Text Format documents.
Plain text TXT Plain text files.
Word XML WordML Word 2003 XML documents.
HTML and Markdown HTML · Markdown Through the Word engine's own importers, not a browser.
⌗PAGE SETUP

The document's pages, or yours.

Document — the default

Each PDF page takes the size of its Word page, mixed sizes and orientations included. Your margins and header or footer bands are taken off the page, so the document's content never runs into them.

Options

Set PageSetup to Options and the document reflows onto your page size, orientation and margins instead.

⚖ACCESSIBLE & ARCHIVAL

Accessible and archival PDF from Word.

Accessibility PDF/UA-1 · PDF/UA-2 Tagged PDF built from the document's own structure, validated with veraPDF.
Archival and accessible PDF/A-3a with PDF/UA-1 One file for long-term archiving and for accessibility, validated with veraPDF.
PDF 2.0 PDF/A-4 with PDF/UA-2 The PDF 2.0 pairing of archival and accessible PDF, validated with veraPDF.

Set AccessibilityStandard, Title and Language, as on the HTML converter.

↔HEADERS, FOOTERS & REGIONS

Word in headers, footers and page regions.

PdfWordSection

Puts a Word document in a header or footer band — a letterhead kept as a .docx — and works under an HTML conversion too.

PdfWordElement

Draws a Word document into a region of a page and, with Height = -1, continues it onto the pages that follow.

↳OPTIONS

Word to PDF options — passwords, bookmarks, fonts.

Password Encrypted .docx and .doc Set Options.Password to open a password-protected document.
Bookmarks Headings · bookmarks · none The PDF outline comes from the document's headings by default, from its Word bookmarks, or not at all.
Fields Updated Fields are updated before the document is laid out.
Form fields Kept on request Word form fields can become fillable PDF form fields.
Fonts Subset or complete Subset by default, embedded complete on request. On a host with no fonts, the library's bundled Liberation fonts stand in.
Everything else As on the HTML converter Headers and footers, security, viewer preferences, compression, page ranges, PDF/A and PDF/X.

Word to PDF is in the commercial SelectPdf.Universal package. It is not in the free Community Edition, and the classic Windows library does not include it — classic converts RTF only, as a page element (RtfToPdfElement).

?FAQ

Word to PDF in .NET, answered.

More in the cross-platform PDF library overview — the rest is one email away.

No. The Word engine is part of the SelectPdf.Universal library: nothing else is installed, and the document is never sent anywhere.
DOCX, DOCM, DOTX and DOTM; DOC and DOT; RTF; TXT; WordML; and HTML and Markdown, which go through the Word engine's own importers rather than a browser. The format comes from the file extension or is detected from the bytes.
Yes, on every platform SelectPdf.Universal supports. On a host with no fonts installed, such as a minimal Linux container, missing fonts come from the Liberation fonts bundled with the library.
Yes. Set Options.Password for an encrypted .docx or .doc file.
Yes: PDF/UA-1, PDF/UA-2, PDF/A-3a and PDF/A-4, each validated with veraPDF.
No. It is part of the commercial SelectPdf.Universal package; one perpetual license from $499 also covers the classic Windows library.