Disegno DWFx
Contents
[
Hide
]Esportazione del formato DWFX in PNG
Aspose.CAD per Javascript in Angular consente agli sviluppatori di esportare un file DWFX in formato PNG. L’approccio alla conversione da DWFX a PNG funziona come segue:
- Caricare il file di disegno DWFX utilizzando il metodo Image.load.
- Chiamare Image.save passando un oggetto di PngOptions come secondo parametro.
Codice di esempio
Il codice di seguito mostra come raggiungere lo stesso obiettivo utilizzando Aspose.CAD per 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' }); | |
}); | |
} |