Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support using PDFKit in the Browser, thanks to Browserify! #223

Merged
merged 32 commits into from
Apr 14, 2014
Merged

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.

1 participant