-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Description
Hi ,
I have requirement to support utf-8 character. I have tried to with Chinese but it did not work . Below is my code , suggest how to support .
index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.min.js" type="text/javascript"></script>
<script src="pdf-lib/dist/jspdf.debug.js"></script>
</head>
<body>
<div id="content">
<h1>The title goes here 正體字/繁體字</h1>
<p>The pararaph goes here</p>
</div><div id="page">
</div>
<button id="submit">Export to PDF</button>
<script src="script2.js"></script>
</body>
</html>
script2.js
var doc = new jsPDF();
var specialElementHandlers = {
'#editor': function (element, renderer) {
return true;
}
};
$('#submit').click(function () {
doc.fromHTML($('#content').html(), 15, 15, {
'width': 190,
'elementHandlers': specialElementHandlers
});
doc.save('sample-page.pdf');
});
Metadata
Metadata
Assignees
Labels
No labels