Hình ảnh COLLADA
Contents
[
Hide
]Xuất định dạng COLLADA sang PDF
Aspose.CAD cho .NET cho phép các nhà phát triển xuất một tệp COLLADA sang định dạng PDF. Cách tiếp cận chuyển đổi COLLADA sang PDF hoạt động như sau:
- Tải tệp hình ảnh COLLADA bằng phương thức nhà máy Image.Load.
- Tạo một đối tượng của lớp CadRasterizationOptions và thiết lập các thuộc tính PageHeight & PageWidth.
- Tạo một đối tượng của lớp PdfOptions và thiết lập thuộc tính VectorRasterizationOptions.
- Gọi Image.Save trong khi truyền một đối tượng của PdfOptions làm tham số thứ hai.
Mẫu mã
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); | |
} |