diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-06-08 13:11:55 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-06-22 08:14:38 +0200 |
commit | 0887e880ced988704559505816b520972e6876c6 (patch) | |
tree | 0f6034bf51713560b8576970572371458a05c05e /src/core/web_contents_adapter.cpp | |
parent | f17231b7a1ac1c1cfd2798cc57315a5d41a7df31 (diff) |
Add QPageRanges to PDF printing
Pick-to: 6.2
Task-number: QTBUG-73497
Change-Id: I0a66c4f1767c54b0bcc9f9a3b61e29c43ec20177
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'src/core/web_contents_adapter.cpp')
-rw-r--r-- | src/core/web_contents_adapter.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index dd506f1e1..70b5e42aa 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -1326,7 +1326,7 @@ void WebContentsAdapter::wasHidden() m_webContents->WasHidden(); } -void WebContentsAdapter::printToPDF(const QPageLayout &pageLayout, const QString &filePath) +void WebContentsAdapter::printToPDF(const QPageLayout &pageLayout, const QPageRanges &pageRanges, const QString &filePath) { #if QT_CONFIG(webengine_printing_and_pdf) CHECK_INITIALIZED(); @@ -1334,13 +1334,15 @@ void WebContentsAdapter::printToPDF(const QPageLayout &pageLayout, const QString m_adapterClient, filePath); PrintViewManagerQt::FromWebContents(m_webContents.get())->PrintToPDFFileWithCallback(pageLayout, - true, - filePath, - callback); + pageRanges, + true, + filePath, + callback); #endif // QT_CONFIG(webengine_printing_and_pdf) } quint64 WebContentsAdapter::printToPDFCallbackResult(const QPageLayout &pageLayout, + const QPageRanges &pageRanges, bool colorMode, bool useCustomMargins) { @@ -1350,9 +1352,10 @@ quint64 WebContentsAdapter::printToPDFCallbackResult(const QPageLayout &pageLayo m_adapterClient, m_nextRequestId); PrintViewManagerQt::FromWebContents(m_webContents.get())->PrintToPDFWithCallback(pageLayout, - colorMode, - useCustomMargins, - callback); + pageRanges, + colorMode, + useCustomMargins, + callback); return m_nextRequestId++; #else Q_UNUSED(pageLayout); |