Dear all,
Could anyone tell me is any way to save PDF files to MySQL (BLOB), and open BLOB as PDF in Qt Widget ?
Thank's
Dear all,
Could anyone tell me is any way to save PDF files to MySQL (BLOB), and open BLOB as PDF in Qt Widget ?
Thank's
All you have to do to save any file to a blob, is to read it into a QByteArray using QFile and then use QSqlQuery with a sql insert instruction binding that QByteArray to the blob field.
As for displaying it in a widget, you might need to find some kindof library that can read the PDF and make a widget that can display it (such as this).
Often, people read it back from the SQL into a QByteArray, have QFile save it to a temp file, and use QDesktopServices to make the operating system's default viewer open it.
Bookmarks