Trabajando con Marca de Agua
Contents
[
Hide
]Agregar Marca de Agua en un DGN
A veces deseas agregar algunas marcas de agua a los dibujos para indicar cuál es el propósito de los dibujos o quién los creó. Aspose.CAD para Python te permite agregar una marca de agua en un archivo DGN.
Código de Muestra
El código a continuación muestra cómo lograr el mismo objetivo utilizando Aspose.CAD para 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.dgn | |
file.arrayBuffer().then(async buff => { | |
let x = new Uint8Array(buff); | |
this.imgFile = await Image.load(x); | |
let option = new PngOptions(); | |
option.userWatermarkColor = new Color(); | |
option.userWatermarkText = 'Aspose.CAD'; | |
var exportedFile = await Image.save(this.imgFile, option); | |
var blob = new Blob([exportedFile], { type: 'application/octet-stream' }); | |
}); | |
} |