1

Hi I have an AngularJS ng-grid.

I am trying to find a way to use jsPDF to render it as a PDF. I have successfully managed to render PDFs of simple text and complicated SVGs via their URI...however when I try to create an image from the ng-grid the image fails, and when I try to use the jsPDF plugin for fromHtml it takes away all the CSS even though I explicitly add it back in.

Any suggestions?

Here are some related posts but they are not angularJS specific: Export HTML table to pdf using jspdf Export HTML table to pdf using jspdf

I tried doing the exact same thing as the second post and I get all of my data in a long list since angularJS doesn't uses standard tr and tds to make tables...it just a lot of divs with CSS.

Community
  • 1
  • 1
es3735746
  • 841
  • 3
  • 16
  • 40
  • 1
    Have a look at this [plunkr](http://plnkr.co/edit/t4aEBW?p=preview). It uses the ng-grid-pdf-export plugin. – Goodzilla Aug 19 '14 at 09:23

1 Answers1

0

jsPDF worked well after I made my own version of ng-grid-pdf-export.js to use POINTS rather than MM in the calls for the definition of table info. Otherwise, the row spacing was much too large!

steveA
  • 56
  • 1
  • 2