HTML JPG CAD XML DWF
  Product Family
PNG

通過 C# 將 DWF 轉換為 PNG

無需 AutoCAD® 或任何其他渲染軟件即可立即將 DWF 轉換為 PNG。

為了將 DWF 轉換為 PNG,我們將使用 Aspose.CAD for .NET API,它是一個功能豐富、功能強大且易於使用的用於 C# 平台的文檔操作和轉換 API。打開 NuGet 包管理器,搜索 Aspose.CAD 並安裝。您也可以從包管理器控制台使用以下命令。

包管理器控制台命令


PM> Install-Package Aspose.CAD

通過 C# 將 DWF 轉換為 PNG 的步驟

  1. 用Image.Load方法加載DWF文件
  2. 設置頁面高度和寬度的CadRasterizationOptions對象
  3. 創建 PngOptions 類的實例並設置其 VectorRasterizationOptions 屬性
  4. 在傳遞 PngOptions 的結果文件路徑和對象時調用 Image.Save 方法

轉換要求

  • Microsoft Windows 或兼容 .NET Framework、.NET Core 和 PHP、VBScript、Delphi、C++(通過 COM 互操作)的操作系統。
  • Microsoft Visual Studio 等開發環境。
  • 項目中引用的 .NET DLL 的 Aspose.CAD。
 

此示例代碼顯示 DWF 到 PNG C# 的轉換

 

將 DWF 轉換為 PNG 的免費應用程序

Check our live demos for DWF to PNG conversion with following benefits.

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