🌐
npm
npmjs.com › package › jspdf-autotable
jspdf-autotable - npm
npm install jspdf jspdf-autotable · Download jspdf and jspdf-autotable from github · Use a CDN, for example: https://unpkg.com/jspdf and https://unpkg.com/jspdf-autotable · import { jsPDF } from 'jspdf' import { autoTable } from 'jspdf-autotable' ...
      » npm install jspdf-autotable
    
Published   Feb 26, 2025
Version   5.0.2
Author   Simon Bengtsson
🌐
GitHub
github.com › simonbengtsson › jsPDF-AutoTable
GitHub - simonbengtsson/jsPDF-AutoTable: jsPDF plugin for generating PDF tables with javascript
npm install jspdf jspdf-autotable · Download jspdf and jspdf-autotable from github · Use a CDN, for example: https://unpkg.com/jspdf and https://unpkg.com/jspdf-autotable · import { jsPDF } from 'jspdf' import { autoTable } from 'jspdf-autotable' ...
Starred by 2.5K users
Forked by 637 users
Languages   TypeScript 89.5% | HTML 7.6% | JavaScript 2.9%
🌐
GitHub
github.com › JonatanPe › jsPDF-AutoTable
GitHub - JonatanPe/jsPDF-AutoTable
Add the jspdf and jspdf-autotable files to the scripts section in angular-cli.json (see below)
Starred by 17 users
Forked by 4 users
Languages   TypeScript 81.5% | JavaScript 18.5%
🌐
cdnjs
cdnjs.com › home › libraries › jspdf-autotable
jspdf-autotable - Libraries - cdnjs - The #1 free and open source CDN built to make life easier for developers
jspdf-autotable · Generate PDF tables with jsPDF · 2k · GitHub · MIT licensed · Tags: pdf, table, jspdf · Version · 5.0.2 · Loading... Asset Type · All · Loading... https://cdnjs.cloudflare.com/ajax/libs/jspdf-autotable/5.0.2/jspdf.plugin.autotable.min.js ·
🌐
Simonbengtsson
simonbengtsson.github.io › jsPDF-AutoTable
AutoTable sample
It appears you don't have PDF support in this web browser. Click here to download the PDF
🌐
UNPKG
unpkg.com › browse › [email protected] › README.md
jspdf-autotable
```html <script src="bower_components/jspdf/dist/jspdf.min.js"></script> <script src="bower_components/jspdf-autotable/jspdf.plugin.autotable.js"></script> ``` You can also get the plugin with a package manager: - `bower install jspdf-autotable` - `npm install jspdf-autotable` (only client ...
🌐
Appsmith
community.appsmith.com › tutorial › data-driven-pdf-generator-jspdf-and-autotable
Data-Driven PDF Generator with JSPDF and Autotable | Appsmith Community Portal
October 12, 2024 - In this guide, we'll be using the JSPDF library and the JSPDF-AutoTable plug-in to generate PDFs from customer order data. This method builds a PDF programmatically, one line at a time, as opposed to other methods that use a template or HTML. Using this approach, you can input data from any Appsmith datasource, and transform it with JavaScript to generate a PDF from the live data. First we'll install both JSPDF and Auto-Table.
🌐
jsDocs.io
jsdocs.io › package › jspdf-autotable
[email protected] - jsDocs.io
type autoTableInstanceType = (options: UserOptions) => void; type CellHook = (data: CellHookData) => void | boolean; type CellInput = null | string | string[] | number | boolean | CellDef; ... No dependencies.
Find elsewhere
🌐
GitHub
github.com › simonbengtsson › jsPDF-AutoTable › releases
Releases · simonbengtsson/jsPDF-AutoTable
jsPDF plugin for generating PDF tables with javascript - Releases · simonbengtsson/jsPDF-AutoTable
Author   simonbengtsson
Top answer
1 of 11
15

Is working for me Angular 5.

To work with jspdf-autotable in angular 5, one must install jspdf and jspdf-autotable via npm

npm install jspdf --save
npm install @types/jspdf --save-dev
npm install jspdf-autotable --save

also add the jspdf and jspdf-autotable files to the scripts array in angular-cli.json

"scripts": [
"../node_modules/jspdf/dist/jspdf.min.js",
"../node_modules/jspdf-autotable/dist/jspdf.plugin.autotable.js"
],

and in component never import jspdf or jspdf-autotable just.

Forget about the following import.


    import * as jsPDF from 'jspdf'; 
    import 'jspdf-autotable';


Just use Before @Component:

declare var jsPDF: any;

Your component (related parts ):

declare var jsPDF: any;

@Component({
    selector: "energy-login",
    templateUrl: "./login.component.html",
    styleUrls: ["./login.component.scss"]
})

export class MyComponent implements OnInit {

    constructor() {}

    ngOnInit() {}

    downloadPDF() {

        let columns = ["ID", "Name", "Country"];
        let rows = [
            [1, "Shaw", "Tanzania"],
            [2, "Nelson", "Kazakhstan"],
            [3, "Garcia", "Madagascar"],
        ];

        let doc = new jsPDF('l', 'pt');
        doc.autoTable(columns, rows); // typescript compile time error
        doc.save('table.pdf');
        }
    }
2 of 11
12

I was able to please TypeScript like this:

import jsPDF from 'jspdf';
import 'jspdf-autotable';
import { UserOptions } from 'jspdf-autotable';

interface jsPDFWithPlugin extends jsPDF {
  autoTable: (options: UserOptions) => jsPDF;
}
...
const doc = new jsPDF('portrait', 'px', 'a4') as jsPDFWithPlugin;
doc.autoTable({
  head: [['Name', 'Email', 'Country']],
  body: [
    ['David', '[email protected]', 'Sweden'],
    ['Castille', '[email protected]', 'Norway']
  ]
});

Works in Angular 7 (also works in Angular 14)

🌐
CodeSpeedy
codespeedy.com › home › introduction to jspdf – autotable plugin in javascript
Introduction to JsPDF - Autotable plugin in JavaScript - CodeSpeedy
February 12, 2021 - npm install jspdf jspdf-autotable · Using CDN · <script src="jspdf.min.js"></script> <script src="jspdf.plugin.autotable.min.js"></script> Download the jsPDF and jsPDF-autotable from github · This is the base HTML code and it will be used ...
🌐
Rahul Paul
cdns.hashnode.dev › jspdf-autotable-documentation-and-use
jsPDF Autotable Documentation and use
January 25, 2021 - There are commonly three major table themes which are used in this plugin. ... You can also get the plugin with a package manager: bower install jspdf-autotable npm install jspdf-autotable (only client side usage) meteor add jspdf:autotable
🌐
Medium
medium.com › @aalam-info-solutions-llp › creating-dynamic-pdfs-with-jspdf-and-customizing-autotables-in-react-a846a6f3fdca
Creating Dynamic PDFs with JsPDF and Customizing AutoTables in React | by Aalam Info Solutions LLP | Medium
March 6, 2024 - Here, we import the required libraries: jsPDF for PDF generation, jspdf-autotable for creating tables in the PDF, and format from date-fns for formatting dates.
🌐
jsDelivr
cdn.jsdelivr.net › npm › [email protected] › README.md
Jsdelivr
![sample javascript table pdf](samples.png) ### Installation Get the library by doing one of these things: - `npm install jspdf jspdf-autotable` - Download [jspdf](https://raw.githubusercontent.com/MrRio/jsPDF/master/dist/jspdf.min.js) and [jspdf-autotable](https://raw.githubusercontent.co...
🌐
UNPKG
app.unpkg.com [email protected] › files › README.md
UNPKG
![sample javascript table pdf](samples.png) ### Installation Get the library by doing one of these things: - `npm install jspdf jspdf-autotable` - Download [jspdf](https://raw.githubusercontent.com/MrRio/jsPDF/master/dist/jspdf.min.js) and [jspdf-autotable](https://raw.githubusercontent.co...
🌐
YouTube
youtube.com › watch
How to Add Tables to PDF Document Using jsPdf Autotable Library in Javascript - YouTube
Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.
Published   February 4, 2020