DWFx رسم

تصدير تنسيق DWFX إلى PNG

تسمح Aspose.CAD لجافاسكريبت في أنغولار للمطورين بتصدير ملف DWFX إلى تنسيق PNG. تعمل طريقة تحويل DWFX إلى PNG على النحو التالي:

  1. تحميل ملف رسم DWFX باستخدام طريقة Image.load.
  2. استدعاء Image.save مع تمرير كائن من PngOptions كمعامل ثاني.

كود عينة

يوضح الكود أدناه كيفية تحقيق نفس الهدف باستخدام Aspose.CAD لجافاسكريبت

async onFileSelected(event) {
const file: File = event.target.files[0]; //file.dwfx
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' });
});
}