Improved whitespace handing for printing