HTML JPG CAD XML STL
  Product Family
PDF

通過 C# 將 STL 轉換為 PDF

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

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

包管理器控制台命令


PM> Install-Package Aspose.CAD

通過 C# 將 STL 轉換為 PDF 的步驟

  1. 用Image.Load方法加載STL文件
  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。
 

此示例代碼顯示 STL 到 PDF C# 的轉換

 

將 STL 轉換為 PDF 的免費應用程序

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

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