6 ms·
PDFKit - A PDF generation library for Node.js.
- jashkenas 15y agoThe source code is a nice read, and quite illuminating, if you've ever wanted to dig under the hood of a PDF: https://github.com/devongovett/pdfkit/tree/master/lib https://github.com/devongovett/pdfkit/tree/master/lib edit: In particular, some of this TTF font handling stuff is pretty fun: https://github.com/devongovett/pdfkit/blob/master/lib/font.coffee https://github.com/devongovett/pdfkit/blob/master/lib/font.c... You get bonus style points for embedding PostScript in a heredoc.
- dpritchett 15y agoI was just coming to comment on my delight in seeing the examples written in CoffeeScript.
- devongovett 15y agoThanks Jeremy! You just made my day. :)
- superted 15y agoI can vouch for the quality of PDFKit, it is highly pleasant to work with
- dspillett 15y agoVery nice little library: I used it to make a 5-year planner for my mother (who is one of the few who still uses such things: you can't buy them anywhere any more, presumably everyone else plans online now) this year. Some things seem locked to integer multiples of 1/72th of an inch (so A4 comes out at 8.3x11.7 rather than 8.27x11.69 and laying out lines and text more precisely than that doesn't work) though I didn't delve into it to see if this could be rectified (by using using a smaller unit perhaps) as I didn't need more precision (which I'm guessing most people don't either). Line drawing widths and such take non-integer values fine, just not the line start/end coordinates. Nice library though, I'll be using it again in future and may even be able to contribute. It may even be my impetus to play with CoffeeScript properly.
- keeran 15y agoNot|soon to be confused with the Ruby gem, PDFKit. https://github.com/jdpace/PDFKit https://github.com/jdpace/PDFKit
- Argorak 15y agoApple also has a Framework called PDFKit. http://developer.apple.com/library/mac/#documentation/GraphicsImaging/Conceptual/PDFKitGuide/PDFKit_Prog_Intro/PDFKit_Prog_Intro.html http://developer.apple.com/library/mac/#documentation/Graphi...
- silverlight 15y agoI recently switched to using this for a web app from Prawn. The main app is in Ruby, but this was so much nicer (simpler API, much, much faster PDF generation) than Prawn for our particular use case (PDFs with lots of exact positioning of text and images) that I actually set up an entire Node server just to use PDFKit. Give it a shot if you generate a lot of PDFs.
- fenprace 15y agoLooks good and mark it.
- nodesocket 15y agoWould be awesome to be able to pass in simple text HTML like: <p>Paragraph <i>here</i>.</p><p>Second paragraph <strong>here</strong>.</p>.