رسومات STP
Contents
[
Hide
]تصدير تنسيق STP إلى PDF
تسمح Aspose.CAD لـ Python للمطورين بتصدير ملف STP إلى تنسيق PDF. تعمل طريقة تحويل STP إلى PDF على النحو التالي:
- تحميل ملف رسم STP باستخدام الطريقة Image.load.
- إنشاء كائن من فئة CadRasterizationOptions وتعيين الخصائص page_height و page_width.
- إنشاء كائن من فئة PdfOptions وتعيين خاصية vector_rasterization_options.
- استدعاء 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
import aspose.cad as cad; | |
cadImage = cad.Image.load("file.stp"); | |
rasterizationOptions = cad.imageoptions.CadRasterizationOptions() | |
rasterizationOptions.page_width = 1200 | |
rasterizationOptions.page_height = 1200 | |
pdfOptions = cad.imageoptions.PdfOptions() | |
pdfOptions.vector_rasterization_options = rasterizationOptions | |
cadImage.save("result.pdf", pdfOptions) |