Skip to content
This repository
Browse code

Add example code

  • Loading branch information...
commit fae7fef3c2678a56188695c9de8e816886b03b45 1 parent 3c434f3
James Hall authored

Showing 1 changed file with 26 additions and 0 deletions. Show diff stats Hide diff stats

  1. +26 0 README.md
26 README.md
Source Rendered
@@ -6,6 +6,32 @@ You can [catch me on twitter](http://twitter.com/MrRio): [@MrRio](http://twitter
6 6
7 7 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.
8 8
  9 +```javascript
  10 +
  11 + var doc = new jsPDF();
  12 +
  13 + doc.text(20, 20, 'This is the default font.');
  14 +
  15 + doc.setFont("courier");
  16 + doc.setFontType("normal");
  17 + doc.text(20, 30, 'This is courier normal.');
  18 +
  19 + doc.setFont("times");
  20 + doc.setFontType("italic");
  21 + doc.text(20, 40, 'This is times italic.');
  22 +
  23 + doc.setFont("helvetica");
  24 + doc.setFontType("bold");
  25 + doc.text(20, 50, 'This is helvetica bold.');
  26 +
  27 + doc.setFont("courier");
  28 + doc.setFontType("bolditalic");
  29 + doc.text(20, 60, 'This is courier bolditalic.');
  30 +
  31 + doc.save('Test.pdf');
  32 +
  33 +```
  34 +
9 35 ## License
10 36
11 37 (MIT License)

0 comments on commit fae7fef

Please sign in to comment.
Something went wrong with that request. Please try again.