Bản vẽ FBX
Contents
[
Hide
]Xuất định dạng FBX sang PDF
Aspose.CAD cho .NET cho phép các nhà phát triển xuất một tệp FBX sang định dạng PDF. Cách tiếp cận chuyển đổi từ FBX sang PDF hoạt động như sau:
- Tải tệp bản vẽ FBX bằng cách sử dụ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ã mẫu
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.fbx"; | |
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 FBX to PDF | |
string outPath = "output.pdf"; | |
image.Save(outPath, options); | |
} |