The libpaper paper-handling library automates recognition of many different paper types and sizes for programs that need to deal with printed output.