Re:Show HN: PDF parsing in Racket, my weekend project
by gcr on Sunday May 13, 2012 @12:12AM
(#3966006)
Belive it or not, this library grew out of a direct need of mine. :)
One thing that I've been using Racket for is to make research posters for conferences. Racket has an excellent library for functional picture/slideshow composition; you can read about that here (which doubles as a great intro to racket in general):
http://docs.racket-lang.org/quick/index.html
It's sort of like a "LaTeX for pictures"; where you can say
(vc-append (square 10) (circle 10))
to have a 10px square sitting on top of a 10px circle (vertical, centered). Once you build your poster this way, you can save it as a PDF. This is geat for having perfectly aligned blocks of text sitting in perfectly spaced colums, for example. It's much better than fiddling with the layout manually in powerpoint.
However, in designing my poster, I have to include PDF figures. Racket didn't include a way of rendering PDFs, so in my last poster, I had to use 600DPI bitmaps of my figures, which was slow and made the file terribly huge. This library binds to libpoppler, which is great because Racket's native pictures are Cairo-backed anyway, and Racket's FFI is top notch (once you can figure it out). Now I can use the usual functional composition to add these PDF figures to the rest of my poster.
One thing that I've been using Racket for is to make research posters for conferences. Racket has an excellent library for functional picture/slideshow composition; you can read about that here (which doubles as a great intro to racket in general): http://docs.racket-lang.org/quick/index.html
It's sort of like a "LaTeX for pictures"; where you can say
to have a 10px square sitting on top of a 10px circle (vertical, centered). Once you build your poster this way, you can save it as a PDF. This is geat for having perfectly aligned blocks of text sitting in perfectly spaced colums, for example. It's much better than fiddling with the layout manually in powerpoint.However, in designing my poster, I have to include PDF figures. Racket didn't include a way of rendering PDFs, so in my last poster, I had to use 600DPI bitmaps of my figures, which was slow and made the file terribly huge. This library binds to libpoppler, which is great because Racket's native pictures are Cairo-backed anyway, and Racket's FFI is top notch (once you can figure it out). Now I can use the usual functional composition to add these PDF figures to the rest of my poster.