I'm trying to build a pdf page using jspdf, manually not from the html, I'm not able to get bullet points in the pdf page, I need the bullet before the text rendered like this doc.text('/bulletpoint/'+data,60,60);
I've tried "u2022" for the bullet it doesn't work.
I'm trying to build a pdf page using jspdf, manually not from the html, I'm not able to get bullet points in the pdf page, I need the bullet before the text rendered like this doc.text('/bulletpoint/'+data,60,60);
I've tried "u2022" for the bullet it doesn't work.
3 Answers
Reset to default 5Try this:
doc.text('\u2022 ' + your text here);
jsPDF has native inbuilt PDF symbol and Zapfdingbats font so you simply use either the octal \154 or say for Star of David style just use literal A
see https://stackoverflow./a/72802213/10802527
Or simpler use mid height "bullet" from symbol's but may need to use a slightly larger font size
doc.setFontSize(14);
doc.text('My test page', 0.5, 0.5);
doc.setFont("Zapfdingbats");
doc.setFontStyle("normal");
doc.text("\154 abcdefghijkl", 1, 1);
doc.setFont("Symbol");
doc.setFontSize(20);
doc.text('·', 0.3, 0.5);
Just use an oversized dot. that worked for me perfectly.