Skip to content

Commit

Permalink
Report: Fix saving to PDF
Browse files Browse the repository at this point in the history
  • Loading branch information
janezd committed Dec 5, 2024
1 parent 05bbef6 commit 05a2d09
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions orangewidget/report/owreport.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
from typing import Optional

from AnyQt.QtCore import Qt, QObject, pyqtSlot, QSize
from AnyQt.QtGui import QIcon, QCursor, QStandardItemModel, QStandardItem
from AnyQt.QtGui import (
QIcon, QCursor, QStandardItemModel, QStandardItem, QPageSize)
from AnyQt.QtWidgets import (
QApplication, QDialog, QFileDialog, QTableView, QHeaderView,
QMessageBox)
Expand Down Expand Up @@ -354,7 +355,7 @@ def save_report(self):
_, extension = os.path.splitext(filename)
if extension == ".pdf":
printer = QPrinter()
printer.setPageSize(QPrinter.A4)
printer.setPageSize(QPageSize.A4)
printer.setOutputFormat(QPrinter.PdfFormat)
printer.setOutputFileName(filename)
self._print_to_printer(printer)
Expand Down

0 comments on commit 05a2d09

Please sign in to comment.