Convert Word (DOCX) and Word 2003 (DOC) files to PDF in C# and VB.NET with the GemBox.Document component.

GemBox.Document is a C# / VB.NET component that enables developers to read, write, convert, and print document files (DOCX, DOC, PDF, HTML, XPS, RTF, and TXT) from .NET applications in a simple and efficient way without the need for Microsoft Word on either the developer or client machines.
GemBox.Document Free is free of charge, while GemBox.Document Professional is a commercial version that is licensed per developer.
For more information, see GemBox.Document Features or try our examples.

Following example converts a Word file (DOCX or DOC) to PDF format.

C# code

// Convert Word file (DOCX or DOC) to PDF.
DocumentModel.Load(isDocx ? "Document.docx" : "Document.doc").Save("Document.pdf");

VB.NET code

' Convert Word file (DOCX or DOC) to PDF.
DocumentModel.Load(If(isDocx, "Document.docx", "Document.doc")).Save("Document.pdf")