2

I want to export a part of my html code to pdf, for this I am using the following code :

<script language = "JAVASCRIPT">
var doc = new jsPDF();
var specialElementHandlers = {
    '#editor': function (element, renderer) {
    return true;
    }
};
$('#download').click(function () {
    doc.fromHTML($('#mytable').html(), 15, 15, {
    'width': 170,
        'elementHandlers': specialElementHandlers
    });
    doc.save('sample-file.pdf');
});
</script>

but it doesn't support CSS .. how can I export it with its style ?

Łukasz
  • 2,131
  • 1
  • 13
  • 28
Insaf
  • 39
  • 1
  • 10
  • 1
    Possible duplicate of [Exporting PDF with jspdf not rendering CSS](http://stackoverflow.com/questions/25946275/exporting-pdf-with-jspdf-not-rendering-css) – Sofiene Djebali May 22 '16 at 01:51

1 Answers1

0

What data do you want to export?

If you want to export an HTML <table>, you can take a look at this export sample provided by the Shield UI Grid widget.

Vladimir Georgiev
  • 1,949
  • 23
  • 26