نقشه های 3DS
Contents
[
Hide
]صادرات فرمت 3DS به PDF
Aspose.CAD for .NET به توسعه دهندگان اجازه می دهد تا یک فایل 3DS را به فرمت PDF صادر کنند. رویکرد تبدیل 3DS به PDF به صورت زیر عمل می کند:
- بارگذاری فایل نقشه 3DS با استفاده از متد سازنده Image.Load.
- ایجاد یک شی از کلاس 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); | |
} |