JsPDF does not seem to support Chinese Characters
Copy codeThe Code is as follows:
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Strict // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<Html xmlns = "http://www.w3.org/1999/xhtml" lang = "en" xml: lang = "en">
<Head>
<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:,; 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 (20, 20, document. getElementById ('data'). value );
Doc. addPage ();
Doc. text (20, 20, document. getElementById ('data'). value );
Return doc. output ();
},
OnComplete: function () {alert ('file saved! ');},
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>
</Head>
<Body onload = "load ();">
<Input type = "text" name = "filename" value = "file name" id = "filename"/> <br/>
<Textarea cols = "60" rows = "10" name = "data" id = "data"> it seem do not support to Chinese </textarea>
<P id = "downloadify"> You must have Flash 10 installed to download this file. </p>
</Body>
</Html>