Properties
text
– watermark textcolor
– color of textopacity
opacity of textbold
– bold style of textitalics
– italics style of textfontSize
– own font size of text (ideal size is calculated automatically) (minimal version: 0.1.60)angle
– angle of text rotation (minimal version: 0.1.60)
index.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>PDFMake</title> </head> <body> </body> <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.70/pdfmake.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.70/vfs_fonts.js"></script> <script> // playground requires you to assign document definition to a variable called dd var docDefinition = { watermark: { text: 'test watermark', color: 'blue', opacity: 0.3, bold: true, italics: false }, content: [ 'paragraph 1', 'paragraph 2', { columns: [ 'first column is a simple text', [ // second column consists of paragraphs 'paragraph A', 'paragraph B', 'these paragraphs will be rendered one below another inside the column' ] ] } ] }; pdfMake.createPdf(docDefinition).download(); </script> </html> |