added the code necessary to print custom headers, fit_to_pages, and the orientation based on recent improvements