Python Forum
[PyQt] Saving file to html or pdf stopped working in PyQt6
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] Saving file to html or pdf stopped working in PyQt6
#5
(Mar-12-2024, 05:24 PM)deanhystad Wrote:
printer.setPageMargins(5, 5, 5, 5, QPrinter.Millimeters)
I'm not sure about the units for the margins. 5mm is a bit small but 5 Inch is way too big.

Thanks for pointing into the right direction. This is how it works:
printer.setPageMargins(QMarginsF(0, 0, 5, 5), QPageLayout.Unit.Millimeter)
Reply


Messages In This Thread
RE: Saving file to html or pdf stopped working in PyQt6 - by ejKDE - Mar-12-2024, 07:45 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyQt] [solved] How to display a pdf-file in a PyQt6 widget BigMan 13 16,515 May-06-2023, 09:27 AM
Last Post: Axel_Erfurt
  event driven coding PyQt6 on Combobox change merrittr 3 2,176 May-03-2023, 03:35 AM
Last Post: merrittr
Question [PyQt] Application desktop toolbar with PyQt6 bunz 4 1,574 Mar-09-2023, 08:09 PM
Last Post: bunz
  PyQt6 QAction with icon and string malonn 2 1,768 Sep-12-2022, 11:59 AM
Last Post: malonn
  [PyQt] Embed Google Maps in PyQt6 Widget Raures 2 3,184 Sep-11-2021, 04:32 PM
Last Post: Raures
  [Tkinter] logical error - saving file rwahdan 4 2,199 Jul-01-2021, 12:59 PM
Last Post: rwahdan
  [PyQt] saving text file by FileDialog option atlass218 14 4,753 Feb-19-2020, 09:22 AM
Last Post: atlass218
  Part of code is adding extra new line when saving to text file. lovepeace 9 5,125 Aug-24-2019, 12:52 PM
Last Post: lovepeace
  [PyQt5] [QWebEngineView] HTML file download nolme 0 5,080 May-08-2018, 08:41 PM
Last Post: nolme

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020