You have to install @types/jspdf and @types/jspdf-autotable as dev-dependencies.

If you use yarn:

yarn add -D @types/jspdf @types/jspdf-autotable

For npm use:

npm install @types/jspdf @types/jspdf-autotable --save-dev
Answer from Flo Ragossnig on Stack Overflow
🌐
npm
npmjs.com › package › jspdf-autotable
jspdf-autotable - npm
--></table> autoTable(doc, { html: '#my-table' }) // Or use javascript directly: autoTable(doc, { head: [['Name', 'Email', 'Country']], body: [ ['David', '[email protected]', 'Sweden'], ['Castille', '[email protected]', 'Spain'], // ... ], }) doc.save('table.pdf') You can also use the plugin methods directly on the jsPDF documents:
      » npm install jspdf-autotable
    
Published   Feb 26, 2025
Version   5.0.2
Author   Simon Bengtsson
🌐
GitHub
github.com › JonatanPe › jsPDF-AutoTable
GitHub - JonatanPe/jsPDF-AutoTable
bower install jspdf-autotable · npm install jspdf-autotable (only client side usage) It is also available on cdnjs: <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf-autotable/2.3.5/jspdf.plugin.autotable.js"></script> Note!
Starred by 17 users
Forked by 4 users
Languages   TypeScript 81.5% | JavaScript 18.5%
🌐
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. ... To add a badge like this oneto your package's README, use the codes available below. You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/jspdf-autotable.
🌐
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%
🌐
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
Find elsewhere
🌐
UNPKG
app.unpkg.com [email protected] › files › README.md
jspdf-autotable
```html <script src="bower_components/jspdf/dist/jspdf.min.js"></script> <script src="bower_components/jspdf-autotable/dist/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 side usage) - `meteor add jspdf:autotable` It is also available on cdnjs: ```html <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf-autotable/2.0.16/jspdf.plugin.autotable.js"></script> ``` ### Usage ```javascript var columns = ["ID", "Name", "Country"]; var rows = [ [1, "Shaw", "Tanzania", ...], [2, "Nelson", "Kazakhstan", ...], [3, "Garcia", "Madagascar", ...], ...
🌐
npm
npmjs.com › package › jspdf
jspdf - npm
PDF Document creation from JavaScript. Latest version: 3.0.4, last published: 17 days ago. Start using jspdf in your project by running `npm i jspdf`. There are 2036 other projects in the npm registry using jspdf.
      » npm install jspdf
    
Published   Nov 19, 2025
Version   3.0.4
🌐
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...
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)

🌐
Rahul Paul
cdns.hashnode.dev › jspdf-autotable-documentation-and-use
jsPDF Autotable Documentation and use
January 25, 2021 - 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
🌐
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...
🌐
jsDelivr
jsdelivr.com › package › npm › jspdf-autotable
jspdf-autotable CDN by jsDelivr - A CDN for npm and GitHub
February 26, 2025 - A free, fast, and reliable CDN for jspdf-autotable. Generate pdf tables with javascript (jsPDF plugin)
Published   Aug 24, 2015
🌐
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 for all the below examples.
🌐
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.
🌐
ReversingLabs
secure.software › npm › packages › jspdf-autotable
jspdf-autotable - npm | ReversingLabs Spectra Assure Community
The npm package jspdf-autotable was scanned for malware, software tampering, risky behaviors, exposed secrets and known vulnerabilities.
🌐
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.