https://github.com/rrthomas/libpaper