admin管理员组文章数量:1389887
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.
本文标签: javascriptBullet points in jspdfStack Overflow
版权声明:本文标题:javascript - Bullet points in jspdf - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744643938a2617285.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论