3DS 绘图
Contents
[
Hide
]导出 3DS 格式为 PDF
Aspose.CAD for .NET 允许开发者将 3DS 文件导出为 PDF 格式。 3DS 到 PDF 的转换方法如下:
- 使用 Image.Load 工厂方法加载 3DS 绘图文件。
- 创建 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.3ds"; | |
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 3DS to PDF | |
string outPath = "output.pdf"; | |
image.Save(outPath, options); | |
} |