I know this is an old thread, but in case it helps anyone else...
I was seeing the same problem - occasionally I would see "QPainter::begin() : returned false" when trying to print to a pdf file. In my case, I was generating the pdf file names from a database field, but sometimes the database field contained characters (such as " quotes) that are not valid within a file name. Then the pdf printer was unable to create a file with the invalid file name, and the 'begin' method failed. Perhaps this caused your issue also.
Bookmarks