Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jspdf-autotable

Package Overview
Dependencies
Maintainers
1
Versions
129
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jspdf-autotable - npm Package Compare versions

Comparing version 2.0.34 to 2.0.35

2

dist/jspdf.plugin.autotable.js
/**
* jsPDF AutoTable plugin v2.0.34
* jsPDF AutoTable plugin v2.0.35
* Copyright (c) 2014 Simon Bengtsson, https://github.com/simonbengtsson/jsPDF-AutoTable

@@ -4,0 +4,0 @@ *

@@ -11,5 +11,2 @@ ## Examples for jspdf-autotable

### Important module bundler note
Use `jspdf.plugin.autotable.umd.js` with module bundlers. The other dist files do not include requirejs support as a bundled version of requirejs in versions <= 1.2.61 complicates matters.
Also note that jspdf 1.2.61 does not work well with module bundlers. You have get the latest files from the jspdf repository or use `examples/libs/jspdf.min.js` in this repo. The examples depend `github:mrrio/jsPDF#76edb3387cda3d5292e212765134b06150030364` instead of a specific version for this reason.
Note that jspdf versions before 1.3 does not work well with module bundlers.
{
"name": "jspdf-autotable",
"version": "2.0.34",
"version": "2.0.35",
"description": "Generate pdf tables with javascript (jsPDF plugin)",

@@ -10,3 +10,3 @@ "main": "dist/jspdf.plugin.autotable.umd.js",

"dependencies": {
"jspdf": "github:mrrio/jsPDF#76edb3387cda3d5292e212765134b06150030364"
"jspdf": "^1.3.2"
},

@@ -13,0 +13,0 @@ "devDependencies": {

@@ -31,4 +31,3 @@ # AutoTable - Table plugin for jsPDF

Tested with IE10, IE11 and modern browsers (chrome, edge, firefox and safari). It will probably work with <IE10 as well
but you might have to use an old versions of jspdf and/or add polyfills.
Tested with IE10, IE11 and modern browsers (chrome, edge, firefox and safari). It will probably work with < IE10 as well but you might have to use an old version of jspdf and/or add polyfills.

@@ -52,2 +51,4 @@ ### Usage

You can also use it with webpack, requirejs and other module bundlers ([examples](examples)).
### Usage with options

@@ -86,10 +87,40 @@

### Usage with module bundlers
Use the `dist/jspdf.plugin.autotable.umd.js` with javascript bundlers such as requirejs and browserify. This plugin does no longer export umd in the default dist files as jspdf `<= 2.61` breaks umd by bundling a version of requirejs.
The jspdf library itself has spotty support for module bundlers so you do have to make sure that you use a compatibly version of jspdf. I have had troubles with all official releases up to and including 1.2.61, but the dist files in the jspdf repo should work.
### Usage with Angular 2 (angular cli v1.0.0-beta.14)
For more information, check out the [examples](examples) and their readme.
- In an angular cli project run `npm install jspdf-autotable --save`
- Add the `jspdf` and `jspdf-autotable` files to the scripts section in `angular-cli.json` (see below)
- Declare jsPDF as a global variable `declare var jsPDF: any;`, and use as normal in any component
```js
// angular-cli.json
"scripts": [
"../node_modules/jspdf/dist/jspdf.min.js",
"../node_modules/jspdf-autotable/dist/jspdf.plugin.autotable.js"
],
```
```js
// app.component.ts or any other component
import { Component } from '@angular/core';
declare var jsPDF: any; // Important
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'app works!';
constructor() {
var doc = new jsPDF('p', 'pt');
doc.autoTable(columns, data);
doc.save("table.pdf");
}
}
```
### Options

@@ -170,2 +201,4 @@ All options below are used in `examples.js` so be sure to check it out if in doubt.

*OBS!* Only the `drawCell` hook can be used with the native style jspdf style changes such as `doc.setFillColor`. If you use the other hooks for changing styles, they will be overriden.
### Helper functions

@@ -176,17 +209,6 @@ - `autoTableHtmlToJson(tableElem, includeHiddenElements)` Use it to generate the javascript objects required for this library from an html table (see `from html` example). If includeHiddenElements is set to true hidden rows and columns will be included otherwise excluded.

### Upgrade to Version 2.0 from 1.x
- Use the hooks (or styles and themes) instead of `renderCell`, `renderHeaderCell`, `renderFooter`and `renderHeader`
- Custom column width now specified with the style columnWidth
- Use `tableWidth` instead of `extendWidth`
- Use `columnWidth: 'wrap'` instead of `overflowColumns`
- Use `pageBreak` instead of `avoidPageSplit`
- Use `margin` instead of `margins`
- `autoTableHtmlToJson` now always returns an object
- Use `API.autoTableEndPosY()` instead of `API.autoTableEndPos()`
- Use column.x instead of cursor.x
### Other pdf libraries
- [pdfmake (javascript)](https://github.com/bpampuch/pdfmake) I much prefer the coding style of jspdf over pdfmake, however the tables features of pdfmake are great.
- [Included jsPDF table plugin](https://github.com/MrRio/jsPDF/blob/master/jspdf.plugin.cell.js) No up to date documentation of how to use it (?) and has bugs. You might find it useful however.
- [pdfmake (javascript)](https://github.com/bpampuch/pdfmake) I much prefer the coding style of jspdf over pdfmake, however the tables features of pdfmake are great. And pdfmake have proper support for utf-8 which jspdf lacks.
- [Included jsPDF table plugin](https://github.com/MrRio/jsPDF/blob/master/jspdf.plugin.cell.js) No up to date documentation of how to use it (?) and has bugs.
- [fpdf (php)](http://www.fpdf.org/) and [pdfbox (java)](https://pdfbox.apache.org/) No included table features and have to be used server side.

@@ -198,3 +220,3 @@

### Contributions
Contributions are always welcome, especially on open issues or for items in the future work section below. If you have something major you want to add or change, please post an issue about it first.
Contributions are always welcome, especially on open issues. If you have something major you want to add or change, please post an issue about it first to discuss it further. The workflow for contributing would be something like this:

@@ -210,2 +232,2 @@ - Make code changes

- Manually verify files and look over the examples
- Deploy with `npm run deploy`
- Deploy with `npm run deploy`

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc