NOW AVAILABLE: Summer 2025 Release

How to Convert CAD Files to PDF in Your Application

By Apryse | 2023 Oct 04

Sanity Image
Read time

7 min

Summary: CAD to PDF conversion provides a useful way to give access to CAD files for users without licenses or skills to use dedicated CAD software, or for archiving or review. Follow this guide to try CAD to PDF conversion in the Apryse SDK.

This blog was updated September 3, 2025.

The architecture, engineering and construction industry is a key focus area for Apryse software development. That’s why we’ve built our SDKs to support CAD workflows in your application such as:

  • View CAD files without licenses: Support CAD formats, including Autodesk AutoCAD® DWG™, DXF™, RVT™, DWF™, and Bentley MicroStation® DGN™, without you or your users needing any CAD software or CAD licenses.
  • Preview CAD files: Quickly generate compact page-one previews and thumbnails of CAD drawings, designs, or blueprints, and display them in any client.
  • Convert CAD to PDF: Easily add high-fidelity direct conversion from CAD files, on any web, mobile, server or desktop software. Convert to PDF, PDF/A, PDF/E-2, image file types, and more.

In this article we will walk through the CAD To PDF sample and see how easy it is to perform this task with minimal code. We will also look at some of the features of the generated PDF when viewed within the Apryse WebViewer, such as:

  • enable or disable layers
  • measure items within the drawing
  • zoom into very intricate parts of the drawing to a level of detail that is not available in other viewers.

Why Convert CAD to PDF?

Copied to clipboard

While CAD software excels at design and editing tasks, sharing CAD files such as DWG, DXF, or RVT as-is can be impractical due to the files often being too large to share via email or web platforms, and the requirement of dedicated software and specific skills to interpret them.

Converting CAD files to PDF addresses these challenges effectively. PDF is a universally supported format that maintains the visual integrity of CAD designs while making them accessible to anyone with a PDF viewer. This simplifies collaboration, file sharing, and ensures that intricate details and precise measurements are accurately represented.

 

CAD to PDF Conversion Made Simple with Apryse SDK

Copied to clipboard

Designed with developers and businesses in mind, the Apryse SDK also offers a comprehensive solution for integrating CAD-to-PDF conversion directly into your applications or workflows.

Key Features:

  • Wide Range of Supported Formats: The Apryse SDK supports a diverse range of CAD formats, including DWG, DXF, RVT and more. This flexibility ensures that your conversion needs are met, regardless of the software used to create the original design.
  • High-Quality PDF Output: The SDK maintains the quality of the original CAD design during the conversion process. This is vital for ensuring that intricate details, precise measurements, and design elements are accurately represented in the PDF output.
  • Effortless Integration: With a developer-friendly interface and clear documentation, integrating the Apryse SDK into your existing applications or workflows is a straightforward process. This means you can seamlessly automate CAD-to-PDF conversions, saving valuable time and resources.
  • Customization Options: The Apryse SDK offers customizable settings, allowing you to tailor the conversion process to your specific requirements. Adjusting page layouts, scaling, and other parameters ensures that the PDF output aligns with your preferences.
  • Scalability and Performance: Whether you're working on a single conversion or batch processing multiple files, the Apryse SDK is built to handle the workload efficiently, ensuring optimal performance even with large and complex CAD files.

How to Find Sample Code for CAD to PDF Conversion

Copied to clipboard

The CAD2PDF sample code that we will be using can either be downloaded from here, or alternatively, the Apryse SDK is shipped with samples that demonstrate a wide range of functionality including CADtoPDF conversion. In either case, however, an add-on module is required, and we will show how to download and install that.

Before we can use the sample, however, we will need to get a Trial license key.

How to Get an Apryse SDK Trial Key

If you don't already have an Apryse account, go to https://dev.apryse.com and register a new account. This allows Apryse to grant you a demo license key which will be used with the Apryse SDK to enable demo functionality.

Blog image

Figure 2 - The page for signing up to Apryse to get a Trial key

Log into https://dev.apryse.com with your registered account. The Apryse SDK and the CADToPDF module are available for Windows, Linux and macOS, so select the platform that you are using.

Click on the Reveal button to get your personalized Trial key.

The SDK does not include the CADToPDFModule which must be downloaded separately, which we will do next.

How to Add the CADToPDFModule to Apryse SDK

Copied to clipboard

Extract the file over the folder that contains the SDK which you have previously extracted.

If you look inside the folder there should now be a file called CAD_README.md

Blog image

Figure 7 - the Contents of the Apryse SDK folder after the addition of the CAD module.

A folder will also have been added to the Samples/TestFiles. This contains the CAD file used by the example code. If this folder is missing, then something has gone wrong with downloading, and extracting, the SDK and Module. This needs to be solved before continuing.

Blog image

Figure 8 - The contents of the TestFiles folder. If this is missing then the CAD Module installation is not complete.

Using the Sample Code

VSCode is an excellent option for looking at these files due to its efficient file viewing with syntax highlighting and git integration, however you can use whatever IDE you prefer.

Copy the license code that you have previously acquired into the PDFTronLicense class.

Blog image

Figure 9 - The PDFTronLicense class indicating where your license key should be pasted.

Next, let’s look at the file that will do the work – CAD2PDFTest.cs.

Blog image

Figure 10 - A view of the code used to set up the file for conversion.

You can see that the code has hard-coded file names. This is just to simplify setting up the project, so feel free to try it out with different files.

You can run the sample, which converts a specific CAD file to PDF, by navigating to navigate to the folder \PDFNetC64\Samples\CAD2PDFTest\CS then using RunTest.bat from a command prompt.

(Note that if you use a PowerShell terminal then you will need to use .\RunTest.bat, and if you use the Run command within VSCode then the working folder will be different, and you will need to change the relative paths accordingly.)

Blog image

Figure 11 - Typical output of the RunTest.bat file.

Once the processing has completed, there will be a new file in the folder TestFiles\Output

Blog image

Figure 12 - The Samples output folder after running the conversion.

This file can then be viewed in any PDF viewer, and shared with whoever needs to see it.

Blog image

Figure 13 - An overview of the generated PDF.

Blog image

Figure 14 - Detail of part of the PDF, zoomed into 19325%.

The behavior of the viewer is intuitive – it is exactly the same as you would use for any other PDF, so it is easy to zoom into any part of the file.

How Did the Code Work?

For a *.dwg file, the code is extremely simple – a PDFDoc object is created then saved:

  using (PDFDoc pdfdoc = new PDFDoc()){ 

      pdftron.PDF.Convert.FromCAD(pdfdoc, input_path + input_file_name, null); 
      pdfdoc.Save(output_path + output_file_name, SDFDoc.SaveOptions.e_remove_unused); 
} 

What is even better is that the code needed to do this is very similar to the code used to convert to and from Office, Image files etc. so that having learned to use the SDK, many other options are also, and easily, available.

Note: Revit files *.rvt, need a few more lines of code that set the page width and height and the RasterDPI. How to do this is included in the sample code, but the functionality is currently only available for Windows.

Want More Information?

You can find more information on this package at

What’s Next?

Copied to clipboard

Whether you're an architect presenting plans to clients, an engineer sharing mechanical schematics, or an artist showcasing intricate designs, the Apryse SDK ensures that your creativity and innovation are never hindered by technical barriers. Embrace the power of streamlined CAD-to-PDF conversion and elevate your collaborative efforts to new heights.

In addition to converting CAD documents to PDF, Apryse offers many tools for editing and handling both Office Documents and PDFs, including converting PDFs into Office documents.

When you are ready to get started, see the documentation for the SDK to get started quickly. Don’t forget, you can also reach out to us on Discord if you have any issues, or contact Sales.

 

FAQ: CAD to PDF Conversion with Apryse SDK

Copied to clipboard

1. What is the easiest way to convert CAD files to PDF in a .NET application?

You can use the Apryse SDK to integrate CAD-to-PDF conversion directly into your .NET application. It supports formats like DWG, DXF, RVT, and more, with minimal code required.

2. Do I need CAD software or licenses to view or convert CAD files with Apryse?

No. Apryse SDK allows you to view and convert CAD files without needing any CAD software or licenses, making it ideal for scalable deployment.

3. What platforms support the Apryse CAD-to-PDF module?

The Apryse SDK and CADToPDF module are available for Windows, Linux, and macOS, enabling cross-platform development and deployment.

4. How can I get a trial license key for Apryse SDK?

You can get a trial key instantly at dev.apryse.com.

5. What features does the Apryse WebViewer offer for CAD?

Apryse WebViewer supports layer toggling, precise measurement tools, and deep zoom capabilities for intricate CAD details, enhancing collaboration and review.

Sanity Image

Apryse

Share this post

email
linkedIn
twitter