I want to print text with in a rectangular box. I am seeing canvas option (type: 'rect') which lets us to draw rectangles.
{
canvas: [
{
type: 'rect',
x: 1,
y: 10,
w: 250,
h: 100,
r: 4,
lineColor: '#000',
}
]
}
How to write text inside it? Or is the anyway to specify coordinates for text?
+1
try this custom function from reply â„–5 https://github.com/bpampuch/pdfmake/issues/74
Something like this - inside "canvas": [] - would be great!
{
type: "text",
x: 0,
y: 0,
font: '36pt Arial',
fillStyle: '#3F51B5',
text: 'My TEXT'
}
Any idea for a "workaround"? custom function from reply â„–5 #74 does not help. Just have to print some Numbers & Text inside a canvas. Basically to create some "charts".
+1
Use absolutePosition, see example: https://github.com/bpampuch/pdfmake/blob/master/examples/absolute.js
Most helpful comment
+1
Something like this - inside
"canvas": []- would be great!Any idea for a "workaround"? custom function from reply â„–5 #74 does not help. Just have to print some Numbers & Text inside a canvas. Basically to create some "charts".