{"_id":"pdfmake-pdfkit","_rev":"21-fd062eb850f7b753dc46e4b0d9f566a0","name":"pdfmake-pdfkit","time":{"modified":"2022-06-23T16:48:15.494Z","created":"2014-04-05T19:59:45.184Z","0.5.2":"2014-04-05T20:12:40.521Z","0.5.2-b":"2014-04-05T20:14:22.978Z","0.5.2-c":"2014-04-06T22:01:51.093Z","0.5.2-d":"2014-04-06T22:42:42.486Z","0.6.5":"2014-09-12T11:44:07.390Z","0.6.5-b":"2014-09-12T14:33:59.516Z","0.6.5-c":"2014-09-12T14:36:27.809Z"},"maintainers":[{"name":"bpampuch","email":"bartosz.pampuch@gmail.com"}],"dist-tags":{"latest":"0.6.5-c"},"description":"pdfkit updated for pdfmake","readme":"This is an updated version of [https://github.com/devongovett/pdfkit](https://github.com/devongovett/pdfkit) for pdfmake\n=======\n# PDFKit\n\nA JavaScript PDF generation library for Node and the browser.\n\n## Description\n\nPDFKit is a PDF document generation library for Node and the browser that makes creating complex, multi-page, printable documents easy. \nIt's written in CoffeeScript, but you can choose to use the API in plain 'ol JavaScript if you like. The API embraces \nchainability, and includes both low level functions as well as abstractions for higher level functionality. The PDFKit API \nis designed to be simple, so generating complex documents is often as simple as a few function calls.\n\nCheck out some of the [documentation and examples](http://pdfkit.org/docs/getting_started.html) to see for yourself!\nYou can also read the guide as a [self-generated PDF](http://pdfkit.org/docs/guide.pdf) with example output displayed inline.\nIf you'd like to see how it was generated, check out the README in the [docs](https://github.com/devongovett/pdfkit/tree/master/docs)\nfolder.\n\nYou can also try out an interactive in-browser demo of PDFKit [here](http://pdfkit.org/demo/browser.html).\n\n## Installation\n\nInstallation uses the [npm](http://npmjs.org/) package manager.  Just type the following command after installing npm.\n\n    npm install pdfkit\n\n## Features\n\n* Vector graphics\n  * HTML5 canvas-like API\n  * Path operations\n  * SVG path parser for easy path creation\n  * Transformations\n  * Linear and radial gradients\n* Text\n  * Line wrapping\n  * Text alignments\n  * Bulleted lists\n* Font embedding\n  * Supports TrueType (.ttf), TrueType Collections (.ttc), and Datafork TrueType (.dfont) fonts\n  * Font subsetting\n* Image embedding\n  * Supports JPEG and PNG files (including indexed PNGs, and PNGs with transparency)\n* Annotations\n  * Links\n  * Notes\n  * Highlights\n  * Underlines\n  * etc.\n  \n## Coming soon!\n\n* Patterns fills\n* Outlines\n* PDF Security\n* Higher level APIs for creating tables and laying out content\n* More performance optimizations\n* Even more awesomeness, perhaps written by you! Please fork this repository and send me pull requests.\n    \n## Example\n\n```coffeescript\nPDFDocument = require 'pdfkit'\n\n# Create a document\ndoc = new PDFDocument\n\n# Pipe it's output somewhere, like to a file or HTTP response\n# See below for browser usage\ndoc.pipe fs.createWriteStream('output.pdf')\n\n# Embed a font, set the font size, and render some text\ndoc.font('fonts/PalatinoBold.ttf')\n   .fontSize(25)\n   .text('Some text with an embedded font!', 100, 100)\n\n# Add another page\ndoc.addPage()\n   .fontSize(25)\n   .text('Here is some vector graphics...', 100, 100)\n\n# Draw a triangle\ndoc.save()\n   .moveTo(100, 150)\n   .lineTo(100, 250)\n   .lineTo(200, 250)\n   .fill(\"#FF3300\")\n\n# Apply some transforms and render an SVG path with the 'even-odd' fill rule\ndoc.scale(0.6)\n   .translate(470, -380)\n   .path('M 250,75 L 323,301 131,161 369,161 177,301 z')\n   .fill('red', 'even-odd')\n   .restore()\n\n# Add some text with annotations\ndoc.addPage()\n   .fillColor(\"blue\")\n   .text('Here is a link!', 100, 100)\n   .underline(100, 100, 160, 27, color: \"#0000FF\")\n   .link(100, 100, 160, 27, 'http://google.com/')\n\n# Finalize PDF file\ndoc.end()\n```\n \n[The PDF output from this example](http://pdfkit.org/demo/out.pdf) (with a few additions) shows the power of PDFKit — producing \ncomplex documents with a very small amount of code.  For more, see the `demo` folder and the \n[PDFKit programming guide](http://pdfkit.org/docs/getting_started.html).\n\n## Browser Usage\n\nThere are two ways to use PDFKit in the browser.  The first is to use [Browserify](http://browserify.org/),\nwhich is a Node module packager for the browser with the familiar `require` syntax.  The second is to use\na prebuilt version of PDFKit, which you can [download from Github](https://github.com/devongovett/pdfkit/releases).\n\nIn addition to PDFKit, you'll need somewhere to stream the output to.  HTML5 has a \n[Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) object which can be used to store binary data, and\nget URLs to this data in order to display PDF output inside an iframe, or upload to a server, etc.  In order to \nget a Blob from the output of PDFKit, you can use the [blob-stream](https://github.com/devongovett/blob-stream)\nmodule.\n\nThe following example uses Browserify to load `PDFKit` and `blob-stream`, but if you're not using Browserify, \nyou can load them in whatever way you'd like (e.g. script tags).\n\n```coffeescript\n# require dependencies\nPDFDocument = require 'pdfkit'\nblobStream  = require 'blob-stream'\n\n# create a document the same way as above\ndoc = new PDFDocument\n\n# pipe the document to a blob\nstream = doc.pipe(blobStream())\n\n# add your content to the document here, as usual\n\n# get a blob when you're done\ndoc.end()\nstream.on 'finish', ->\n  # get a blob you can do whatever you like with\n  blob = stream.toBlob('application/pdf')\n\n  # or get a blob URL for display in the browser\n  url = stream.toBlobURL('application/pdf')\n  iframe.src = url\n```\n\nYou can see an interactive in-browser demo of PDFKit [here](http://pdfkit.org/demo/browser.html).\n\nNote that in order to Browserify a project using PDFKit, you need to install the `brfs` module with npm, \nwhich is used to load built-in font data into the package. It is listed as a `devDependency` in \nPDFKit's `package.json`, so it isn't installed by default for Node users. \nIf you forget to install it, Browserify will print an error message.\n\n## Documentation\n\nFor complete API documentation and more examples, see the [PDFKit website](http://pdfkit.org/).\n\n## License\n\nPDFKit is available under the MIT license.\n","versions":{"0.5.2-b":{"name":"pdfmake-pdfkit","description":"pdfkit updated for pdfmake","keywords":["pdf","pdf writer","pdf generator","graphics","document","vector"],"version":"0.5.2-b","repository":{"type":"git","url":"https://github.com/bpampuch/pdfkit.git"},"devDependencies":{"coffee-script":">=1.0.1","codemirror":"~3.20.0","markdown":"~0.5.0","jade":"~1.1.5"},"dependencies":{"png-js":">=0.1.0","linebreak":"~0.1.0"},"scripts":{"prepublish":"coffee -o js -c lib/ && cp -r lib/font/data js/font/data","postpublish":"rm -rf ./js"},"main":"./js/document","engine":["node >= v0.6.0"],"bugs":{"url":"https://github.com/bpampuch/pdfkit/issues"},"directories":{"doc":"docs"},"author":"","license":"MIT","homepage":"https://github.com/bpampuch/pdfkit","_id":"pdfmake-pdfkit@0.5.2-b","dist":{"shasum":"5efb87d39ea32866cfb6c377c935a078af69bfe4","tarball":"https://registry.npmjs.org/pdfmake-pdfkit/-/pdfmake-pdfkit-0.5.2-b.tgz","integrity":"sha512-RUUaCi86a/b2hQJLtZl6ddWRZeZKeJyXDQX5l/iPN7cW36HRjxJDq9CdLoTHwz6ZE6P/6vlFFN1iJMY7+z3glw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDuFOr1IQhS7ahE0ejD6ZnN8cEq+3LJULpk9v3Y4m6PJgIhAJ+ETqc6OKn5aWYsGbvM2hYv/gPmRTgknXW/6o7FoBpF"}]},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"bpampuch","email":"bartosz.pampuch@gmail.com"},"maintainers":[{"name":"bpampuch","email":"bartosz.pampuch@gmail.com"}]},"0.5.2-c":{"name":"pdfmake-pdfkit","description":"pdfkit updated for pdfmake","keywords":["pdf","pdf writer","pdf generator","graphics","document","vector"],"version":"0.5.2-c","repository":{"type":"git","url":"https://github.com/bpampuch/pdfkit.git"},"devDependencies":{"coffee-script":">=1.0.1","codemirror":"~3.20.0","markdown":"~0.5.0","jade":"~1.1.5"},"dependencies":{"png-js":">=0.1.0","linebreak":"~0.1.0"},"scripts":{"prepublish":"coffee -o js -c lib/ && cp -r lib/font/data js/font/data","postpublish":"rm -rf ./js"},"main":"./js/document","engine":["node >= v0.6.0"],"bugs":{"url":"https://github.com/bpampuch/pdfkit/issues"},"directories":{"doc":"docs"},"author":"","license":"MIT","homepage":"https://github.com/bpampuch/pdfkit","_id":"pdfmake-pdfkit@0.5.2-c","dist":{"shasum":"e5bb9b656a9d0b5b8f770e6e6d26b2cbc7e96713","tarball":"https://registry.npmjs.org/pdfmake-pdfkit/-/pdfmake-pdfkit-0.5.2-c.tgz","integrity":"sha512-5iFtEoChh430GVvL6lnBonv88siZP6F0j/gTGMF+2Fb3EnVQWOFrEpFnaUkhIbXXaRv6BRkMdm5iNrDJOsNI6w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHBLoqReceRrEJzv/dzFXakEhiogz5xrT6oXuxTeSJY4AiEAr59GNjGR2kWjeZwZwzA1Y1ZkzyVA3mLJWH4IyxzETzI="}]},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"bpampuch","email":"bartosz.pampuch@gmail.com"},"maintainers":[{"name":"bpampuch","email":"bartosz.pampuch@gmail.com"}]},"0.5.2-d":{"name":"pdfmake-pdfkit","description":"pdfkit updated for pdfmake","keywords":["pdf","pdf writer","pdf generator","graphics","document","vector"],"version":"0.5.2-d","repository":{"type":"git","url":"https://github.com/bpampuch/pdfkit.git"},"devDependencies":{"coffee-script":">=1.0.1","codemirror":"~3.20.0","markdown":"~0.5.0","jade":"~1.1.5"},"dependencies":{"png-js":">=0.1.0","linebreak":"~0.1.0"},"scripts":{"prepublish":"coffee -o js -c lib/ && cp -r lib/font/data js/font/data","postpublish":"rm -rf ./js"},"main":"./js/document","engine":["node >= v0.6.0"],"bugs":{"url":"https://github.com/bpampuch/pdfkit/issues"},"directories":{"doc":"docs"},"author":"","license":"MIT","homepage":"https://github.com/bpampuch/pdfkit","_id":"pdfmake-pdfkit@0.5.2-d","dist":{"shasum":"176bd4672cb4684f57e1f61906d45c71a423ed63","tarball":"https://registry.npmjs.org/pdfmake-pdfkit/-/pdfmake-pdfkit-0.5.2-d.tgz","integrity":"sha512-9vdrxSXXm2K9ZmE4rt1r6v1Gbnfh2zxLw3VFEbPXfu5GVigCyZL0sfY3hJQfSbVE1IyGu2fOObFps3ceARH5iQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCXEzFfmdWlAFg3pdXRpuUOy2V7Vo/hjPU3M1SXLhBW/QIhANfHTeevrc2EGjZFJYZYYb5xllJwlYKyYclxxmB1v4Mx"}]},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"bpampuch","email":"bartosz.pampuch@gmail.com"},"maintainers":[{"name":"bpampuch","email":"bartosz.pampuch@gmail.com"}]},"0.6.5":{"name":"pdfmake-pdfkit","description":"pdfkit updated for pdfmake","keywords":["pdf","pdf writer","pdf generator","graphics","document","vector"],"version":"0.6.5","homepage":"http://pdfkit.org/","author":"","repository":{"type":"git","url":"https://github.com/bpampuch/pdfkit.git"},"devDependencies":{"coffee-script":">=1.0.1","codemirror":"~3.20.0","markdown":"~0.5.0","jade":"~1.1.5","coffeeify":"^0.6.0","browserify":"^3.39.0","brfs":"~1.0.1","exorcist":"^0.1.5","brace":"^0.2.1","blob-stream":"^0.1.2"},"dependencies":{"png-js":">=0.1.0","linebreak":"~0.1.0"},"scripts":{"prepublish":"make js","postpublish":"make clean"},"main":"js/document","browserify":{"transform":["brfs"]},"engine":["node >= v0.10.0"],"bugs":{"url":"https://github.com/bpampuch/pdfkit/issues"},"directories":{"doc":"docs"},"license":"MIT","gitHead":"283abec1f20555bf29a3762932e7d4866208e592","_id":"pdfmake-pdfkit@0.6.5","_shasum":"8695ac2e8e919713e01f5dfdf2242ef606c15f68","_from":".","_npmVersion":"2.0.0-beta.0","_npmUser":{"name":"bpampuch","email":"bartosz.pampuch@gmail.com"},"maintainers":[{"name":"bpampuch","email":"bartosz.pampuch@gmail.com"}],"dist":{"shasum":"8695ac2e8e919713e01f5dfdf2242ef606c15f68","tarball":"https://registry.npmjs.org/pdfmake-pdfkit/-/pdfmake-pdfkit-0.6.5.tgz","integrity":"sha512-mYAR3Z1leBdOXHqpg3/td0/AnBCbLuZrUuAwRDBRTXMFzN1lPxh+cM3XtLwWzYopmzwLwREVTqeFvH2ZXqbjmQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCCr/Bl1vdXjgUbvBQciE1BIfJmqaP9ELq8SyNLCCQBBgIgZN1iz0d3sFx1IzS4cBmyB7NpjH7Qfku7x4Ilp3dnq3Y="}]}},"0.6.5-b":{"name":"pdfmake-pdfkit","description":"pdfkit updated for pdfmake","keywords":["pdf","pdf writer","pdf generator","graphics","document","vector"],"version":"0.6.5-b","homepage":"http://pdfkit.org/","author":"","repository":{"type":"git","url":"https://github.com/bpampuch/pdfkit.git"},"devDependencies":{"coffee-script":">=1.0.1","codemirror":"~3.20.0","markdown":"~0.5.0","jade":"~1.1.5","coffeeify":"^0.6.0","browserify":"^3.39.0","brfs":"~1.0.1","exorcist":"^0.1.5","brace":"^0.2.1","blob-stream":"^0.1.2"},"dependencies":{"png-js":">=0.1.0","linebreak":"~0.1.0"},"scripts":{"prepublish":"make js","postpublish":"make clean"},"main":"js/document","browserify":{"transform":["brfs"]},"engine":["node >= v0.10.0"],"bugs":{"url":"https://github.com/bpampuch/pdfkit/issues"},"directories":{"doc":"docs"},"license":"MIT","gitHead":"283abec1f20555bf29a3762932e7d4866208e592","_id":"pdfmake-pdfkit@0.6.5-b","_shasum":"7ea3d104208a66ed5b74d7fd779ef6a6ffdad177","_from":".","_npmVersion":"2.0.0-beta.0","_npmUser":{"name":"bpampuch","email":"bartosz.pampuch@gmail.com"},"maintainers":[{"name":"bpampuch","email":"bartosz.pampuch@gmail.com"}],"dist":{"shasum":"7ea3d104208a66ed5b74d7fd779ef6a6ffdad177","tarball":"https://registry.npmjs.org/pdfmake-pdfkit/-/pdfmake-pdfkit-0.6.5-b.tgz","integrity":"sha512-avP6Vcz2ti2Quo5ySzd879UlwvbGmavvLiBt+ccQHB6l/jutvqG0RFjAO0i79sVehCiBsV/v6rXbeWA6eJ7ypQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEmHoRpieHF6QSKgi1/iZIWqXLqma+nE7S4JJF50mn+2AiEAsqpBhqS3xb46g5EYUAHREcWvC2mHOeCzmSgos/WbTio="}]}},"0.6.5-c":{"name":"pdfmake-pdfkit","description":"pdfkit updated for pdfmake","keywords":["pdf","pdf writer","pdf generator","graphics","document","vector"],"version":"0.6.5-c","homepage":"http://pdfkit.org/","author":"","repository":{"type":"git","url":"https://github.com/bpampuch/pdfkit.git"},"devDependencies":{"coffee-script":">=1.0.1","codemirror":"~3.20.0","markdown":"~0.5.0","jade":"~1.1.5","coffeeify":"^0.6.0","browserify":"^3.39.0","brfs":"~1.0.1","exorcist":"^0.1.5","brace":"^0.2.1","blob-stream":"^0.1.2"},"dependencies":{"png-js":">=0.1.0","linebreak":"~0.1.0"},"scripts":{"prepublish":"make js","postpublish":"make clean"},"main":"js/document","browserify":{"transform":["brfs"]},"engine":["node >= v0.10.0"],"bugs":{"url":"https://github.com/bpampuch/pdfkit/issues"},"directories":{"doc":"docs"},"license":"MIT","gitHead":"283abec1f20555bf29a3762932e7d4866208e592","_id":"pdfmake-pdfkit@0.6.5-c","_shasum":"865a54c1f8358d79cb85b1bac5f0d97f9d29b18c","_from":".","_npmVersion":"2.0.0-beta.0","_npmUser":{"name":"bpampuch","email":"bartosz.pampuch@gmail.com"},"maintainers":[{"name":"bpampuch","email":"bartosz.pampuch@gmail.com"}],"dist":{"shasum":"865a54c1f8358d79cb85b1bac5f0d97f9d29b18c","tarball":"https://registry.npmjs.org/pdfmake-pdfkit/-/pdfmake-pdfkit-0.6.5-c.tgz","integrity":"sha512-iW7IvJkb/WLa4GmwKqbVvpnLfQYJiaLFvoXy/PGgjfb/1fwLxLJxjpc+rmd+w4MXMha6NjCljx9mZqM4OSnBZA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCjxIXmKIpagxAk3rX9R9Lw+Fik4u/pE3JX/dBTL4JaCwIgfx5RPtdRPz7HkUwNWKtRRM41qI7uerBVpLoUOF9zDf0="}]}}},"homepage":"http://pdfkit.org/","keywords":["pdf","pdf writer","pdf generator","graphics","document","vector"],"repository":{"type":"git","url":"https://github.com/bpampuch/pdfkit.git"},"bugs":{"url":"https://github.com/bpampuch/pdfkit/issues"},"license":"MIT","readmeFilename":"README.md"}