Fixed searching and copy/paste from PDF documents.
Fixed searching and copy/paste from PDF documents.

Previously copy and paste from PDFs made by Qt would paste garbage
into the target document, and searching was not possible. The bug
happened because the internal buffer would open its data stream in
truncate mode rather than append mode, thereby losing content, and
producing a slightly corrupted PDF.

Task:     QTBUG-4912
Task:     QTBUG-3661
RevBy:    Trond Kjernåsen

igor-sfdc/qt-wk,igor-sfdc/qt-wk,igor-sfdc/qt-wk,pruiz/wkhtmltopdf-qt,pruiz/wkhtmltopdf-qt,radekp/qt,igor-sfdc/qt-wk,radekp/qt,igor-sfdc/qt-wk,igor-sfdc/qt-wk,pruiz/wkhtmltopdf-qt,igor-sfdc/qt-wk,radekp/qt,radekp/qt,radekp/qt,pruiz/wkhtmltopdf-qt,radekp/qt,pruiz/wkhtmltopdf-qt,radekp/qt,pruiz/wkhtmltopdf-qt,igor-sfdc/qt-wk,radekp/qt,pruiz/wkhtmltopdf-qt,radekp/qt,igor-sfdc/qt-wk,radekp/qt,pruiz/wkhtmltopdf-qt,igor-sfdc/qt-wk,pruiz/wkhtmltopdf-qt,pruiz/wkhtmltopdf-qt,pruiz/wkhtmltopdf-qt,igor-sfdc/qt-wk