jspdf-autotable
Advanced tools
Comparing version 2.0.34 to 2.0.35
/** | ||
* 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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
GitHub dependency
Supply chain riskContains a dependency which resolves to a GitHub URL. Dependencies fetched from GitHub specifiers are not immutable can be used to inject untrusted code or reduce the likelihood of a reproducible install.
Found 1 instance in 1 package
2140343
19147
227
0
3
26
+ Addedabab@1.0.4(transitive)
+ Addedacorn@2.7.0(transitive)
+ Addedacorn-globals@1.0.9(transitive)
+ Addedajv@6.12.6(transitive)
+ Addedarray-equal@1.0.2(transitive)
+ Addedasn1@0.2.6(transitive)
+ Addedassert-plus@1.0.0(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedaws-sign2@0.7.0(transitive)
+ Addedaws4@1.13.2(transitive)
+ Addedbase64-arraybuffer@0.1.5(transitive)
+ Addedbcrypt-pbkdf@1.0.2(transitive)
+ Addedcanvg@1.5.3(transitive)
+ Addedcaseless@0.12.0(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedcore-util-is@1.0.2(transitive)
+ Addedcss-line-break@1.0.1(transitive)
+ Addedcssom@0.3.8(transitive)
+ Addedcssstyle@0.2.37(transitive)
+ Addeddashdash@1.14.1(transitive)
+ Addeddeep-is@0.1.4(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedecc-jsbn@0.1.2(transitive)
+ Addedescodegen@1.14.3(transitive)
+ Addedesprima@4.0.1(transitive)
+ Addedestraverse@4.3.0(transitive)
+ Addedesutils@2.0.3(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedextsprintf@1.3.0(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedfast-levenshtein@2.0.6(transitive)
+ Addedforever-agent@0.6.1(transitive)
+ Addedform-data@2.3.3(transitive)
+ Addedgetpass@0.1.7(transitive)
+ Addedhar-schema@2.0.0(transitive)
+ Addedhar-validator@5.1.5(transitive)
+ Addedhtml2canvas@1.0.0-alpha.12(transitive)
+ Addedhttp-signature@1.2.0(transitive)
+ Addediconv-lite@0.4.24(transitive)
+ Addedis-typedarray@1.0.0(transitive)
+ Addedisstream@0.1.2(transitive)
+ Addedjsbn@0.1.1(transitive)
+ Addedjsdom@8.5.0(transitive)
+ Addedjson-schema@0.4.0(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedjson-stringify-safe@5.0.1(transitive)
+ Addedjspdf@1.5.3(transitive)
+ Addedjsprim@1.4.2(transitive)
+ Addedlevn@0.3.0(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addednwmatcher@1.4.4(transitive)
+ Addedoauth-sign@0.9.0(transitive)
+ Addedomggif@1.0.7(transitive)
+ Addedoptionator@0.8.3(transitive)
+ Addedparse5@1.5.1(transitive)
+ Addedperformance-now@2.1.0(transitive)
+ Addedprelude-ls@1.1.2(transitive)
+ Addedpromise-polyfill@8.1.0(transitive)
+ Addedpsl@1.15.0(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedqs@6.5.3(transitive)
+ Addedrequest@2.88.2(transitive)
+ Addedrgbcolor@1.0.1(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsax@1.4.1(transitive)
+ Addedsource-map@0.6.1(transitive)
+ Addedsshpk@1.18.0(transitive)
+ Addedstackblur-canvas@1.4.12.2.0(transitive)
+ Addedsymbol-tree@3.2.4(transitive)
+ Addedtough-cookie@2.5.0(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedtunnel-agent@0.6.0(transitive)
+ Addedtweetnacl@0.14.5(transitive)
+ Addedtype-check@0.3.2(transitive)
+ Addeduri-js@4.4.1(transitive)
+ Addeduuid@3.4.0(transitive)
+ Addedverror@1.10.0(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@2.0.1(transitive)
+ Addedword-wrap@1.2.5(transitive)
+ Addedxml-name-validator@2.0.1(transitive)
+ Addedxmldom@0.1.31(transitive)
Updatedjspdf@^1.3.2