Word formats
DOCX, DOCM, DOTX, DOTM, DOC and DOT, RTF and WordML. The format is found from the file extension or the content, or set with WordFormat.
Convert Word documents to PDF from C# and VB.NET without Microsoft Word: DOCX, DOCM, DOTX, DOTM, DOC and DOT, RTF, WordML, plain text, and HTML and Markdown read as Word documents. The document is laid out by a Word layout engine in the library, on Windows, Linux and macOS.
The Word to PDF converter is part of ExpertPdf Anywhere, the .NET library with every ExpertPdf tool. Get the PDF as bytes, a file or a stream, with bookmarks from the headings, PDF/A or tagged PDF/UA.
Documentation · Online samples · NuGet · Download .zip (v22.0.0) · Word to PDF docs · Word to PDF online sample
How the Word document is read and laid out, and how the PDF document comes out.
Word documents from a file, a stream or bytes, laid out without Microsoft Word.
DOCX, DOCM, DOTX, DOTM, DOC and DOT, RTF and WordML. The format is found from the file extension or the content, or set with WordFormat.
Plain text, HTML and Markdown files are read as Word documents and converted the same way.
The PDF pages take the page sizes and margins of the document, a different size for each section included. Or lay the document out again on your page size, orientation and margins.
Dates, page numbers and counts and cross-references are updated as Word updates them when it saves a PDF; UpdateFields recalculates every field.
Open a password protected document with Password.
A font the host does not have is replaced by one with the same metrics. Hosts without fonts get them from the ExpertPdf.Anywhere.Fonts package.
Bookmarks, form fields, standards and security, as bytes, a file or a stream.
The PDF outline from the headings of the document (the default), from its bookmarks, or none.
Keep the form fields of the document as PDF form fields with PreserveFormFields.
Convert only some pages, for example "1-3,5", with PageRanges.
PDF/A and PDF/X documents, and tagged PDF/UA-1 and PDF/UA-2 documents with the headings, lists, tables and alternative text of the Word document.
A header and a footer with a title, a text and page numbers, passwords and permissions, and the document information, as in the HTML to PDF converter.
Add a Word document to a PDF document made with the PDF Creator API, as a WordToPdfElement.
Create a PdfConverter from ExpertPdf.Anywhere.WordToPdf, set the options and call one conversion method. The tabs convert a file with page numbers and bookmarks, and a stream to an accessible A4 document.
using ExpertPdf.Anywhere.WordToPdf; var converter = new PdfConverter(); // converter.LicenseKey = "your license key"; // Page numbers in the footer converter.PdfDocumentOptions.ShowFooter = true; converter.PdfFooterOptions.ShowPageNumber = true; // The PDF bookmarks from the headings of the document converter.Bookmarks = WordBookmarks.Headings; converter.SavePdfFromWordFileToFile("report.docx", "report.pdf");
Install the package of your operating system, dotnet add package ExpertPdf.Anywhere.Windows
(or .Linux, .Linux.Arm64, .MacOS); it brings the ExpertPdf Anywhere library with it. The
Word to PDF topic describes every option, and the
online sample converts your own document.
Also in ExpertPdf Anywhere: Cross-platform HTML to PDF, Excel to PDF, PowerPoint to PDF, PDF to Word, PDF to Excel, PDF to PowerPoint, and every other ExpertPdf tool.
Common questions about formats, layout, fonts and licensing.
WordFormat to set it.PageSetup = WordPageSetup.Document) the PDF pages take the page sizes and margins of the document, a different size for each section included. With WordPageSetup.Options the document is laid out again on the page size, orientation and margins of PdfDocumentOptions.UpdateFields to recalculate every field.PdfStandardSubset produces PDF/A and PDF/X documents, and AccessibilityStandard tagged PDF/UA-1 or PDF/UA-2 documents, tagged from the headings, paragraphs, lists, tables and the alternative text of the pictures of the Word document. Set Language and the title for an accessible document.ExpertPdf.Anywhere.Fonts package.Install ExpertPdf Anywhere from NuGet and try every feature in evaluation mode. License it on the pricing page when you are ready.