libpaper is a library for handling paper characteristics. The libpaper paper-handling library automates recognition of many different paper types and sizes for programs that need to deal with printed output. Pass the variable PAPERSIZE=letter|a3|a4|... to the script to set the preferred papersize (the default is a4).