pdfkit 0.11.0 → 0.12.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/CHANGELOG.md +61 -39
  2. package/LICENSE +7 -7
  3. package/README.md +182 -181
  4. package/js/data/Courier-Bold.afm +342 -342
  5. package/js/data/Courier-BoldOblique.afm +342 -342
  6. package/js/data/Courier-Oblique.afm +342 -342
  7. package/js/data/Courier.afm +342 -342
  8. package/js/data/Helvetica-Bold.afm +2827 -2827
  9. package/js/data/Helvetica-BoldOblique.afm +2827 -2827
  10. package/js/data/Helvetica-Oblique.afm +3051 -3051
  11. package/js/data/Helvetica.afm +3051 -3051
  12. package/js/data/Symbol.afm +213 -213
  13. package/js/data/Times-Bold.afm +2588 -2588
  14. package/js/data/Times-BoldItalic.afm +2384 -2384
  15. package/js/data/Times-Italic.afm +2667 -2667
  16. package/js/data/Times-Roman.afm +2419 -2419
  17. package/js/data/ZapfDingbats.afm +225 -225
  18. package/js/font/data/Courier-Bold.afm +342 -0
  19. package/js/font/data/Courier-BoldOblique.afm +342 -0
  20. package/js/font/data/Courier-Oblique.afm +342 -0
  21. package/js/font/data/Courier.afm +342 -0
  22. package/js/font/data/Helvetica-Bold.afm +2827 -0
  23. package/js/font/data/Helvetica-BoldOblique.afm +2827 -0
  24. package/js/font/data/Helvetica-Oblique.afm +3051 -0
  25. package/js/font/data/Helvetica.afm +3051 -0
  26. package/js/font/data/Symbol.afm +213 -0
  27. package/js/font/data/Times-Bold.afm +2588 -0
  28. package/js/font/data/Times-BoldItalic.afm +2384 -0
  29. package/js/font/data/Times-Italic.afm +2667 -0
  30. package/js/font/data/Times-Roman.afm +2419 -0
  31. package/js/font/data/ZapfDingbats.afm +225 -0
  32. package/js/pdfkit.es5.js +1277 -490
  33. package/js/pdfkit.es5.js.map +1 -1
  34. package/js/pdfkit.esnext.js +951 -190
  35. package/js/pdfkit.esnext.js.map +1 -1
  36. package/js/pdfkit.js +933 -189
  37. package/js/pdfkit.js.map +1 -1
  38. package/js/pdfkit.standalone.js +2894 -2011
  39. package/js/pdfkit.standalone.orig.js +68494 -0
  40. package/js/virtual-fs.js +3 -5
  41. package/package.json +93 -84
package/js/virtual-fs.js CHANGED
@@ -1,8 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var VirtualFileSystem =
4
- /*#__PURE__*/
5
- function () {
3
+ var VirtualFileSystem = /*#__PURE__*/function () {
6
4
  function VirtualFileSystem() {
7
5
  this.fileData = {};
8
6
  }
@@ -24,10 +22,10 @@ function () {
24
22
 
25
23
  if (encoding) {
26
24
  // return a string
27
- return typeof data === 'string' ? data : data.toString();
25
+ return typeof data === 'string' ? data : data.toString(encoding);
28
26
  }
29
27
 
30
- return new Buffer(data, typeof data === 'string' ? 'base64' : undefined);
28
+ return Buffer.from(data, typeof data === 'string' ? 'base64' : undefined);
31
29
  };
32
30
 
33
31
  _proto.writeFileSync = function writeFileSync(fileName, content) {
package/package.json CHANGED
@@ -1,85 +1,94 @@
1
- {
2
- "name": "pdfkit",
3
- "description": "A PDF generation library for Node.js",
4
- "keywords": [
5
- "pdf",
6
- "pdf writer",
7
- "pdf generator",
8
- "graphics",
9
- "document",
10
- "vector"
11
- ],
12
- "version": "0.11.0",
13
- "homepage": "http://pdfkit.org/",
14
- "author": {
15
- "name": "Devon Govett",
16
- "email": "devongovett@gmail.com",
17
- "url": "http://badassjs.com/"
18
- },
19
- "license": "MIT",
20
- "repository": {
21
- "type": "git",
22
- "url": "https://github.com/foliojs/pdfkit.git"
23
- },
24
- "bugs": "https://github.com/foliojs/pdfkit/issues",
25
- "devDependencies": {
26
- "@babel/core": "^7.7.2",
27
- "@babel/plugin-external-helpers": "^7.0.0",
28
- "@babel/preset-env": "^7.7.1",
29
- "babel-jest": "^24.9.0",
30
- "blob-stream": "^0.1.2",
31
- "brace": "^0.11.1",
32
- "brfs": "~2.0.2",
33
- "browserify": "^16.5.0",
34
- "codemirror": "~5.49.2",
35
- "eslint": "^6.6.0",
36
- "iconv-lite": "^0.5.0",
37
- "jest": "^24.9.0",
38
- "markdown": "~0.5.0",
39
- "prettier": "1.19.1",
40
- "pug": "^2.0.4",
41
- "rollup": "^1.27.0",
42
- "rollup-plugin-babel": "^4.3.3",
43
- "rollup-plugin-cpy": "^2.0.1"
44
- },
45
- "dependencies": {
46
- "crypto-js": "^3.1.9-1",
47
- "fontkit": "^1.8.0",
48
- "linebreak": "^1.0.2",
49
- "png-js": "^1.0.0"
50
- },
51
- "scripts": {
52
- "prepublishOnly": "npm run build",
53
- "build": "rollup -c && browserify --standalone PDFDocument --ignore iconv-lite js/pdfkit.js > js/pdfkit.standalone.js",
54
- "demo": "cd demo && node test.js",
55
- "browser-demo": "browserify demo/browser.js > demo/bundle.js",
56
- "pdf-guide": "node docs/generate.js",
57
- "website": "node docs/generate_website.js",
58
- "docs": "npm run pdf-guide && npm run website && npm run browser-demo",
59
- "prettier": "prettier {lib,tests,demo,docs}/**/*.js",
60
- "test": "jest -i",
61
- "test:integration": "jest integration/ -i",
62
- "test:unit": "jest unit/"
63
- },
64
- "main": "js/pdfkit.js",
65
- "module": "js/pdfkit.es5.js",
66
- "esnext": "js/pdfkit.esnext.js",
67
- "browserify": {
68
- "transform": [
69
- "brfs"
70
- ]
71
- },
72
- "engine": [
73
- "node >= v6.0.0"
74
- ],
75
- "jest": {
76
- "testPathIgnorePatterns": [
77
- "/node_modules/",
78
- "<rootDir>/demo/"
79
- ],
80
- "testURL": "http://localhost/",
81
- "setupFilesAfterEnv": [
82
- "<rootDir>/tests/unit/setupTests.js"
83
- ]
84
- }
1
+ {
2
+ "name": "pdfkit",
3
+ "description": "A PDF generation library for Node.js",
4
+ "keywords": [
5
+ "pdf",
6
+ "pdf writer",
7
+ "pdf generator",
8
+ "graphics",
9
+ "document",
10
+ "vector"
11
+ ],
12
+ "version": "0.12.3",
13
+ "homepage": "http://pdfkit.org/",
14
+ "author": {
15
+ "name": "Devon Govett",
16
+ "email": "devongovett@gmail.com",
17
+ "url": "http://badassjs.com/"
18
+ },
19
+ "license": "MIT",
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "https://github.com/foliojs/pdfkit.git"
23
+ },
24
+ "bugs": "https://github.com/foliojs/pdfkit/issues",
25
+ "devDependencies": {
26
+ "@babel/core": "^7.11.6",
27
+ "@babel/plugin-external-helpers": "^7.10.4",
28
+ "@babel/preset-env": "^7.11.5",
29
+ "babel-jest": "^26.3.0",
30
+ "blob-stream": "^0.1.2",
31
+ "brace": "^0.11.1",
32
+ "brfs": "~2.0.2",
33
+ "browserify": "^16.5.0",
34
+ "canvas": "^2.6.1",
35
+ "codemirror": "~5.49.2",
36
+ "eslint": "^7.8.1",
37
+ "gh-pages": "^3.1.0",
38
+ "iconv-lite": "^0.5.0",
39
+ "jest": "^26.4.2",
40
+ "jest-screenshot": "^0.3.1",
41
+ "markdown": "~0.5.0",
42
+ "pdfjs-dist": "^2.4.456",
43
+ "prettier": "1.19.1",
44
+ "pug": "^2.0.4",
45
+ "rollup": "^1.27.0",
46
+ "rollup-plugin-babel": "^4.3.3",
47
+ "rollup-plugin-cpy": "^2.0.1"
48
+ },
49
+ "dependencies": {
50
+ "crypto-js": "^4.0.0",
51
+ "fontkit": "^1.8.1",
52
+ "linebreak": "^1.0.2",
53
+ "png-js": "^1.0.0"
54
+ },
55
+ "scripts": {
56
+ "prepublishOnly": "npm run build",
57
+ "build": "rollup -c && browserify --standalone PDFDocument --ignore crypto --ignore iconv-lite js/pdfkit.js > js/pdfkit.standalone.js",
58
+ "browserify-example": "browserify examples/browserify/browser.js > examples/browserify/bundle.js",
59
+ "pdf-guide": "node docs/generate.js",
60
+ "website": "node docs/generate_website.js",
61
+ "publish-website": "node docs/publish_website.js",
62
+ "docs": "npm run pdf-guide && npm run website && npm run browserify-example",
63
+ "lint": "eslint {lib,tests}/**/*.js",
64
+ "prettier": "prettier {lib,tests,examples,docs}/**/*.js",
65
+ "test": "jest -i",
66
+ "test:visual": "jest visual/ -i",
67
+ "test:unit": "jest unit/"
68
+ },
69
+ "main": "js/pdfkit.js",
70
+ "module": "js/pdfkit.es5.js",
71
+ "esnext": "js/pdfkit.esnext.js",
72
+ "browserify": {
73
+ "transform": [
74
+ "brfs"
75
+ ]
76
+ },
77
+ "engine": [
78
+ "node >= v6.0.0"
79
+ ],
80
+ "jest": {
81
+ "testPathIgnorePatterns": [
82
+ "/node_modules/",
83
+ "<rootDir>/examples/"
84
+ ],
85
+ "testURL": "http://localhost/",
86
+ "setupFilesAfterEnv": [
87
+ "<rootDir>/tests/unit/setupTests.js"
88
+ ],
89
+ "reporters": [
90
+ "default",
91
+ "jest-screenshot/reporter"
92
+ ]
93
+ }
85
94
  }