Search code examples
pdfmake

PDFMake create Horizontal WaterMark ( not diagonial )


Hi :) ? I am new user of PDFMake library and i saw how to create a simple watermark like the below :

var docDefinition = {
    watermark: { text: "watermark", color: "gray", opacity: 0.3, bold: true, alignment: "right" },
    content: [

    ]
}

brave_2019-09-03_15-13-42


What i need

But how can i make the text of it be horizontal instead of diagonal ? Github Issue

I want it to appear horizontal like this :

enter image description here


Solution

  • Finally from version 1.60 onwards we can do this like below :

    var docDefinition = {
      watermark: { text: 'test watermark', angle: 70 },
      content: [
        '...'
      ]
    };
    

    You can find more on the documentation here