Quickly Convert Doc/Docx to PDF in WPF

This guide focuses on how to convert Word to PDF with WPF in an easy way. At the beginning, prepare a Word document which you want to convert to PDF. Also, you can set format for the contents to have a good appearance after converting.

Spire.Doc for WPF, professional component to manipulate Word document with no dependency on Microsoft Word, enables users to convert Word to PDF for WPF.

The following screenshot is the Word document which I prepare. This document only includes a title and an image.

Doc to PDF

Download and install Spire.Doc for WPF on your system and then convert Word to PDF with WPF by using the following code.

//Load Document
Document document = new Document();

//Convert Word to PDF
document.SaveToFile("WPFWord2PDF.pdf", FileFormat.PDF);
'Load Document
Dim document As New Document()

'Convert Word to PDF
document.SaveToFile("WPFWord2PDF.pdf", FileFormat.PDF)

After running, you can get the result as following:

Doc to PDF

Spire.Doc is an Microsoft Word component which enables users to perform a wide range of Word document processing tasks directly, such as generate, read, write and modify Word document in WPF.NET and Silverlight.