

PDFKit - A PDF generation library for Node.js. - jenhsun
http://pdfkit.org/

======
jashkenas
The 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>

 _edit:_ In particular, some of this TTF font handling stuff is pretty fun:

[https://github.com/devongovett/pdfkit/blob/master/lib/font.c...](https://github.com/devongovett/pdfkit/blob/master/lib/font.coffee)

You get bonus style points for embedding PostScript in a heredoc.

~~~
devongovett
Thanks Jeremy! You just made my day. :)

------
keeran
Not|soon to be confused with the Ruby gem, PDFKit.

<https://github.com/jdpace/PDFKit>

~~~
Argorak
Apple also has a Framework called PDFKit.

[http://developer.apple.com/library/mac/#documentation/Graphi...](http://developer.apple.com/library/mac/#documentation/GraphicsImaging/Conceptual/PDFKitGuide/PDFKit_Prog_Intro/PDFKit_Prog_Intro.html)

------
dspillett
Very 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.

------
silverlight
I 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.

------
nodesocket
Would 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>.

------
superted
I can vouch for the quality of PDFKit, it is highly pleasant to work with

------
fenprace
Looks good and mark it.

