Building a CAD-to-PDF converter: What developers need to know

Nutrient SDKs and APIs allow developers and teams to convert DWG(opens in a new tab) and DXF(opens in a new tab) files into high-fidelity PDFs across .NET, REST APIs, and Power Automate. These tools maintain colors, layers, fonts, and metadata, and they offer customization options such as paper size, layout selection, and recoloring. Skip to:
In industries like architecture, engineering, and construction, CAD files (such as DWG and DXF) are the foundation for technical drawings. Yet for archiving, collaboration, or client communication, these files often need to be converted to PDF.
What is CAD?
Computer-aided design (CAD) refers to the use of software to create, modify, and manage technical drawings and models. It’s a standard tool across industries like architecture, engineering, manufacturing, and construction, enabling users to produce highly accurate 2D and 3D designs.
Why convert CAD to PDF?
CAD files such as DWG(opens in a new tab) (AutoCAD’s proprietary format) and DXF(opens in a new tab) (a widely used open exchange format) are essential for technical design in fields like architecture, engineering, and manufacturing. These formats store rich 2D and 3D design data, including layers, dimensions, and layout views.
However, despite their power, CAD files aren’t always practical for day-to-day sharing or archiving. They often require specialized software to view, may be large in size, and aren’t ideal for distribution beyond a design team.
Converting CAD to PDF offers several key advantages:
- Accessibility — View on any device, no CAD software needed.
- Consistency — PDF maintains layout and scale for precise reviews.
- Portability — Smaller file size makes it easier to send, print, and store.
- Security — Add encryption, flatten layers, or apply watermarks.
- Simplicity — Easier for clients, stakeholders, and cross-functional teams.
Whether you’re submitting blueprints, collaborating with non-technical reviewers, or preparing long-term archives, PDF is the standard delivery format for CAD content.
Overview: Which integration should you use?
The table below provides a quick comparison of the three primary ways to implement CAD-to-PDF conversion with Nutrient.
Platform | Best for | Code required | Batch support | Custom layout | Integration targets |
---|---|---|---|---|---|
.NET SDK | Internal apps, Windows services | Yes | Yes | Yes | Desktop apps, microservices |
Document Engine | Cloud-native platforms, automation | Yes | Yes | Yes | Any language (cURL, Python, Node) |
Power Automate | SharePoint workflows, no-code use | No | ⚠️ Limited (one-by-one) | Yes | SharePoint, Teams, OneDrive |
Supported formats and fidelity
Nutrient supports the conversion of:
.dwg
(AutoCAD drawing).dxf
(Drawing Exchange Format)
It’s capable of:
- 2D and 3D rendering
- Layer, text, and line-type preservation
- Background/foreground customization
- Font embedding or substitution
- Metadata retention
1. Convert CAD to PDF using the .NET (C#) SDK
Nutrient .NET SDK provides a direct, in-memory way to convert DWG and DXF files into PDF using C#. It uses the GdPictureDocumentConverter
(opens in a new tab) class, which supports various CAD-specific features, including vector rendering, background and foreground color control, layout selection, and PDF/A compliance.
The process involves:
- Loading the CAD file via
LoadFromFile()
. - Configuring conversion preferences (optional).
- Exporting the PDF using
SaveAsPDF()
.
This method avoids the need for external services and gives developers complete control over the conversion pipeline.
Example: Convert a DXF file to PDF
using (GdPictureDocumentConverter oConverter = new GdPictureDocumentConverter()){ GdPictureStatus status = oConverter.LoadFromFile("input.dxf", GdPicture14.DocumentFormat.DocumentFormatDXF); if (status == GdPictureStatus.OK) { status = oConverter.SaveAsPDF("output.pdf", PdfConformance.PDF)); }}
This snippet, loads a .dxf
CAD file, converts it into a vector-based PDF, and outputs a regular PDF file suitable for viewing, sharing, and printing. Refer to the full .NET SDK guide for more details on configuration options.
When to use
Use the .NET SDK when:
- You’re building Windows desktop, backend, or batch processing tools.
- You require fine-grained control over file input/output.
- You want to keep the process fully local with no external API calls.
2. Convert CAD to PDF using the Document Engine REST API
If you’re working in a language-agnostic environment or need to convert CAD files from a cloud service or automated backend, Nutrient’s Document Engine REST API is the most flexible option.
It allows you to convert DWG and DXF files into high-fidelity PDFs using a simple HTTP POST request. You can either upload a file directly or point to a remote URL — making it ideal for everything from CI/CD pipelines to serverless workflows.
The API expects:
- A multipart/form-data POST request.
- One or more CAD files (as local uploads or URLs).
- JSON-based conversion instructions, such as output layout, scaling, or a color scheme.
The API processes the CAD file server-side and returns the rendered PDF.
Example: Convert via API with cURL
curl -X POST http://localhost:5000/api/build \ -H "Authorization: Token token=<API token>" \ -F document=@/path/to/example.dxf \ -F instructions='{ "parts": [ { "file": "document" } ]}' \ -o result.pdf
This command uploads a .dxf
file, defines conversion settings through the instructions
field, and outputs the converted PDF as result.pdf
.
Instead of uploading a local file as a document
, you can reference a remote file by using the file
object with a url
key inside the parts
array. This allows the API to fetch the CAD file directly from a public or signed URL. The parts
array can also be expanded to customize layout, paper size, rendering layers, color settings, and other output parameters. Refer to the API documentation for full details on available options.
When to use
Use the REST API when:
- You’re building web services, CI/CD pipelines, or cloud-based applications.
- You need a language-agnostic solution (JavaScript, Python, Node.js, etc.).
- You want to trigger conversions remotely, such as from a webhook or serverless function.
3. Convert CAD to PDF using Power Automate (no-code)
Nutrient’s Power Automate connector allows users to convert CAD files to PDF using a no-code interface, making it accessible to business users and teams working within Microsoft 365, SharePoint, or OneDrive ecosystems.
You build the flow using Power Automate’s visual builder, and Nutrient handles the file processing, returning a PDF that’s ready to be saved or shared.
Watch the video tutorial for a quick overview of how to set up the flow.
Workflow breakdown
Step 1: Trigger
Start with When a file is created or modified (properties only)
. This detects new CAD files in a SharePoint folder.
Step 2: Get the file content
Use Get file content
. This retrieves the binary content of the uploaded .dwg
or .dxf
file.
Step 3: Convert CAD to PDF
Use Convert CAD drawing to PDF
(Nutrient action). The required inputs are:
source_file_name
— e.g.site-plan.dwg
source_file_content
— Output from Step 2
Optional configurations:
- Paper size (e.g. A1, A4, ANSI B)
- Background and foreground color
- Layout selection
- Recoloring (monochrome, grayscale)
Step 4: Store the output
Use Create file
. Save the PDF to SharePoint, send via Outlook, or upload to OneDrive.
Check out the full Power Automate guide for step-by-step instructions, screenshots, and tips on customizing your flow.
When to use
Use Power Automate when:
- You need no-code automation for SharePoint/Teams workflows.
- You want to trigger conversions based on file uploads or updates.
- You work in a Microsoft ecosystem and want to avoid custom scripting.
Conclusion
CAD-to-PDF conversion is an essential function in document workflows — whether you’re preparing drawings for review, archiving blueprints, or embedding technical visuals into client deliverables.
Nutrient provides consistent, high-fidelity output across SDKs and APIs. Choose the integration path that fits your environment, and you’ll be able to automate, scale, and standardize your CAD document handling with confidence.
Ready to get started?
Start your free trial to explore Nutrient’s CAD-to-PDF tools in your own environment.
Have questions about enterprise deployment or use cases? Contact our Sales team, and we’ll help you find the best solution for your workflow.
FAQ
Do I need AutoCAD or Autodesk software to convert CAD files?
No. Nutrient’s SDK and API tools handle DWG and DXF files directly without requiring AutoCAD or any Autodesk software. All rendering and conversion are performed natively.
Can I convert a CAD file from a URL instead of uploading it?
Yes. The REST API accepts remote file URLs using the file_url
parameter within the parts
array. This allows direct conversion from cloud storage or public links.
Does Nutrient support 3D CAD drawings?
Yes. Nutrient can render 3D content into 2D views for PDF output, preserving the structural and visual aspects of 3D models.
Can I convert multiple CAD files in a batch?
Yes. The .NET SDK supports loop-based batch processing, and the REST API can be used for scripted batch requests. Power Automate is best suited for file-by-file processing, though basic batching is possible with loops or branching.
How secure is the CAD-to-PDF conversion process?
Nutrient supports secure document generation, including PDF encryption, watermarking, and on-premises deployment options. API communication is authenticated, and no third-party CAD software is required.