QPdfWriter露

The QPdfWriter class is a class to generate PDFs that can be used as a paint device. More鈥�

Inheritance diagram of PySide2.QtGui.QPdfWriter

Synopsis露

Functions露

Detailed Description露

QPdfWriter generates PDF out of a series of drawing commands using QPainter . The newPage() method can be used to create several pages.

class PySide2.QtGui.QPdfWriter(device)露

PySide2.QtGui.QPdfWriter(filename)

param device:

PySide2.QtCore.QIODevice

param filename:

str

Constructs a PDF writer that will write the pdf to device .

PySide2.QtGui.QPdfWriter.addFileAttachment(fileName, data[, mimeType=""])露
Parameters:

Adds fileName attachment to the PDF with (optional) mimeType . data contains the raw file data to embed into the PDF file.

PySide2.QtGui.QPdfWriter.creator()露
Return type:

str

Returns the creator of the document.

See also

setCreator()

PySide2.QtGui.QPdfWriter.documentXmpMetadata()露
Return type:

PySide2.QtCore.QByteArray

Gets the document metadata, as it was provided with a call to setDocumentXmpMetadata . It will not return the default metadata.

PySide2.QtGui.QPdfWriter.pdfVersion()露
Return type:

PdfVersion

Returns the PDF version for this writer. The default is PdfVersion_1_4 .

See also

setPdfVersion()

PySide2.QtGui.QPdfWriter.resolution()露
Return type:

int

Returns the resolution of the PDF in DPI.

See also

setResolution()

PySide2.QtGui.QPdfWriter.setCreator(creator)露
Parameters:

creator 鈥� str

Sets the creator of the document to creator .

See also

creator()

PySide2.QtGui.QPdfWriter.setDocumentXmpMetadata(xmpMetadata)露
Parameters:

xmpMetadata 鈥� PySide2.QtCore.QByteArray

Sets the document metadata. This metadata is not influenced by the setTitle / setCreator methods, so is up to the user to keep it consistent. xmpMetadata contains XML formatted metadata to embed into the PDF file.

PySide2.QtGui.QPdfWriter.setPdfVersion(version)露
Parameters:

version 鈥� PdfVersion

Sets the PDF version for this writer to version .

If version is the same value as currently set then no change will be made.

See also

pdfVersion()

PySide2.QtGui.QPdfWriter.setResolution(resolution)露
Parameters:

resolution 鈥� int

Sets the PDF resolution in DPI.

This setting affects the coordinate system as returned by, for example viewport() .

See also

resolution()

PySide2.QtGui.QPdfWriter.setTitle(title)露
Parameters:

title 鈥� str

Sets the title of the document being created to title .

See also

title()

PySide2.QtGui.QPdfWriter.title()露
Return type:

str

Returns the title of the document.

See also

setTitle()