在水印中工作
Contents
[
Hide
]在 DGN 中添加水印
有时您希望在图纸上添加一些水印,以指示图纸的目的或由谁创建。Aspose.CAD for Python 允许您在 DGN 文件中添加水印。
示例代码
下面的代码演示了如何使用 Aspose.CAD for 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' }); | |
}); | |
} |