mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 09:32:12 +01:00
Printing to PDF with the page title
This commit is contained in:
parent
9e3423ff9e
commit
5152e514a0
|
@ -392,14 +392,16 @@ void WebView::printPage()
|
||||||
{
|
{
|
||||||
Q_ASSERT(m_page);
|
Q_ASSERT(m_page);
|
||||||
|
|
||||||
QPrintDialog* dialog = new QPrintDialog(this);
|
QPrinter *printer = new QPrinter();
|
||||||
|
printer->setCreator(tr("Falkon %1 (%2)").arg(Qz::VERSION, Qz::WWWADDRESS));
|
||||||
|
printer->setDocName(QzTools::filterCharsFromFilename(title()));
|
||||||
|
|
||||||
|
QPrintDialog *dialog = new QPrintDialog(printer, this);
|
||||||
dialog->setOptions(QAbstractPrintDialog::PrintToFile | QAbstractPrintDialog::PrintShowPageSize);
|
dialog->setOptions(QAbstractPrintDialog::PrintToFile | QAbstractPrintDialog::PrintShowPageSize);
|
||||||
#ifndef Q_OS_WIN
|
#ifndef Q_OS_WIN
|
||||||
dialog->setOption(QAbstractPrintDialog::PrintPageRange);
|
dialog->setOption(QAbstractPrintDialog::PrintPageRange);
|
||||||
dialog->setOption(QAbstractPrintDialog::PrintCollateCopies);
|
dialog->setOption(QAbstractPrintDialog::PrintCollateCopies);
|
||||||
#endif
|
#endif
|
||||||
dialog->printer()->setCreator(tr("Falkon %1 (%2)").arg(Qz::VERSION, Qz::WWWADDRESS));
|
|
||||||
dialog->printer()->setDocName(QzTools::getFileNameFromUrl(url()));
|
|
||||||
|
|
||||||
if (dialog->exec() == QDialog::Accepted) {
|
if (dialog->exec() == QDialog::Accepted) {
|
||||||
if (dialog->printer()->outputFormat() == QPrinter::PdfFormat) {
|
if (dialog->printer()->outputFormat() == QPrinter::PdfFormat) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user