---
title: "DWG/DXF to PDF in C# .NET: Accurately convert CAD files | Nutrient .NET SDK"
canonical_url: "https://www.nutrient.io/guides/dotnet/conversion/cad-to-pdf/"
md_url: "https://www.nutrient.io/guides/dotnet/conversion/cad-to-pdf.md"
last_updated: "2026-05-21T17:12:02.199Z"
description: "Learn how to convert DWG and DXF to PDF in C# with our guide. Get code examples to transform CAD drawings to PDF format in your .NET applications."
---

# Convert DWG or DXF to PDF in C#

The `GdPictureDocumentConverter` class is a one-step operation for converting AutoCAD Drawing (DWG) and Drawing Exchange Format (DXF) files into PDF or PDF/A. You can also choose the PDF conformance level you require. DWG support includes files using the AC1032 format (AutoCAD 2018 and later).

The example below uses DXF input, but DWG is supported as well by loading a `.dwg` file with the matching CAD document format.

Here’s the code for converting files to PDF:

### C#

```csharp

// We assume GdPicture has been correctly installed and unlocked.
using (GdPictureDocumentConverter oConverter = new GdPictureDocumentConverter())
{
    // Select your source document and its document format (DXF).
    GdPictureStatus status = oConverter.LoadFromFile("input.dxf", GdPicture14.DocumentFormat.DocumentFormatDXF);
    if (status == GdPictureStatus.OK)
    {
        MessageBox.Show("The file has been loaded successfully.", "Conversion to PDF Example", MessageBoxButtons.OK, MessageBoxIcon.Information);
        // Select the conformance of the resulting PDF document.
        status = oConverter.SaveAsPDF("output.pdf", PdfConformance.PDF);
        if (status == GdPictureStatus.OK)
        {
            MessageBox.Show("The file has been saved successfully.", "Conversion to PDF Example", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
        else
        {
            MessageBox.Show("The file has failed to save. Status: " + status.ToString(), "Conversion to PDF Example", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
    }
    else
    {
        MessageBox.Show("The file has failed to load. Status: " + status.ToString(), "Conversion to PDF Example", MessageBoxButtons.OK, MessageBoxIcon.Error);
    }
}

```

### VISUAL BASIC

```vb

'We assume GdPicture has been correctly installed and unlocked.
Using oConverter As GdPictureDocumentConverter = New GdPictureDocumentConverter()
    'Select your source document and its document format (DXF).
    Dim status As GdPictureStatus = oConverter.LoadFromFile("input.dxf", GdPicture14.DocumentFormat.DocumentFormatDXF)
    If status = GdPictureStatus.OK Then
        MessageBox.Show("The file has been loaded successfully.", "Conversion to PDF Example", MessageBoxButtons.OK, MessageBoxIcon.Information)
        'Select the conformance of the resulting PDF document.
        status = oConverter.SaveAsPDF("output.pdf", PdfConformance.PDF)
        If status = GdPictureStatus.OK Then
            MessageBox.Show("The file has been saved successfully.", "Conversion to PDF Example", MessageBoxButtons.OK, MessageBoxIcon.Information)
        Else
            MessageBox.Show("The file has failed to save. Status: " + status.ToString(), "Conversion to PDF Example", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    Else
        MessageBox.Show("The file has failed to load. Status: " + status.ToString(), "Conversion to PDF Example", MessageBoxButtons.OK, MessageBoxIcon.Error)
    End If
End Using

```

---

## Related pages

- [Convert any image to PDF in C#](/guides/dotnet/conversion/any-image-to-pdf.md)
- [Convert bitmap (BMP) to PDF in C#](/guides/dotnet/conversion/bmp-to-pdf.md)
- [Convert emails (MSG/EML) to PDF in C#](/guides/dotnet/conversion/email-to-pdf.md)
- [Embed a font in a Word document](/guides/dotnet/conversion/embed-font-in-word-document.md)
- [Convert Excel to PDF in C#](/guides/dotnet/conversion/excel-to-pdf.md)
- [Convert HTML to PDF using C# and .NET](/guides/dotnet/conversion/html-to-pdf.md)
- [Convert files to PDF in C# .NET](/guides/dotnet/conversion.md)
- [Convert JPG to PDF in C#](/guides/dotnet/conversion/jpg-to-pdf.md)
- [Merge and combine multiple files into a PDF in C#](/guides/dotnet/conversion/merge-to-pdf.md)
- [Convert HTML to Word in C#](/guides/dotnet/conversion/html-to-word.md)
- [Convert images to PDFs in C#](/guides/dotnet/conversion/image-to-pdf.md)
- [Convert PDF to bitmap (BMP) in C#](/guides/dotnet/conversion/pdf-to-bmp.md)
- [Convert MS Office files to PDFs in C#](/guides/dotnet/conversion/office-to-pdf.md)
- [Converting a document from Markdown to PDF format](/guides/dotnet/conversion/markdown-to-pdf.md)
- [Convert PDF to Excel in C#](/guides/dotnet/conversion/pdf-to-excel.md)
- [Converting a document from PDF to Markdown format](/guides/dotnet/conversion/pdf-to-markdown.md)
- [Convert PDF to JPG in C#](/guides/dotnet/conversion/pdf-to-jpg.md)
- [Convert PDF to PDF/UA](/guides/dotnet/conversion/pdf-to-pdf-ua.md)
- [Convert PDF to other images in C#](/guides/dotnet/conversion/pdf-to-other-image.md)
- [Convert PDF to SVG in C#](/guides/dotnet/conversion/pdf-to-svg.md)
- [Convert PDF to PDF/A](/guides/dotnet/conversion/pdf-to-pdfa.md)
- [Convert PDF to PowerPoint in C#](/guides/dotnet/conversion/pdf-to-powerpoint.md)
- [Convert PDF to PNG in C#](/guides/dotnet/conversion/pdf-to-png.md)
- [Convert PDF to Word in C#](/guides/dotnet/conversion/pdf-to-word.md)
- [Convert PDF to TIFF in C#](/guides/dotnet/conversion/pdf-to-tiff.md)
- [Convert PNG to PDF in C#](/guides/dotnet/conversion/png-to-pdf.md)
- [Convert RTF to PDF in C#](/guides/dotnet/conversion/rtf-to-pdf.md)
- [Convert PowerPoint to PDF in C#](/guides/dotnet/conversion/powerpoint-to-pdf.md)
- [Convert SVG to PDF in C#](/guides/dotnet/conversion/svg-to-pdf.md)
- [Convert RTF to Word in C#](/guides/dotnet/conversion/rtf-to-docx.md)
- [Convert to MS Office from any file in C#](/guides/dotnet/conversion/any-file-to-office.md)
- [Convert text to PDF in C#](/guides/dotnet/conversion/text-to-pdf.md)
- [Convert TIFF to PDF in C#](/guides/dotnet/conversion/tiff-to-pdf.md)
- [Convert to Word, Excel, or PowerPoint in C#](/guides/dotnet/conversion/to-office.md)
- [Convert Word to PDF in C#](/guides/dotnet/conversion/word-to-pdf.md)
- [Convert images to PDFs in C#](/guides/dotnet/conversion/pdf-to-image.md)

