jsPDF && jsPDF AutoTable print spcial chars to PDF
Your issue is probably related to that jspdf does not support utf-8. Follow updates regarding it in this issue. The spacing issue is also mentioned there. Another good option for generating pdf files is pdfmake. It fully supports utf-8 characters.
jsPDF Corrupt PDFs?
I had similar problem, and this is how is solved it. I used Blob.js, canvas-toBlob, FileSaver. I also noticed that latest BlobBuilder.min.js is not working correcly, so I used BlobBuilder.js instead.
var content = canvas.toDataURL('image/jpeg');
var doc = new jsPDF('landscape');
doc.addImage(content, 'JPEG', 0, 0);
var data = doc.output();
var buffer = new ArrayBuffer(data.length);
var array = new Uint8Array(buffer);
for (var i = 0; i < data.length; i++) {
array[i] = data.charCodeAt(i);
}
var blob = new Blob(
[array],
{type: 'application/pdf', encoding: 'raw'}
);
saveAs(blob, filename);
Related Topics
How to Put a Variable in an Src Attribute
How to Remove a Parameter from a Url
Detect If Page Is Load from Back Button
Disabled Button Onclick Event Fires
Node Server Running But Localhost Refusing to Connect
Get a List of Dates Between Two Dates Using JavaScript
Filereader Onload With Result and Parameter
Reactjs Dynamic Drop Down Populated With Map Function
Detect Click into Iframe Using JavaScript
How to Close Current Tab in a Browser Window
Javascript Onclick Increment Number
How to Convert Seconds to Minutes and Hours in JavaScript
How to Set an Iframe Src Attribute from a Variable in Angularjs
How to Call a Function When Element Is Loaded At Angular
Javascript: Check If Page Is At the Top
How to Include Third Party Js Libraries in React App