evidenceprime/html-docx-js

Adding an image watermark

Opened this issue · 4 comments

myuce commented

Hi,

I know this project is pretty much abandoned, but I would like to know if it's possible to add an image as a watermark on all pages. I've tried adding a background image with CSS, but it doesn't seem to work. Does anybody have any ideas how to do that?

Hi @myuce , I am looking for exactly the same.

Will you let me know if you find a suitable solution to this ?

Hey, I kinda coincidentally read this. I suggest not using CSS to watermark images, the CSS can easily be removed, the watermark is pointless. Essentially you'd only be faking the watermark.

I suggest watermarking the image on the server side if possible.

Check this package out.

Is this watermark static, i.e. is it the same for all the documents you want to generate? If so, maybe you can create an empty document in Word and then use it as a template?

myuce commented

Is this watermark static, i.e. is it the same for all the documents you want to generate? If so, maybe you can create an empty document in Word and then use it as a template?

It's pretty much the same image that is repeated on all pages. I'm using this library on a system that generates exam papers and we add the school's logo on all papers. Currently we have to add the watermark manually. That's why I was wondering if it was possible to add an image watermark automatically.