Jspdf doesn't seem to support Chinese
Copy Code code as follows:
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 strict//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >
<title>Downloadify</title>
<meta http-equiv= "Content-type" content= "Text/html;charset=utf-8" >
<style type= "text/css" media= "screen" >
Body {background: #fff; width:500px; margin:20px auto;
Input, textarea, p {font-family: XXFarEastFont-Arial, blackbody; font-size:12pt;}
Input, textarea {border:solid 1px #aaa; padding:4px; width:98%;}
</style>
<script type= "Text/javascript" src= "Js/swfobject.js" ></script>
<script type= "Text/javascript" src= "Js/downloadify.js" ></script>
<script type= "Text/javascript" src= "Js/jspdf.js" ></script>
<!--<script type= "Text/javascript" src= "Js/downloadify.min.js" ></script>-->
<script type= "Text/javascript" >
Window.load=function () {
Downloadify.create (' downloadify ', {
Filename:function () {
return document.getElementById (' filename '). Value;
},
Data:function () {
var doc = new jspdf ();
Doc.text, document.getElementById (' data '). Value);
Doc.addpage ();
Doc.text, document.getElementById (' data '). Value);
return Doc.output ();
},
Oncomplete:function () {alert (' successfully save file! ');},
Oncancel:function () {alert (' You have canceled saving file ');},
Onerror:function () {alert (' error occurred ');},
SWF: ' js/downloadify.swf ',
Downloadimage: ' Js/download.png ',
WIDTH:100,
Height:30,
Transparent:true,
Append:false
});
}
</script>
<body onload= "load ();" >
<input type= "text" name= "filename" value= "filename. pdf" id= "filename"/><br/>
<textarea cols= "rows=" name= "Data" id= "data" >it seem do not support to chinese</textarea>
<p id= "Downloadify" >you must have Flash installed to download this file.</p>
</body>