I am using Jspdf for generate pdf, along with table with multiple records and I want to display watermark text on table but I am not able to set opacity for watermark text color. How to set opacity to the text color in JSpdf in angular
You can use setGState()
to set opacity before drawing text, like this:
doc.saveGraphicsState();
doc.setGState(new doc.GState({opacity: 0.2}));
doc.text(text, x, y, {align: 'center', baseline: 'middle'})
doc.restoreGraphicsState();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With