Permalink
Browse files

Add example code

  • Loading branch information...
1 parent 3c434f3 commit fae7fef3c2678a56188695c9de8e816886b03b45 @MrRio committed Dec 29, 2012
Showing with 26 additions and 0 deletions.
  1. +26 −0 README.md
View
26 README.md
@@ -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)

0 comments on commit fae7fef

Please sign in to comment.