رسومات DXB
Contents
[
Hide
]تصدير تنسيق DXB إلى PDF
تتيح Aspose.CAD لـ .NET للمطورين تصدير ملف DXB إلى PDF بتنسيق. يعمل نهج تحويل DXB إلى PDF على النحو التالي:
- تحميل ملف رسومات DXB باستخدام طريقة المصنع 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.dxb"; | |
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 DXB to PDF | |
string outPath = "output.pdf"; | |
image.Save(outPath, options); | |
} |