hhurz / tableExport.jquery.plugin

jQuery plugin to export a html table to JSON, XML, CSV, TSV, TXT, SQL, Word, Excel, PNG and PDF
MIT License
990 stars 716 forks source link

Export to PDF with images, control size of image? #372

Closed evbrew closed 7 months ago

evbrew commented 1 year ago

I took the file \test\cssPdf.html and added some IMG tags to the table cells. When exporting to PDF the images are very tiny (maybe 15x15 pixels) and regardless of which css or html width and height attributes i set it doesn't change the image size. Am i missing something?

hhurz commented 1 year ago

You could try to use the jspdf > autotable: > styles option rowHeight:

$('#pdfstyles').tableExport({type:'pdf',
                             jspdf: {orientation: 'p',
                                     margins: {right: 20, left: 20, top: 30, bottom: 30},
                                     autotable: {styles: {rowHeight: 72},
                                                 tableWidth: 'wrap'}}});