Closed learnku closed 3 years ago
<script src="/ajax/libs/tableExport/tableExport.js"></script> <script src="/ajax/libs/tableExport/libs/FileSaver/FileSaver.min.js"></script> <script src="/ajax/libs/tableExport/libs/jsPDF/jspdf.min.js"></script> <script src="/ajax/libs/tableExport/libs/jsPDF-AutoTable/jspdf.plugin.autotable.js"></script> <script src="/ajax/libs/tableExport/libs/js-xlsx/xlsx.core.min.js"></script> <script src="/ajax/libs/tableExport/libs/pdfmake/vfs_fonts.js"></script> <script src="/ajax/libs/tableExport/libs/pdfmake/ZCOOLXiaoWei_fonts.js"></script>
$("#download-pdf").click(function () { $('#previewTable').tableExport({ fileName: pageQuery.fileName, type: 'pdf', jspdf: { orientation: 'l', format: 'a4', margins: {left:10, right:10, top:20, bottom:20}, autotable: { tableWidth: 'auto' } }, pdfmake:{ enabled:false, docDefinition:{ pageOrientation:'landscape', defaultStyle: { font: 'ZCOOLXiaoWei' } } } }) });
There is an example file using pdfmake to export a chinese table. jspdf is currently not able to do that. In your source code snippet you disabled pdfmake.
引用文件
JS 调用
乱码截图