Got halfway proper printing to pdf working.