DynamicPDF Converter can easily convert a Microsoft Word file into a PDF document.
The easiest way to convert a Word (docx or doc) file to a PDF is by calling the static Convert method of the Converter class. But if advanced options are required, then use the [WordConverter](/docs/dotnet/cete.dynamicpdf.conversion.wordconverter" Word Converter Class") class with WordConversionOptions. The following two examples illustrate.
Converting a Word document to a PDF is straightforward when you use the Converter.Convert method. The following one line of code illustrates.
Converter.Convert("sample.docx", "sample.pdf")
WordConversionOptions options = new WordConversionOptions(false); options.Author = "John Doe"; options.TopMargin = 144; options.BottomMargin = 72; options.LeftMargin = 72; options.RightMargin = 72; WordConverter wordDocConverter = new WordConverter("sample.doc", options); wordDocConverter.Convert("sample.pdf");
Clone or view the example project at GitHub. This example on this page is in the DocFileConversion.cs file. Examples are provided for both C# and VB.NET.
Clone or View Example Project on GitHubGet started by installing the NuGet package or referring to the online documentation.
DynamicPDF Converter is available on NuGet and is part of the ceTe.DynamicPDF.Converter.NET package. The easiest way to install the DynamicPDF Converter package is by using the Visual Studio Package Manager. However, you can also download it directly from NuGet.
More information can be found at the DynamicPDF Converter webpage.