نسخ رمز رمز على النحو التالي:
<html>
<head>
<meta http-equiv = "content-type" content = "text/html ؛ charset = gbk">
<title> jspdf </title>
<script type = "text/javaScript" src = "jspdf.js"> </script>
<script type = "text/javaScript">
window.onload = function () {
var doc = new JSPDF () ؛
// var doc = New JSPDF ('Landscape') ؛
Doc.SetProperties ({// قم بتعيين سمة المستند
العنوان: "العنوان" ،
الموضوع: "هذا هو الموضوع" ،
المؤلف: "التنين" ،
الكلمات الرئيسية: "JavaScript ، Web 2.0 ، Ajax" ،
المبدع: 'meee'
}) ؛
Doc.settextColor (0،255،0) ؛
Doc.SetFontSize (22) ؛
Doc.SetFont ("Times") ؛
doc.setfonttype ("italic") ؛
Doc.Tex (20 ، 20 ، "Hello World!") ؛
Doc.settextColor (255،0،0) ؛
Doc.SetFontSize (16) ؛
Doc.SetFont ("Helvetica") ؛
Doc.SetFontType ("Bold") ؛
Doc.Text (20 ، 30 ، "هذا هو JavaScript بحجم العميل ، يضخ PDF.") ؛
doc.addpage () ؛
Doc.SetlineWidth (1) ؛
Doc.setdrawcolor (0،255،0) ؛
Doc.SetFillColor (255،0،0) ؛
Doc.line (60 ، 20 ، 115 ، 60) ؛
Doc.Rect (100 ، 50 ، 20 ، 30)
Doc.ellipse (20 ، 20 ، 20 ، 10 ، 'F') ؛
Doc.Circle (120 ، 20 ، 20 ، 'FD') ؛
DOC.TRIANGE (100 ، 100 ، 110 ، 100 ، 120 ، 130 ، 'fd') ؛
//doc.output ('datauri') ؛ // الإخراج مباشرة إلى صفحة الويب الجديدة
document.getElementById ("iframe123").
}
</script>
</head>
<body>
<iframe id = "iframe123" frameborder = "0"> </frame>
</body>
</html>