kumarpapunjay

Posted 13-Dec-2020 | 14143 | Expressjs

How to align text in center using jspdf?

I am using jsPDF for my project where have to create a PDF from user submitted data. I want to align text in center for few inputs with jsPDF. According to the documentation I have tried using the following but no luck.

var doc = new jsPDF()
doc.text(10, 10, 'Invoice', { align: 'center' })
doc.save('file.pdf')

The final output i am getting is with text at left corner not at center. How to align the text with jsPDF?

Replies