pdfmake

PDFmake: pdfmake.createPdf is not a function

二次信任 提交于 2021-02-08 13:42:28
问题 After installing pdfmake using npm: npm install pdfmake --save-dev and compiling bundles with webpack I get an error when running: pdfmake = require 'pdfmake' pdfmake.createPdf(doc_definition).download('test.pdf') Saying: pdfmake.createPdf is not a function I've read this suggestion, installed the script-loader and changed the requirement to: pdfmake = require 'script!pdfmake' But that gave even more errors. Besides, I wouldn't know what that script loader would be needed. Any suggestions?

PDFmake: pdfmake.createPdf is not a function

情到浓时终转凉″ 提交于 2021-02-08 13:42:28
问题 After installing pdfmake using npm: npm install pdfmake --save-dev and compiling bundles with webpack I get an error when running: pdfmake = require 'pdfmake' pdfmake.createPdf(doc_definition).download('test.pdf') Saying: pdfmake.createPdf is not a function I've read this suggestion, installed the script-loader and changed the requirement to: pdfmake = require 'script!pdfmake' But that gave even more errors. Besides, I wouldn't know what that script loader would be needed. Any suggestions?

pdfMake generate rows dynamically

丶灬走出姿态 提交于 2021-02-08 09:58:59
问题 guys I am using pdfMake to generate PDF's, and I have to generate rows dynamically. I have achieved this only generating table but I don't know how to generate rows dynamically my code looks like this: generateRows(payrolls){ var tempObj = {} var tempArr = []; for(var i=0; i<payrolls.length; i++){ tempArr.push( { ID: payrolls[i].wageTypeId, description: payrolls[i].wageType.description, amount: payrolls[i].amount, unit: payrolls[i].unit, total: payrolls[i].total } ); } return tempArr; }

Datatables - uncaught malformed table row a cell is undefined when trying to export to PDF

人盡茶涼 提交于 2021-01-29 13:49:19
问题 I have the below table, <table id="dtBasicExample" class="table table-bordered" style="border : none;"> <thead class="text-info" style="border : none;"> <tr> <th colspan="16" style="border : none;"></th> </tr> <tr> <th colspan="2" class="text-right" style="border : none;">Date</th> <th colspan="14" style="border : none;">: <%=dstart%> - <%=dend%></th> </tr> <tr> <th colspan="2" class="text-right" style="border:none;">Personel</th> <th colspan="14" style="border : none;">: <%=pers%></th> </tr>

How to remove dropdown select options from pdf in datatable

為{幸葍}努か 提交于 2021-01-29 06:42:05
问题 I have included dropdown to each column at footer, while generating pdf,all options are coming into header.how can we exclude these option while export? Here is my code: $('#example').DataTable( { "dom": 'Bfirtlp', buttons: [ { extend: 'excelHtml5', exportOptions: { columns: ':visible' } }, { extend: 'pdfHtml5', orientation: 'landscape', pageSize: 'A3', exportOptions: { columns: [ 0, 1, 2,3,4,5,6,7,8], }, ], initComplete: function () { this.api().columns().every( function () { var column =

How can I use pdfmake custom fonts in Angular without using the gulp tool?

孤街浪徒 提交于 2020-08-20 07:19:41
问题 The standard method for installing custom font files is via the gulp tool, and that's described here: https://pdfmake.github.io/docs/fonts/custom-fonts-client-side/ But if that fails for you, and for me on Windows it seemed to be a rabbit hole, surely there's another way to get the data in place. Yep. Option 1 is to modify the vsf_fonts.js and pdfmake.js in the node_modules/pdfmake/build directory. In the first you're going to add your data, and in the second your're going to modify the

How to import custom fonts for PDFMake in Angular application?

為{幸葍}努か 提交于 2020-07-10 03:37:07
问题 I just started reading into PDFMake's documentation to build a document in my Angular app, I've come across some questions like this one but never got an answer. I was wondering if someone knows or could provide a readable example of how to import custom fonts for PDFMake in an Angular application, I've downloaded the files for the "Lato" font, but I have no clue on where to proceed now. I did import the library as shown on the documentation: import pdfMake from 'pdfmake/build/pdfmake';