sphilee / jsPDF-CustomFonts-support

This repo is being deprecated. Please check out https://github.com/MrRio/jsPDF
https://github.com/MrRio/jsPDF
MIT License
183 stars 77 forks source link

jspdf function fromHTML #3

Open sarawutymtz opened 7 years ago

sarawutymtz commented 7 years ago

don't have function fromHTML ?

^_^

jedihoo commented 7 years ago

doc.fromHTML is not a function

nihao123 commented 7 years ago

doc.fromHTML does not work. Anyone can help? I include all js files under "plugins" folder. But nothing happen.

BeEasyO commented 6 years ago

well. I added my custom font (russian). With only text it works fine, but with fromHtml i still got broken chars. http://joxi.ru/ZrJkEG4S15eXMm my code was like doc.addFileToVFS('Roboto-Regular.ttf', base); doc.addFont('Roboto-Regular.ttf', 'roboto', 'normal'); doc.setFont('roboto'); doc.fromHTML('<div id="editor" style="color:red;">русский текст</div> еще адын one', 15, 15, { 'width': 170 }); doc.text(15, 45, 'текст'); doc.save('custom_fonts.pdf');

eryspekov commented 6 years ago

+1

lq0910 commented 6 years ago

Have you solved your problem?

lq0910 commented 6 years ago

well. I added my custom font (russian). With only text it works fine, but with fromHtml i still got broken chars. http://joxi.ru/ZrJkEG4S15eXMm my code was like doc.addFileToVFS('Roboto-Regular.ttf', base); doc.addFont('Roboto-Regular.ttf', 'roboto', 'normal'); doc.setFont('roboto'); doc.fromHTML('

русский текст
еще адын one', 15, 15, { 'width': 170 }); doc.text(15, 45, 'текст'); doc.save('custom_fonts.pdf');

lq0910 commented 6 years ago

I have the same problem.