ترسیم DWFX
Contents
[
Hide
]خروجی گرفتن از فرمت DWFX به PNG
Aspose.CAD برای Javascript در Angular به توسعهدهندگان این امکان را میدهد که یک فایل DWFX را به فرمت PNG خروجی بگیرند. روش تبدیل DWFX به PNG به شکل زیر است:
- فایل ترسیم DWFX را با استفاده از متد Image.load بارگذاری کنید.
- با گذراندن یک شی از PngOptions به عنوان پارامتر دوم، Image.save را فراخوانی کنید.
نمونه کد
کد زیر نشان میدهد که چگونه میتوان به همان هدف با استفاده از Aspose.CAD برای JavaScript رسید.
This file contains hidden or 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.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' }); | |
}); | |
} |