JSPDF

by arvillarruel

HTML

<script src="//cdnjs.cloudflare.com/ajax/libs/jspdf/0.9.0rc1/jspdf.js"></script>
<div id="dialog-pdf" title="pdf" stye="display:none;">
  <div id="content">



  </div>



  <div id="editor"></div>
  <a href="#" id="cmd">generate PDF</a>

</div>

JavaScript

$(document).ready(function() {
  var doc = new jsPDF();



  doc.setFont("helvetica");
  // Black line

  //1.Reach
  doc.setFontSize(18);
  doc.text(15, 40, 'User');
  //1.1 Reach Value
  doc.text(50, 40, '345678');
  //2.Users
  doc.text(15, 50, 'Users');
  //2.1Users Value
  doc.text(50, 50, '8976545');
  //3.Mentions
  doc.text(15, 60, 'Mentions');
  //3.1 Mentions Value
  doc.text(50, 60, '3523566');


  //3.Stakeholders
  doc.setFontSize(12);
  doc.text(15, 133, 'Reach');
  //1.1 Reach Value
  doc.text(40, 133, '345678');


  //2.Users
  doc.text(15, 142, 'Users');
  //2.1Users Value
  doc.text(40, 142, '8976545');
  //3.Mentions
  doc.text(15, 151, 'Mentions');
  //3.1 Mentions Value
  doc.text(40, 151, '3523566');

  // General Participation table


  doc.setFontSize(12);
  //General Participation table 1.Engagement
  doc.text(20, 100, 'Engagement');
  //General Participation table 2.Users
  doc.text(88, 100, 'Participant');
  //General Participation table 3.Mentions
  doc.text(160, 100, 'Reach');

  //Stakeholders Participation table
  //Stakeholders Participation table 1.Engagement
  doc.text(20, 185, 'Engagement');
  //Stakeholders Participation table 2.Users
  doc.text(88, 185, 'Participant');
  //Stakeholders Participation table 3.Mentions
  doc.text(160, 185, 'Reach');




  doc.setFontType("bold");
  //General Participation table 1.1 Engagement Value
  doc.text(20, 105, '3456678078');
  //General Participation table 2.1Users Value
  doc.text(88, 105, '897654677745');
  //General Participation table 3.1 Mentions Value
  doc.text(160, 105, '3523547477366');

  //Stakeholders Participation table 1.1 Engagement Value
  doc.text(20, 190, '389001234567');
  //Stakeholders Participation table 2.1Users Value
  doc.text(88, 190, '09876987543');
  //Stakeholders Participation table 3.1 Mentions Value
  doc.text(160, 190, '23456678899900');


  //Gray Line
  doc.setDrawColor(0);
  doc.setFillColor(183, 183, 183);
  doc.rect(0, 3, 205, 10, 'F'); // filled red...