رسومات PLT
Contents
[
Hide
]تصدير صيغة PLT إلى PNG
يتيح Aspose.CAD لـ JavaScript في Angular للمطورين تصدير ملف PLT إلى صيغة PNG. تعمل طريقة تحويل PLT إلى PNG كما يلي:
- قم بتحميل ملف رسم PLT باستخدام طريقة Image.load.
- اتصل بـ Image.save مع تمرير كائن من PngOptions كوسيطة ثانية.
مثال على الكود
الكود أدناه يوضح كيفية تحقيق نفس الهدف باستخدام Aspose.CAD لـ JavaScript
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
async onFileSelected(event) { | |
const file: File = event.target.files[0]; //file.plt | |
file.arrayBuffer().then(async buff => { | |
let x = new Uint8Array(buff); | |
this.imgFile = await Image.load(x); | |
var exportedFile = await Image.save(this.imgFile, new PngOptions()); | |
var blob = new Blob([exportedFile], { type: 'application/octet-stream' }); | |
}); | |
} |