QPdfWriter¶
- PyQt5.QtGui.QPdfWriter
Inherits from QObject, QPagedPaintDevice.
Description¶
The QPdfWriter class is a class to generate PDFs that can be used as a paint device.
QPdfWriter generates PDF out of a series of drawing commands using QPainter. The newPage() method can be used to create several pages.
Methods¶
- __init__(str)
Constructs a PDF writer that will write the pdf to filename.
- __init__(QIODevice)
Constructs a PDF writer that will write the pdf to device.
- addFileAttachment(str, Union[QByteArray, bytes, bytearray], mimeType: str = '')
TODO
- creator() str
Returns the creator of the document.
See also
- documentXmpMetadata() QByteArray
TODO
- metric(PaintDeviceMetric) int
TODO
- newPage() bool
TODO
- paintEngine() QPaintEngine
TODO
- pdfVersion() PdfVersion
Returns the PDF version for this writer. The default is
PdfVersion_1_4
.See also
- resolution() int
Returns the resolution of the PDF in DPI.
See also
- setCreator(str)
Sets the creator of the document to creator.
See also
- setDocumentXmpMetadata(Union[QByteArray, bytes, bytearray])
TODO
- setMargins(Margins)
TODO
- setPageSize(PageSize)
TODO
- setPageSize(QPageSize) bool
TODO
- setPageSizeMM(QSizeF)
TODO
- setPdfVersion(PdfVersion)
TODO
- setResolution(int)
Sets the PDF resolution in DPI.
This setting affects the coordinate system as returned by, for example viewport().
See also
- setTitle(str)
Sets the title of the document being created to title.
See also
- title() str
Returns the title of the document.
See also