Comparing version 1.4.1 to 1.5.1
{ | ||
"name": "jspdf", | ||
"version": "1.4.1", | ||
"version": "1.5.1", | ||
"homepage": "https://github.com/mrrio/jspdf", | ||
@@ -10,2 +10,4 @@ "description": "PDF Document creation from JavaScript", | ||
"dist/jspdf.min.js", | ||
"dist/jspdf.node.debug.js", | ||
"dist/jspdf.node.min.js", | ||
"README.md" | ||
@@ -22,42 +24,56 @@ ], | ||
"dependencies": { | ||
"canvg": "1.5.3", | ||
"cf-blob.js": "0.0.1", | ||
"file-saver": "2.0.0", | ||
"html2canvas": "1.0.0-alpha.12", | ||
"omggif": "1.0.7", | ||
"stackblur": "^1.0.0", | ||
"canvg": "^1.0", | ||
"file-saver": "1.3.8" | ||
"promise-polyfill": "8.1.0", | ||
"stackblur-canvas": "2.2.0" | ||
}, | ||
"devDependencies": { | ||
"babel-core": "6.26.0", | ||
"babel-preset-es2015": "6.24.1", | ||
"babel-preset-es2015-rollup": "3.0.0", | ||
"codeclimate-test-reporter": "^0.5.0", | ||
"@babel/core": "^7.2.2", | ||
"@babel/plugin-external-helpers": "7.2.0", | ||
"@babel/preset-env": "^7.2.0", | ||
"babel-plugin-rewire-exports": "1.0.1", | ||
"codeclimate-test-reporter": "0.5.1", | ||
"diff": "3.5.0", | ||
"docdash": "0.4.0", | ||
"jasmine-core": "2.99.1", | ||
"docdash": "1.0.1", | ||
"folder-delete": "1.0.3", | ||
"gulp-babel": "^8.0.0", | ||
"jasmine-core": "3.3.0", | ||
"jasmine-expect": "^3.8.4", | ||
"jasmine-matchers": "^0.2.3", | ||
"js-yaml": "3.12.0", | ||
"jsdoc": "3.5.5", | ||
"karma": "2.0.2", | ||
"karma-babel-preprocessor": "7.0.0", | ||
"karma": "3.1.4", | ||
"karma-babel-preprocessor": "^8.0.0-beta.0", | ||
"karma-chrome-launcher": "2.2.0", | ||
"karma-coverage": "1.1.2", | ||
"karma-chrome-launcher": "2.2.0", | ||
"karma-firefox-launcher": "1.1.0", | ||
"karma-ie-launcher": "1.0.0", | ||
"karma-firefox-launcher": "1.1.0", | ||
"karma-jasmine": "1.1.1", | ||
"karma-jasmine": "^2.0.0", | ||
"karma-jasmine-matchers": "^3.8.3", | ||
"karma-mocha-reporter": "2.2.5", | ||
"karma-sauce-launcher": "1.2.0", | ||
"karma-verbose-reporter": "0.0.6", | ||
"karma-sauce-launcher": "1.2.0", | ||
"local-web-server": "2.5.2", | ||
"local-web-server": "2.6.0", | ||
"markdown": "0.5.0", | ||
"rollup": "0.60.0", | ||
"rollup-plugin-babel": "3.0.4", | ||
"uglify-js": "3.4.0" | ||
"rollup": "0.68.1", | ||
"rollup-plugin-babel": "4.1.0", | ||
"rollup-plugin-node-resolve": "3.4.0", | ||
"uglify-js": "3.4.9" | ||
}, | ||
"resolutions": { | ||
"canvg": "1.5.3" | ||
}, | ||
"scripts": { | ||
"start": "ws", | ||
"build": "npm install && node build.js", | ||
"build": "npm install && node build.js && node build.js type=node", | ||
"version": "npm run build && git add -A dist", | ||
"test": "./node_modules/.bin/karma start saucelabs.karma.conf.js --single-run --verbose && for a in coverage/*; do codeclimate-test-reporter < \"$a/lcov.info\"; break; done", | ||
"test-local": "node tests/utils/reference-server.js & karma start", | ||
"generate-docs": "node_modules/.bin/jsdoc -c jsdoc.json --readme README.md" | ||
"test-local": "./node_modules/.bin/karma start karma.conf.js", | ||
"test-training": "node tests/utils/reference-server.js", | ||
"delete-docs": "node deletedocs.js", | ||
"generate-docs": "./node_modules/.bin/jsdoc -c jsdoc.json --readme README.md" | ||
} | ||
} |
# jsPDF | ||
[![Greenkeeper badge](https://badges.greenkeeper.io/MrRio/jsPDF.svg)](https://greenkeeper.io/) | ||
[![Build Status](https://saucelabs.com/buildstatus/jspdf)](https://saucelabs.com/beta/builds/526e7fda50bd4f97a854bf10f280305d) | ||
[![Code Climate](https://codeclimate.com/repos/57f943855cdc43705e00592f/badges/2665cddeba042dc5191f/gpa.svg)](https://codeclimate.com/repos/57f943855cdc43705e00592f/feed) | ||
[![Test Coverage](https://codeclimate.com/repos/57f943855cdc43705e00592f/badges/2665cddeba042dc5191f/coverage.svg)](https://codeclimate.com/repos/57f943855cdc43705e00592f/coverage) | ||
[![GitHub license](https://img.shields.io/github/license/MrRio/jsPDF.svg)](https://github.com/MrRio/jsPDF/blob/master/LICENSE) | ||
[![Code Climate](https://codeclimate.com/repos/57f943855cdc43705e00592f/badges/2665cddeba042dc5191f/gpa.svg)](https://codeclimate.com/repos/57f943855cdc43705e00592f/feed) [![Test Coverage](https://codeclimate.com/repos/57f943855cdc43705e00592f/badges/2665cddeba042dc5191f/coverage.svg)](https://codeclimate.com/repos/57f943855cdc43705e00592f/coverage) | ||
**A library to generate PDFs in client-side JavaScript.** | ||
@@ -20,3 +22,3 @@ | ||
```html | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.5/jspdf.debug.js" integrity="sha384-CchuzHs077vGtfhGYl9Qtc7Vx64rXBXdIAZIPbItbNyWIRTdG0oYAqki3Ry13Yzu" crossorigin="anonymous"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.5.1/jspdf.debug.js" integrity="sha384-THVO/sM0mFD9h7dfSndI6TS0PgAGavwKvB5hAxRRvc0o9cPLohB0wb/PTA7LdUHs" crossorigin="anonymous"></script> | ||
``` | ||
@@ -66,16 +68,30 @@ | ||
doc.save('two-by-four.pdf') | ||
``` | ||
## Angular Configuration: | ||
Add following in angular-cli.json: | ||
## Use of UTF-8 / TTF: | ||
The 14 standard fonts in PDF are limited to the ASCII-codepage. If you want to use UTF-8 you have to to integrate a custom font, which provides the needed glyphs. jsPDF supports .ttf-files. So if you want to have for example chinese text in your pdf, your font has to have the necessary chinese glyphs. So check if your font supports the wanted glyphs or else it will show a blank space instead of the text. | ||
To add the font to jsPDF use our fontconverter in /fontconver/fontconverter.html . The fontconverter will create a js-file with the content of the provided ttf-file as base64 encoded string and additional code for jsPDF. You just have to add this generated js-File to your project. You are then ready to go to use setFont-method in your code and write your UTF-8 encoded text. | ||
## Angular/Webpack/React/etc. Configuration: | ||
If you are using Webpack (including managed cli tools like angular-cli or create-react-app) you can import like this: | ||
``` | ||
"scripts": [ "../node_modules/jspdf/dist/jspdf.min.js" ] | ||
import * as jsPDF from 'jspdf' | ||
``` | ||
and import it in your component: | ||
In some frameworks like Angular 7 you have to import jsPDF like this: | ||
``` | ||
import * as jsPDF from 'jspdf' | ||
import jsPDF from 'jspdf'; | ||
``` | ||
You can add jsPDF to your meteor-project as follows: | ||
Great! Now give us a Star :) | ||
``` | ||
meteor add jspdf:core | ||
``` | ||
@@ -82,0 +98,0 @@ ## Contributing |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
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
2196962
6
43265
0
126
0
0
7
31
+ Addedhtml2canvas@1.0.0-alpha.12
+ Addedpromise-polyfill@8.1.0
+ Addedstackblur-canvas@2.2.0
+ Addedbase64-arraybuffer@0.1.5(transitive)
+ Addedcss-line-break@1.0.1(transitive)
+ Addedfile-saver@2.0.0(transitive)
+ Addedhtml2canvas@1.0.0-alpha.12(transitive)
+ Addedpromise-polyfill@8.1.0(transitive)
+ Addedstackblur-canvas@2.2.0(transitive)
- Removedstackblur@^1.0.0
- Removedfile-saver@1.3.8(transitive)
- Removedstackblur@1.0.0(transitive)
Updatedcanvg@1.5.3
Updatedfile-saver@2.0.0