Is it possible to draw lines, circles and other shapes with pdfmake? If yes, is there a documentation or are there any samples? I would like to replace jsPDF with pdfmake.
Currently shape support is very limited, take a look at the vectors example: https://github.com/bpampuch/pdfmake/blob/master/examples/vectors.js
Great. I was searching for this for drawing shapes in pdf and finally got it. Awesome.
I think we should add this sample in the playground as well, http://pdfmake.org/playground.html. As it was hard for me to search and get here.
I agree with @kabirbaidhya . This would be a nice addition to the playground.
@bpampuch Is there a way to get text over the top of a shape?
```
stack: [
{
canvas:
[{
type: 'rect',
x: 20, y: 0,
w: 70,
h: 70,
lineWidth: 7,
lineColor: '#9e9e9e',
r: 100
},
{
type: 'rect',
x: 5, y: 31,
w: 100,
h: 10,
color: '#7a7a7a',
fillOpacity: 0.5
},
{
text: 'Hello World',
x: 20, y: 50
}
]
},
{ text: 'Hello World' } // appears below graphic
]
Hello, excuse me, can you help me design a triangle on the canvas, tanks
Most helpful comment
Great. I was searching for this for drawing shapes in pdf and finally got it. Awesome.
I think we should add this sample in the playground as well, http://pdfmake.org/playground.html. As it was hard for me to search and get here.