PDF.js Express Version 6.2.1
Detailed description of issue
{Fail to add watermark in the document , trying to use the watermark with [ docViewer.setWatermark
Code snippet
{WebViewer({
initialDoc: ‘https://url/to/my_file.docx’,
// …
}, viewerElement)
.then(instance => {
const { docViewer } = instance;
docViewer.setWatermark({
// Draw diagonal watermark in middle of the document
diagonal: {
fontSize: 25, // or even smaller size
fontFamily: 'sans-serif',
color: 'red',
opacity: 50, // from 0 to 100
text: 'Watermark'
},
// Draw header watermark
header: {
fontSize: 10,
fontFamily: 'sans-serif',
color: 'red',
opacity: 70,
left: 'left watermark',
center: 'center watermark',
right: ''
}
});
});}