HTML JPG CAD XML DXF
  Product Family
PDF

通过 C# 将 DXF 转换为 PDF

无需 AutoCAD® 或任何其他渲染软件即可立即将 DXF 转换为 PDF。

为了将 DXF 转换为 PDF,我们将使用 Aspose.CAD for .NET API,它是一个功能丰富、功能强大且易于使用的用于 C# 平台的文档操作和转换 API。打开 NuGet 包管理器,搜索 Aspose.CAD 并安装。您也可以从包管理器控制台使用以下命令。

包管理器控制台命令


PM> Install-Package Aspose.CAD

通过 C# 将 DXF 转换为 PDF 的步骤

  1. 用Image.Load方法加载DXF文件
  2. 设置页面高度和宽度的CadRasterizationOptions对象
  3. 创建 PdfOptions 类的实例并设置其 VectorRasterizationOptions 属性
  4. 在传递 PdfOptions 的结果文件路径和对象时调用 Image.Save 方法

转换要求

  • Microsoft Windows 或具有 .NET Framework、.NET Core 和 PHP、VBScript、Delphi、C++(通过 COM 互操作)的兼容操作系统。
  • Microsoft Visual Studio 等开发环境。
  • 项目中引用的 .NET DLL 的 Aspose.CAD。
 

此示例代码显示 DXF 到 PDF C# 的转换

 

将 DXF 转换为 PDF 的免费应用程序

Check our live demos for DXF to PDF conversion with following benefits.

  No need to download or setup anything.
  No need to write any code.
  Just upload your DXF file and hit the "Convert" button.
  You will instantly get the download link for resultant PDF file.