Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Lightning Talk: jsPDF

2,674 views

Published on

Lightning talk @ Taipei Javascript Enthusiasts Meetup on May 29, 2014
http://www.meetup.com/javascript-enthusiasts/

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Lightning Talk: jsPDF

  1. 1. jsPDF Jui-Shan (Jenny) Liang May 2014 @ Taipei Javascript Enthusiasts Meetup
  2. 2. About Me • Software Developer / IBM Taiwan • Open Source Enthusiast: http://github.com/jsliang • JavaScript/CSS/HTML/Python/… • Web Team Member of PyCon Taiwan 2013 • Session Convener Member of COSCUP 2014 • Registration opens 6/3. Stay tuned!
 http://coscup.org/
  3. 3. jsPDF a CLIENT-side approach to PDF generation
  4. 4. not PDF.js which displays PDF with JavaScript + HTML5
 https://github.com/mozilla/pdf.js
  5. 5. http://jspdf.com (live demo) https://github.com/MrRio/jsPDF
  6. 6. PDF Download • <a id="downloadPDF" href="#">Download PDF</a> • document.getElementById("downloadPDF").href = pdf.output('datauristring'); • Not stable in IE.
  7. 7. PDF Preview • <iframe id="showPDF" width="100%" height="550"></ iframe> • document.getElementById("showPDF").src = pdf.output('datauristring'); • Note: I made these observations on March, 2014. These results might change overtime. • O: Chrome, Safari • X: Firefox, IE, mobile devices • Not supporting data URI string in <iframe src=“…”> • PDF.js to the rescue? Haven’t confirmed with that…
  8. 8. Limitations • https://github.com/MrRio/jsPDF/issues • Note: the latest version is v1.0.138 when this deck is made. • Browser support • Reference:
 Can I use Data URIs? http://caniuse.com/datauri • UTF-8 support • …
  9. 9. Why jsPDF …if it’s not so stable?
  10. 10. Backend resources can be costly. computational power, network bandwidth, …
  11. 11. A Sample Project Sheetaholics (http://jsliang.com/sheetaholics) a notebook sheet generator ! WAS written with Python + reportlab/wxPython NOW written with JavaScript + jsPDF
  12. 12. Thank You

×