pdfkit 0.9.1 → 0.10.0
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.
- package/CHANGELOG.md +9 -1
- package/README.md +11 -8
- package/js/pdfkit.es5.js +1613 -979
- package/js/pdfkit.es5.js.map +1 -1
- package/js/pdfkit.esnext.js +1676 -1153
- package/js/pdfkit.esnext.js.map +1 -1
- package/js/pdfkit.js +1123 -500
- package/js/pdfkit.js.map +1 -1
- package/js/pdfkit.standalone.js +68105 -0
- package/js/virtual-fs.js +20 -17
- package/package.json +16 -13
- package/.babelrc +0 -8
- package/.github/ISSUE_TEMPLATE/bug-report.md +0 -21
- package/.github/ISSUE_TEMPLATE/feature-request.md +0 -11
- package/.github/ISSUE_TEMPLATE/question.md +0 -20
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -35
- package/.prettierrc +0 -3
- package/CONTRIBUTING.md +0 -83
- package/js/font/data/Courier-Bold.afm +0 -342
- package/js/font/data/Courier-BoldOblique.afm +0 -342
- package/js/font/data/Courier-Oblique.afm +0 -342
- package/js/font/data/Courier.afm +0 -342
- package/js/font/data/Helvetica-Bold.afm +0 -2827
- package/js/font/data/Helvetica-BoldOblique.afm +0 -2827
- package/js/font/data/Helvetica-Oblique.afm +0 -3051
- package/js/font/data/Helvetica.afm +0 -3051
- package/js/font/data/Symbol.afm +0 -213
- package/js/font/data/Times-Bold.afm +0 -2588
- package/js/font/data/Times-BoldItalic.afm +0 -2384
- package/js/font/data/Times-Italic.afm +0 -2667
- package/js/font/data/Times-Roman.afm +0 -2419
- package/js/font/data/ZapfDingbats.afm +0 -225
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
### Unreleased
|
|
4
4
|
|
|
5
|
-
### [v0.
|
|
5
|
+
### [v0.10.0] - 2019-06-06
|
|
6
|
+
|
|
7
|
+
- Fix links to pages within the document
|
|
8
|
+
- Add support for named destinations
|
|
9
|
+
- Throw errors when `dash(...)` is passed invalid lengths
|
|
10
|
+
- Remove PDFDocument#output method
|
|
11
|
+
- Add standalone build (js/pdfkit.standalone.js)
|
|
12
|
+
|
|
13
|
+
### [v0.9.1] - 2019-04-30
|
|
6
14
|
|
|
7
15
|
- Fix setting printing permission
|
|
8
16
|
- Fix corruption of string objects in browser
|
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ a few function calls.
|
|
|
11
11
|
|
|
12
12
|
Check out some of the [documentation and examples](http://pdfkit.org/docs/getting_started.html) to see for yourself!
|
|
13
13
|
You can also read the guide as a [self-generated PDF](http://pdfkit.org/docs/guide.pdf) with example output displayed inline.
|
|
14
|
-
If you'd like to see how it was generated, check out the README in the [docs](https://github.com/
|
|
14
|
+
If you'd like to see how it was generated, check out the README in the [docs](https://github.com/foliojs/pdfkit/tree/master/docs)
|
|
15
15
|
folder.
|
|
16
16
|
|
|
17
17
|
You can also try out an interactive in-browser demo of PDFKit [here](http://pdfkit.org/demo/browser.html).
|
|
@@ -37,7 +37,7 @@ Installation uses the [npm](http://npmjs.org/) package manager. Just type the f
|
|
|
37
37
|
* Font embedding
|
|
38
38
|
* Supports TrueType (.ttf), OpenType (.otf), WOFF, WOFF2, TrueType Collections (.ttc), and Datafork TrueType (.dfont) fonts
|
|
39
39
|
* Font subsetting
|
|
40
|
-
* See [fontkit](http://github.com/
|
|
40
|
+
* See [fontkit](http://github.com/foliojs/fontkit) for more details on advanced glyph layout support.
|
|
41
41
|
* Image embedding
|
|
42
42
|
* Supports JPEG and PNG files (including indexed PNGs, and PNGs with transparency)
|
|
43
43
|
* Annotations
|
|
@@ -62,9 +62,10 @@ Installation uses the [npm](http://npmjs.org/) package manager. Just type the f
|
|
|
62
62
|
|
|
63
63
|
```javascript
|
|
64
64
|
const PDFDocument = require('pdfkit');
|
|
65
|
+
const fs = require('fs');
|
|
65
66
|
|
|
66
67
|
// Create a document
|
|
67
|
-
const doc = new PDFDocument;
|
|
68
|
+
const doc = new PDFDocument();
|
|
68
69
|
|
|
69
70
|
// Pipe its output somewhere, like to a file or HTTP response
|
|
70
71
|
// See below for browser usage
|
|
@@ -118,9 +119,11 @@ complex documents with a very small amount of code. For more, see the `demo` fo
|
|
|
118
119
|
|
|
119
120
|
## Browser Usage
|
|
120
121
|
|
|
121
|
-
There are
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
There are three ways to use PDFKit in the browser:
|
|
123
|
+
- Use [Browserify](http://browserify.org/). See demo [source code](demo/browser.js) and [build script](https://github.com/foliojs/pdfkit/blob/master/package.json#L56)
|
|
124
|
+
- Use [webpack](https://webpack.js.org/). See [complete example](https://github.com/blikblum/pdfkit-webpack-example).
|
|
125
|
+
- Use prebuilt version. Distributed as `js/pdfkit.standalone.js` file in package.
|
|
126
|
+
|
|
124
127
|
|
|
125
128
|
In addition to PDFKit, you'll need somewhere to stream the output to. HTML5 has a
|
|
126
129
|
[Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) object which can be used to store binary data, and
|
|
@@ -128,7 +131,7 @@ get URLs to this data in order to display PDF output inside an iframe, or upload
|
|
|
128
131
|
get a Blob from the output of PDFKit, you can use the [blob-stream](https://github.com/devongovett/blob-stream)
|
|
129
132
|
module.
|
|
130
133
|
|
|
131
|
-
The following example uses Browserify to load `PDFKit` and `blob-stream`, but if you're not using Browserify,
|
|
134
|
+
The following example uses Browserify or webpack to load `PDFKit` and `blob-stream`, but if you're not using Browserify,
|
|
132
135
|
you can load them in whatever way you'd like (e.g. script tags).
|
|
133
136
|
|
|
134
137
|
```javascript
|
|
@@ -137,7 +140,7 @@ const PDFDocument = require('pdfkit');
|
|
|
137
140
|
const blobStream = require('blob-stream');
|
|
138
141
|
|
|
139
142
|
// create a document the same way as above
|
|
140
|
-
const doc = new PDFDocument;
|
|
143
|
+
const doc = new PDFDocument();
|
|
141
144
|
|
|
142
145
|
// pipe the document to a blob
|
|
143
146
|
const stream = doc.pipe(blobStream());
|