Hình vẽ 3DS
Contents
[
Hide
]Xuất định dạng 3DS sang PDF
Aspose.CAD cho .NET cho phép các nhà phát triển xuất tệp 3DS sang định dạng PDF. Phương pháp chuyển đổi từ 3DS sang PDF hoạt động như sau:
- Tải tệp hình vẽ 3DS bằng cách sử dụng phương pháp factory Image.Load.
- Tạo một đối tượng của lớp CadRasterizationOptions và đặt các thuộc tính PageHeight & PageWidth.
- Tạo một đối tượng của lớp PdfOptions và đặt 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.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); | |
} |