You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While creating jsPDF object with below method shows correct character on PDF var doc = new jsPDF('p','pt','a4'); but while creating object with below method and specifying compression as true it shows garbage character on PDF. var doc = new jsPDF({orientation: 'p',unit: 'pt',format: 'a4',compress : true});
I have used Google Noto CJK font after converting otf to ttf and then done base64 of ttf file by using fontconverter page specified in this repo.
Full function is as per below:
function saveAspdf() {
//var doc = new jsPDF('p','pt','a4',true);
var doc = new jsPDF({orientation: 'p',unit: 'pt',format: 'a4',compress : true});
doc.setFont('NotoSansAll-Regular'); // set font
doc.setFontSize(10);
doc.text('Hello world!', 10, 10);
//doc.text("在這裡 我們要吃午餐 應用程式類別", 30, 30);
doc.save('a4.pdf');
}
any help on this will be appreciated..
The text was updated successfully, but these errors were encountered:
I've encountered this issue as well with non-latin characters. For me, image compression seems to go a long way in reducing the filesize, but the compression would probaly be even better.
While creating jsPDF object with below method shows correct character on PDF
var doc = new jsPDF('p','pt','a4');
but while creating object with below method and specifying compression as true it shows garbage character on PDF.var doc = new jsPDF({orientation: 'p',unit: 'pt',format: 'a4',compress : true});
I have used Google Noto CJK font after converting otf to ttf and then done base64 of ttf file by using fontconverter page specified in this repo.
Full function is as per below:
any help on this will be appreciated..
The text was updated successfully, but these errors were encountered: