title: Generate PDF on client side using JSPDF
body: <p>In my application I need to download pdf by parsing HTML on client side itself. For generating pdf on client side I am using jsPdf. Following is my code.</p>
  
  <p><strong>PdfGenerator.java</strong></p>
  
  <pre><code>public static native String createPDF() /*-{
          $wnd.createPDF(); 
  }-*/;
  </code></pre>
  
  <p><strong>entrypoint.html</strong></p>
  
  <pre><code> function createPDF(){
           try {
            var doc = new jsPDF();
             doc.text(20, 20, 'This PDF has a title, subject, author, keywords and a crea');
             doc.output('datauri');
             var out = doc.output();
             var url = 'data:application/pdf;base64,' + Base64.encode(out);
             document.location.href = url;
          } catch (e) {
              return e.message;
          }
          return "";
  };
  </code></pre>
  
  <p>I have added all the js in my project and defined script as well. But whenever I call this method then it is giving output <strong>"sprintf is not defined."</strong>.
  Please let me know if I am missing out something.</p>