Commit 14fe3d9a authored by Laurent Montel's avatar Laurent Montel 😁

Create pdf file

parent b39c10da
......@@ -74,7 +74,21 @@ void PrintWebEngineViewJob::start()
void PrintWebEngineViewJob::slotHandlePdfPrinted(const QByteArray &result)
{
//TODO
if (!result.size())
return;
QFile file(mTemporaryFile.fileName());
if (!file.open(QFile::WriteOnly)) {
//TODO warning.
Q_EMIT failed();
deleteLater();
return;
}
file.write(result.data(), result.size());
file.close();
Q_EMIT success(mTemporaryFile.fileName());
deleteLater();
}
QPageLayout PrintWebEngineViewJob::pageLayout() const
......
......@@ -44,7 +44,7 @@ public:
Q_SIGNALS:
void failed();
void success();
void success(const QString &temporaryFileName);
private Q_SLOTS:
void slotHandlePdfPrinted(const QByteArray &result);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment