IRONSOFTWAREHOME
Convert DOCX to PDF in C#
using IronPdf;

// Instantiate Renderer
DocxToPdfRenderer renderer = new DocxToPdfRenderer();

// Render from DOCX file
PdfDocument pdf = renderer.RenderDocxAsPdf("Modern-chronological-resume.docx");

// Save the PDF
pdf.SaveAs("pdfFromDocx.pdf");
Imports IronPdf

' Instantiate Renderer
Dim renderer As New DocxToPdfRenderer()

' Render from DOCX file
Dim pdf As PdfDocument = renderer.RenderDocxAsPdf("Modern-chronological-resume.docx")

' Save the PDF
pdf.SaveAs("pdfFromDocx.pdf")
NuGet Download
PM > Install-Package IronPdf
Convert DOCX to PDF in C#

Convert DOCX to PDF in C#

This code example demonstrates how IronPDF provides users with a concise, easy-to-implement method for converting any Microsoft Word Document to PDF. With this, you can convert your DOCX files to high-quality PDF documents in just a couple of lines.

The first step is to instantiate the renderer. The DocxToPdfRenderer class handles the conversion of DOCX files into PDF format without losing any of the original quality. Here, we have named our renderer "renderer," making it easy to reference and access its methods. This takes us to the next step, where we use the RenderDocxAsPdf method to convert the DOCX file we have provided into a new PdfDocument object. Once this is done, the newly created PDF document can be further manipulated with the IronPDF library, should you need to.

Finally, we save the PDF document using the SaveAs method, which will save the PDF to the specified file location with the set name. This is a comprehensive and easy-to-use method for DOCX to PDF conversion, saving you time with its minimal setup; while also giving you access to further methods that can be used to fully customize and control how the output PDF document will appear.

Explore our DOCX to PDF Conversion Guide.
View on GitHub

Ready to Get Started?

Nuget Downloads 20,878,335Version:2026.9just released

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required