Skip to content

Conversation

@devongovett
Copy link
Member

Awesome announcement: PDFKit v0.6 now supports being used in the browser, thanks to Browserify! You can read the documentation in the readme, on the website, and in the PDF guide.

Basically, I did a bunch of work to make PDFKit friendly to browserify, wrote a new zlib module for browserify that is compatibile with Node's API, and wrote a module called blob-stream to take the output of any stream and turn it into an HTML5 Blob object that you can use to view the PDF in the browser directly, trigger a download, or upload to a server.

I also added the ability to use Buffers as a source to the font method, just as you can for images. This is especially useful in the browser where you don't have access to a file system. You can load your fonts or images from an HTTP request, or even inline them into your browserify bundle using brfs, and then pass them to PDFKit to get around the lack of a file system in the browser.

I will be uploading precompiled versions of PDFKit to Github's releases section from now on, so you can use those if you don't want to use Browserify.

You can see an interactive demo of PDFKit running in the browser here.

devongovett added a commit that referenced this pull request Apr 14, 2014
Support using PDFKit in the Browser, thanks to Browserify!
@devongovett devongovett merged commit 968f2c7 into master Apr 14, 2014
@devongovett devongovett deleted the browser branch April 14, 2014 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants