Dessin DWFX
Contents
[
Hide
]Exportation du format DWFX vers PNG
Aspose.CAD pour Javascript dans Angular permet aux développeurs d’exporter un fichier DWFX au format PNG. L’approche de conversion de DWFX à PNG fonctionne comme suit :
- Charger le fichier de dessin DWFX en utilisant la méthode Image.load.
- Appeler Image.save en passant un objet de PngOptions comme deuxième paramètre.
Code Exemple
Le code ci-dessous montre comment atteindre le même objectif en utilisant Aspose.CAD pour 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' }); | |
}); | |
} |