pdfkit 0.12.2 → 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 (38) hide show
  1. package/package.json +2 -2
  2. package/examples/attachment.js +0 -42
  3. package/examples/attachment.pdf +0 -0
  4. package/examples/browserify/browser.html +0 -54
  5. package/examples/browserify/browser.js +0 -97
  6. package/examples/browserify/bundle.js +0 -91259
  7. package/examples/fonts/Chalkboard.ttc +0 -0
  8. package/examples/fonts/DejaVuSans.ttf +0 -0
  9. package/examples/fonts/GoodDog.ttf +0 -0
  10. package/examples/fonts/Helvetica.dfont +0 -0
  11. package/examples/fonts/Montserrat-Bold.otf +0 -0
  12. package/examples/fonts/PalatinoBold.ttf +0 -0
  13. package/examples/form.js +0 -85
  14. package/examples/form.pdf +0 -0
  15. package/examples/images/dice.png +0 -0
  16. package/examples/images/fish.png +0 -0
  17. package/examples/images/interlaced-grayscale-8bit.png +0 -0
  18. package/examples/images/interlaced-pallete-8bit.png +0 -0
  19. package/examples/images/interlaced-rgb-16bit.png +0 -0
  20. package/examples/images/interlaced-rgb-8bit.png +0 -0
  21. package/examples/images/interlaced-rgb-alpha-8bit.png +0 -0
  22. package/examples/images/pngsuite-gray-transparent-white.png +0 -0
  23. package/examples/images/pngsuite-rgb-transparent-white.png +0 -0
  24. package/examples/images/straight.png +0 -0
  25. package/examples/images/test.jpeg +0 -0
  26. package/examples/images/test.png +0 -0
  27. package/examples/images/test2.png +0 -0
  28. package/examples/images/test3.png +0 -0
  29. package/examples/kitchen-sink-accessible.js +0 -255
  30. package/examples/kitchen-sink-accessible.pdf +0 -0
  31. package/examples/kitchen-sink.js +0 -115
  32. package/examples/kitchen-sink.pdf +0 -0
  33. package/examples/text-link.js +0 -26
  34. package/examples/text-link.pdf +0 -0
  35. package/examples/tiger.js +0 -1742
  36. package/examples/webpack/README.md +0 -14
  37. package/examples/webpack/package.json +0 -21
  38. package/examples/webpack/webpack.config.js +0 -84
@@ -1,14 +0,0 @@
1
- # pdfkit-webpack-example
2
-
3
- Simple example of using PdfKit with webpack
4
-
5
- ### Features
6
-
7
- - Minimal webpack 5 setup
8
- - Automatically register binary files added to static-assets folder
9
- - Register AFM fonts provided by pdfkit
10
- - Shows how to load and register files lazily
11
-
12
- ### Caveats
13
-
14
- Production build does not work. Probably how pdf document is created (inside a `new Function` call)
@@ -1,21 +0,0 @@
1
- {
2
- "license": "MIT",
3
- "dependencies": {
4
- "brace": "^0.11.1",
5
- "buffer": "^6.0.3",
6
- "pdfkit": "file:./../..",
7
- "process": "^0.11.10",
8
- "readable-stream": "^3.6.0"
9
- },
10
- "devDependencies": {
11
- "brfs": "^2.0.2",
12
- "html-webpack-plugin": "^5.3.2",
13
- "transform-loader": "^0.2.4",
14
- "webpack": "^5.44.0",
15
- "webpack-cli": "^4.7.2"
16
- },
17
- "scripts": {
18
- "dev": "webpack --mode development",
19
- "prod": "webpack --mode production"
20
- }
21
- }
@@ -1,84 +0,0 @@
1
- const path = require('path');
2
- const webpack = require('webpack');
3
- const HtmlWebpackPlugin = require('html-webpack-plugin');
4
- const TerserPlugin = require('terser-webpack-plugin');
5
-
6
- module.exports = {
7
- plugins: [
8
- new HtmlWebpackPlugin({
9
- template: path.resolve(__dirname, 'src/index.html')
10
- }),
11
- new webpack.ProvidePlugin({
12
- Buffer: ['buffer', 'Buffer'],
13
- process: 'process/browser'
14
- })
15
- ],
16
- resolve: {
17
- alias: {
18
- // maps fs to a virtual one allowing to register file content dynamically
19
- fs: 'pdfkit/js/virtual-fs.js',
20
- // iconv-lite is used to load cid less fonts (uncommon)
21
- 'iconv-lite': false
22
- },
23
- fallback: {
24
- // crypto module is not necessary at browser
25
- crypto: false,
26
- // fallbacks for native node libraries
27
- buffer: require.resolve('buffer/'),
28
- stream: require.resolve('readable-stream'),
29
- zlib: require.resolve('browserify-zlib')
30
- }
31
- },
32
- module: {
33
- rules: [
34
- // bundle and load afm files verbatim
35
- { test: /\.afm$/, type: 'asset/source' },
36
- // bundle and load binary files inside static-assets folder as base64
37
- {
38
- test: /src[/\\]static-assets/,
39
- type: 'asset/inline',
40
- generator: {
41
- dataUrl: content => {
42
- return content.toString('base64');
43
- }
44
- }
45
- },
46
- // load binary files inside lazy-assets folder as an URL
47
- {
48
- test: /src[/\\]lazy-assets/,
49
- type: 'asset/resource'
50
- },
51
- {
52
- enforce: 'post',
53
- test: /fontkit[/\\]index.js$/,
54
- loader: 'transform-loader',
55
- options: {
56
- brfs: {}
57
- }
58
- },
59
- {
60
- enforce: 'post',
61
- test: /unicode-properties[/\\]index.js$/,
62
- loader: 'transform-loader',
63
- options: {
64
- brfs: {}
65
- }
66
- },
67
- {
68
- enforce: 'post',
69
- test: /linebreak[/\\]src[/\\]linebreaker.js/,
70
- loader: 'transform-loader',
71
- options: {
72
- brfs: {}
73
- }
74
- }
75
- ]
76
- },
77
- optimization: {
78
- minimizer: [
79
- new TerserPlugin({
80
- exclude: /src[/\\]index\.js$/ // not working. Probably related to dynamic function creation
81
- })
82
- ]
83
- }
84
- };