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 CHANGED
@@ -2,7 +2,15 @@
2
2
 
3
3
  ### Unreleased
4
4
 
5
- ### [v0.9.1] - 2019-3-04
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/devongovett/pdfkit/tree/master/docs)
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/devongovett/fontkit) for more details on advanced glyph layout support.
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 two ways to use PDFKit in the browser. The first is to use [Browserify](http://browserify.org/),
122
- which is a Node module packager for the browser with the familiar `require` syntax. The second is to use
123
- a prebuilt version of PDFKit, which you can [download from Github](https://github.com/devongovett/pdfkit/releases).
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());