% python
Python 3.9.1 (default, Dec 13 2020, 11:55:53)
[GCC 10.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from PySide2.QtWidgets import QApplication
>>> app = QApplication()
>>> from PySide2.QtPrintSupport import QPrinter
>>> from PySide2.QtCore import QMarginsF
>>> printer = QPrinter()
>>> printer.pageLayout()
<PySide2.QtGui.QPageLayout("A4", Portrait, l:10 r:10 t:10 b:10 pt) at 0x7f0c246820c0>
>>> printer.setPageMargins(QMarginsF(1, 15, 15, 100))
True
>>> printer.pageLayout()
<PySide2.QtGui.QPageLayout("A4", Portrait, l:1 r:15 t:15 b:100 pt) at 0x7f0c246820c0>
🤷♂️