This is a very lightweight set of functions for generating PDF files in a single pass on the fly, written by James Hollingshead. I've written it to generate PDF files for a rubyrails application. It can write the pdf file directly onto the net without having to generate any temporary files.


All the necessary code is in pdfwriter.rb, so you can copy that into your project directly. See test.rb for some commented sample usage. The coordinates used start at (0,0) at the bottom left of the page. By default the units are in millimeters, but this can be changed to points or inches.


No image support (you can draw your own tables etc. though with lines)

No compression support

Only font supported is Times New Roman (in bold and non-bold incarnations)

These limitations aren't something I plan to change, but maybe the code will be useful to someone else. This code is in the public domain - do anything with it that you like. I am not responsible for anything it breaks. Be warned that if given unsanitized data it probably has the potential to produce pdf files that are corrupt in an arbitrary way - don't use it anywhere this might be an issue. My email address is a@b.c where a=james, b=hollo and c=org This software should be found at