Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add example code

  • Loading branch information...
commit fae7fef3c2678a56188695c9de8e816886b03b45 1 parent 3c434f3
James Hall authored
Showing with 26 additions and 0 deletions.
  1. +26 −0 README.md
26 README.md
View
@@ -6,6 +6,32 @@ You can [catch me on twitter](http://twitter.com/MrRio): [@MrRio](http://twitter
See examples/basic.html. Make sure you include BlobBuilder.js and FileSaver.js. You'll need to make sure you've pulled all the submodules.
+```javascript
+
+ var doc = new jsPDF();
+
+ doc.text(20, 20, 'This is the default font.');
+
+ doc.setFont("courier");
+ doc.setFontType("normal");
+ doc.text(20, 30, 'This is courier normal.');
+
+ doc.setFont("times");
+ doc.setFontType("italic");
+ doc.text(20, 40, 'This is times italic.');
+
+ doc.setFont("helvetica");
+ doc.setFontType("bold");
+ doc.text(20, 50, 'This is helvetica bold.');
+
+ doc.setFont("courier");
+ doc.setFontType("bolditalic");
+ doc.text(20, 60, 'This is courier bolditalic.');
+
+ doc.save('Test.pdf');
+
+```
+
## License
(MIT License)
Please sign in to comment.
Something went wrong with that request. Please try again.