Deal with print-preview renderings that do not match the correct number
of pages.

If the printing app declares more pages than the print preview pdf has
we used to throw an exception in the PDFManupulationService. This caused
the bitmap to be never written and the read-bitmap function to hang
forever. This was because read() return 0 meaning "pipe is closed" which
lead to an infinite loop. Now a read of 0 page might cause an exception
if the page is not fully read. This exception then causes the
preview_page_error to be displayed.

Bug: 27556666
Change-Id: I7b9de50dce930629e8d38efd4e2659a00b70cc4e
8 files changed