COLLADA 绘图
Contents
[
Hide
]将 COLLADA 格式导出为 PDF
Aspose.CAD for .NET 允许开发人员将 COLLADA 文件导出为 PDF 格式。COLLADA 到 PDF 的转换方法如下:
- 使用 Image.Load 工厂方法加载 COLLADA 绘图文件。
- 创建 CadRasterizationOptions 类的对象,并设置 PageHeight 和 PageWidth 属性。
- 创建 PdfOptions 类的对象,并设置 VectorRasterizationOptions 属性。
- 调用 Image.Save,并将 PdfOptions 对象作为第二个参数传递。
示例代码
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string inputFile ="file.dae"; | |
using (Image image = Image.Load(inputFile)) | |
{ | |
// Initialize PdfOptions class object | |
PdfOptions options = new PdfOptions(); | |
CadRasterizationOptions cadRasterizationOptions = new CadRasterizationOptions(); | |
cadRasterizationOptions.PageHeight = 500; | |
cadRasterizationOptions.PageWidth = 500; | |
options.VectorRasterizationOptions = cadRasterizationOptions; | |
// Export COLLADA to PDF | |
string outPath = "output.pdf"; | |
image.Save(outPath, options); | |
} |