Copy Code code as follows:
<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 ');//Horizontal
Doc.setproperties ({//Set document properties
Title: ' Title ',
Subject: ' This is the subject ',
Author: ' Dragon ',
Keywords: ' JavaScript, Web 2.0, Ajax ',
Creator: ' Meee '
});
Doc.settextcolor (0,255,0);
Doc.setfontsize (22);
Doc.setfont ("Times");
Doc.setfonttype ("italic");
Doc.text, ' Hello world! '; /Add text
Doc.settextcolor (255,0,0);
Doc.setfontsize (16);
Doc.setfont ("Helvetica");
Doc.setfonttype ("bold");
Doc.text, ' This are client-side Javascript, pumping out a PDF. '
Doc.addpage ()//Add page
Doc.setlinewidth (1);//Set line width
Doc.setdrawcolor (0,255,0);//Set Brush color
Doc.setfillcolor (255,0,0);//Set Fill Color
Doc.line (60, 20, 115, 60);//Draw line, two coordinates
Doc.rect (100, 50, 20, 30); Draw Rectangle, upper left corner coordinate, width, height, only border
Doc.ellipse (A, N, ' F '); draw ellipse, center point coordinate, width, height, only edge
Doc.circle (+, ' FD '); Circle, center-point coordinates, radius, border and padding are
Doc.triangle (M, N, a, 130, "FD");
Doc.output (' Datauri ');//Direct output to new Web page
document.getElementById ("iframe123"). src = doc.output (' datauristring ');//Show in IFRAME
}
</script>
<body>
<iframe id= "iframe123" frameborder= "0" width= "height=" ></iframe>
</body>