Pdfmake: Lines, circles and other shapes?

Created on 5 Jun 2015  路  5Comments  路  Source: bpampuch/pdfmake

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.

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.

All 5 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ValeSauer picture ValeSauer  路  3Comments

dmatesic picture dmatesic  路  3Comments

MathLavallee picture MathLavallee  路  3Comments

jkd003 picture jkd003  路  3Comments

kamilkp picture kamilkp  路  3Comments