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