This article describes how the following jspdf generated PDF in the Web page to show, there is a good example, you can refer to the following
The code is as follows: <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 ');//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 (; ) Doc.setfont ("Times"); Doc.setfonttype ("italic"); doc.text ("Hello world!"); /Add text Doc.settextcolor (255,0,0); doc.setfontsize; doc.setfont ("Helvetica"); Doc.setfonttype ("bold"); Doc.text ("This is client-side Javascript, pumping out a PDF."); Doc.addpage ()//Add page &NBSp 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 lines, two coordinates DOC.RECT (100, 50, 20, 30); Draw Rectangle, upper left corner coordinates, width, height, only border Doc.ellipse (M, M, ' F ');/Draw ellipse, center point coordinate, width, height, only edge doc.circle (=,, ' FD ') ;//Draw Circle, center point coordinates, RADIUS, border and fill all have doc.triangle (M,,,, 130, ' FD '); //doc.output (' Datauri '); Direct output to new Web page document.getElementById ("iframe123"). src = doc.output (' datauristring ');//show in IFRAME </script> </head> <body> <iframe id= "iframe123" frameborder= "0" width= " "Height=" ></iframe> </body> </html>