jspdf-autotable

Property 'autoTable' does not exist on type jsPDF

微笑、不失礼 提交于 2019-12-11 06:39:49
问题 I am using angular2 and Node JS . I have installed jspdf and jspdf-autotable both modules using npm . In angular-cli.json file, I have embedded the scripts: "scripts": [ "../node_modules/jspdf/dist/jspdf.min.js", "../node_modules/jspdf-autotable/dist/jspdf.plugin.autotable.js" ], In my component.ts file , I have imported these files as follows: import * as jsPDF from 'jspdf'; import * as autoTable from 'jspdf-autotable'; I have also tried these lines to import jspdf-autotable import {

jsPDF PubSub Error – “No unicode cmap for font”

女生的网名这么多〃 提交于 2019-12-11 05:34:38
问题 I'm trying to add a custom font to jsPDF. I converted my file to base64 and did the following: doc.addFileToVFS("font/rajdhani-regular-webfont.woff", base64enc); where base64enc is the base 64 encoded string then I add the font as follows: doc.addFont('font/rajdhani-regular-webfont.woff', 'rajdhani', 'normal'); doc.setFont('rajdhani'); however, I keep getting the following error [Error] jsPDF PubSub Error – "No unicode cmap for font" – Error: No unicode cmap for font — jspdf.min.js:9068 Error

Different width for each columns in jspdf autotable?

守給你的承諾、 提交于 2019-12-10 02:02:24
问题 My table has 13 columns. How can I get different width for each column? Can I give each column width like this? styles: {overflow: 'linebreak' ,columnWidth: [100,80,80,70,80,80,70,70,70,70,60,80,100]}, My table Syntax: > var res = doc.autoTableHtmlToJson(document.getElementById(tableID)); > doc.autoTable(res.columns, res.data, { styles: {overflow: 'linebreak' > ,columnWidth: [100,80,80,70,80,80,70,70,70,70,60,80,100]}, startY: > 60, bodyStyles: {valign: 'top'}, }); 回答1: You would have to

Exclude Columns in jsPDF AutoTable

我与影子孤独终老i 提交于 2019-12-08 05:33:55
问题 Has somebody experience excluding the columns in the pdf result from a Table using jsPDF autoTable..Would appriciate a little help. 回答1: Anyway, after digging deep in the API and in the examples. I found a solution. jsPDF with autoTable is kinda tricky specially for beginners so for those who will bump in to this predicament in the near fututre. Here's how: var tTB = document.getElementById("myTable"); var atTB = doc.autoTableHtmlToJson(tTB, true); var cols = atTB.columns; //here you are

How can i make a specific row bold?

落爺英雄遲暮 提交于 2019-12-07 09:16:41
问题 I am working on generating a pdf and till now its going fine, but i want some specific rows to be bold. for example see picture : grid template from jspdf-autotable How can i make for example, row with id =1 and id=3 bold? Below my code. function createPDF() { if(vm.activeCompanyYear){ var url = "/coci/report/registry/"+vm.activeCompanyYear; DataApiService.callApi(url,null,"GET").then(function(reportData){ if(reportData){ var doc = new jsPDF('p', 'pt'); var row = 45; addPdfHeader(doc, row, ""

JSPDF-Autotable colspan/rowpan issue

杀马特。学长 韩版系。学妹 提交于 2019-12-04 16:29:48
I have an html table with rowspan/colspan.I am using jspdf and jspdf-autotable for exporting that html table to pdf. However the pdf getting saved has a table which doesn't contain rowspan/colspan in actual table.How to do colspan/rowspan using jspdf-autotable? My current code is <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title id='title'>HTML Page setup Tutorial</title> <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.0.272/jspdf.debug.js"></script> <script src="https://rawgit.com/someatoms/jsPDF-AutoTable/master/dist/jspdf.plugin

how to use jsPDF and jspdf-autotable in angular 5

浪尽此生 提交于 2019-12-04 07:23:17
I am trying to use jsPDF and jspdf-autotable in my Angular 5.2.0 project. My package.json is below (related parts): "dependencies": { ... "jspdf": "^1.3.5", "jspdf-autotable": "^2.3.2" ... } My angular-cli.json is below (related parts): "scripts": [ ... "../node_modules/jspdf/dist/jspdf.min.js", "../node_modules/jspdf-autotable/dist/jspdf.plugin.autotable.js" ... ] My component (related parts ): import * as jsPDF from 'jspdf'; import 'jspdf-autotable'; @Component({ selector: "energy-login", templateUrl: "./login.component.html", styleUrls: ["./login.component.scss"] }) export class MyComponent

Nested tables in a pdf using jspdf and jspdf-autotable

折月煮酒 提交于 2019-12-04 04:54:07
问题 How to achieve nested tables in a PDF using jspdf and jspadf-autotable? Something similar to the picture below: 回答1: There is no native support for having nested tables in jspdf-autotable but you can draw any content (including other autotables) with the didDrawCell hook. var elem = document.getElementById("generate"); elem.onclick = function () { var doc = new jsPDF(); doc.autoTable({ html: '#table', didDrawCell: function (data) { if (data.column.dataKey === 5 && data.cell.section === 'body'

Getting trouble in the jsPdf auto-table Custom width Columns

北城余情 提交于 2019-12-03 22:57:05
问题 Hi all Am trying to Increase my Specified column size Column size , So i used like this {columnStyles: {xxx: {columnWidth: 18}}} , Column size was increased but next lines's are getting affected . That mean's next line is theme: 'grid', mean's it's not working . Can someone clarify me pls . Here is My code , doc.autoTable(getColumns(), getData(), //{columnStyles: {steps: {columnWidth: 65}}}, { theme: 'grid', // 'striped', 'grid' or 'plain' headerStyles: { fillColor: [189, 200, 255], textColor

How to give width, height, x and y coordinates in generating pdf from html using JSPDF new html API

若如初见. 提交于 2019-12-02 14:59:56
问题 I have been using JSPDF to generate pdf document based on some html. Earlier using jspdf fromHTML Api, we could give margins like this var margins2 = { top: 415, bottom: 10, left: 55, width: 300 }; doc.fromHTML(reactListContent, margins2.left, margins2.top, { 'width': margins2.width, 'elementHandlers': specialElementHandlers }, margins2); But, in the new .html API , how can i provide margins, width and height. The new API is like var pdf = new jsPDF('p', 'pt', 'letter'); pdf.html(document