Changed the print function so that it doesn't continue if item is null.
The view also resizes now according to the resolution we get from the printer object.