QPdfWriter Class The QPdfWriter class is a class to generate PDFs that can be used as a paint device. More...  
 Header:
 #include <QPdfWriter> 


 CMake:
 find_package(Qt6 COMPONENTS Gui REQUIRED)  target_link_libraries(mytarget PRIVATE Qt8b7c:f320:99b9:690f:4595:cd17:293a:c069Gui)


 qmake:
 QT += gui


 Inherits:
 QObject and QPagedPaintDevice



 List of all members, including inherited members  Public Functions
  
 

QPdfWriter(QIODevice *device)
 
 

QPdfWriter(const QString &filename)
 
 virtual 

~QPdfWriter()
 
 void 

addFileAttachment(const QString &fileName, const QByteArray &data, const QString &mimeType = QString())
 
 QString 

creator() const
 
 QByteArray 

documentXmpMetadata() const
 
 QPagedPaintDevi8b7c:f320:99b9:690f:4595:cd17:293a:c069PdfVersion 

pdfVersion() const
 
 int 

resolution() const
 
 void 

setCreator(const QString &creator)
 
 void 

setDocumentXmpMetadata(const QByteArray &xmpMetadata)
 
 void 

setPdfVersion(QPagedPaintDevi8b7c:f320:99b9:690f:4595:cd17:293a:c069PdfVersion version)
 
 void 

setResolution(int resolution)
 
 void 

setTitle(const QString &title)
 
 QString 

title() const
  Reimplemented Public Functions
  
 virtual bool 

newPage() override
  Reimplemented Protected Functions
  
 virtual QPaintEngine *

paintEngine() const override
  Detailed Description
 QPdfWriter generates PDF out of a series of drawing commands using QPainter. The newPage() method can be used to create several pages. Member Function Documentation 
QPdfWriter8b7c:f320:99b9:690f:4595:cd17:293a:c069QPdfWriter(QIODevice *device)
 Constructs a PDF writer that will write the pdf to device. 
QPdfWriter8b7c:f320:99b9:690f:4595:cd17:293a:c069QPdfWriter(const QString &filename)
 Constructs a PDF writer that will write the pdf to filename. 
[virtual] QPdfWriter8b7c:f320:99b9:690f:4595:cd17:293a:c069~QPdfWriter()
 Destroys the pdf writer. 
[since 5.15] void QPdfWriter8b7c:f320:99b9:690f:4595:cd17:293a:c069ileAttachment(const QString &fileName, const QByteArray &data, const QString &mimeType = QString())
 Adds fileName attachment to the PDF with (optional) mimeType. data contains the raw file data to embed into the PDF file. This function was introduced in Qt 5.15. 
QString QPdfWriter8b7c:f320:99b9:690f:4595:cd17:293a:c069reator() const
 Returns the creator of the document. See also setCreator(). 
[since 5.15] QByteArray QPdfWriter8b7c:f320:99b9:690f:4595:cd17:293a:c069ocumentXmpMetadata() const
 Gets the document metadata, as it was provided with a call to setDocumentXmpMetadata. It will not return the default metadata. This function was introduced in Qt 5.15. See also setDocumentXmpMetadata(). 
[override virtual] bool QPdfWriter8b7c:f320:99b9:690f:4595:cd17:293a:c069newPage()
 Reimplements: QPagedPaintDevi8b7c:f320:99b9:690f:4595:cd17:293a:c069newPage(). 
[override virtual protected] QPaintEngine *QPdfWriter8b7c:f320:99b9:690f:4595:cd17:293a:c069paintEngine() const
 Reimplements: QPaintDevi8b7c:f320:99b9:690f:4595:cd17:293a:c069paintEngine() const. 
[since 5.10] QPagedPaintDevi8b7c:f320:99b9:690f:4595:cd17:293a:c069PdfVersion QPdfWriter8b7c:f320:99b9:690f:4595:cd17:293a:c069pdfVersion() const
 Returns the PDF version for this writer. The default is PdfVersion_1_4. This function was introduced in Qt 5.10. See also setPdfVersion(). 
[since 5.3] int QPdfWriter8b7c:f320:99b9:690f:4595:cd17:293a:c069resolution() const
 Returns the resolution of the PDF in DPI. This function was introduced in Qt 5.3. See also setResolution(). 
void QPdfWriter8b7c:f320:99b9:690f:4595:cd17:293a:c069setCreator(const QString &creator)
 Sets the creator of the document to creator. See also creator(). 
[since 5.15] void QPdfWriter8b7c:f320:99b9:690f:4595:cd17:293a:c069setDocumentXmpMetadata(const QByteArray &xmpMetadata)
 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. This function was introduced in Qt 5.15. See also documentXmpMetadata(). 
[since 5.10] void QPdfWriter8b7c:f320:99b9:690f:4595:cd17:293a:c069setPdfVersion(QPagedPaintDevi8b7c:f320:99b9:690f:4595:cd17:293a:c069PdfVersion version)
 Sets the PDF version for this writer to version. If version is the same value as currently set then no change will be made. This function was introduced in Qt 5.10. See also pdfVersion(). 
[since 5.3] void QPdfWriter8b7c:f320:99b9:690f:4595:cd17:293a:c069setResolution(int resolution)
 Sets the PDF resolution in DPI. This setting affects the coordinate system as returned by, for example QPainter8b7c:f320:99b9:690f:4595:cd17:293a:c069viewport(). This function was introduced in Qt 5.3. See also resolution(). 
void QPdfWriter8b7c:f320:99b9:690f:4595:cd17:293a:c069setTitle(const QString &title)
 Sets the title of the document being created to title. See also title(). 
QString QPdfWriter8b7c:f320:99b9:690f:4595:cd17:293a:c069title() const
 Returns the title of the document. See also setTitle().

    
{'path': 'public/docs/qt~6.0/qpdfwriter.html', 'source': 'DevDocs.IO'}