QGIS API Documentation 3.41.0-Master (3440c17df1d)
|
Utility class for rendering PDF documents. More...
#include <qgspdfrenderer.h>
Public Member Functions | |
QgsPdfRenderer (const QgsPdfRenderer &other)=delete | |
QgsPdfRenderer (const QString &path) | |
Constructs a PDF renderer for the file at the specified path. | |
~QgsPdfRenderer () | |
QgsPdfRenderer & | operator= (const QgsPdfRenderer &other)=delete |
int | pageCount () const |
Returns the number of pages in the PDF. | |
QRectF | pageMediaBox (int pageNumber) const |
Returns the media box for the specified page. | |
QString | path () const |
Returns the file path of the associated PDF file. | |
bool | render (QPainter *painter, const QRectF &painterRect, int pageIndex) |
Renders the PDF from the specified path to a painter. | |
Utility class for rendering PDF documents.
This functionality is not available on all platforms – it requires a build with the PDF4Qt library support enabled. On other platforms calling these methods will raise a QgsNotSupportedException.
Definition at line 46 of file qgspdfrenderer.h.
QgsPdfRenderer::QgsPdfRenderer | ( | const QString & | path | ) |
Constructs a PDF renderer for the file at the specified path.
Definition at line 60 of file qgspdfrenderer.cpp.
|
default |
|
delete |
|
delete |
int QgsPdfRenderer::pageCount | ( | ) | const |
Returns the number of pages in the PDF.
QgsNotSupportedException | on QGIS builds without PDF4Qt library support. |
Definition at line 77 of file qgspdfrenderer.cpp.
QRectF QgsPdfRenderer::pageMediaBox | ( | int | pageNumber | ) | const |
Returns the media box for the specified page.
Units are in PDF points.
QgsNotSupportedException | on QGIS builds without PDF4Qt library support. |
Definition at line 93 of file qgspdfrenderer.cpp.
|
inline |
Returns the file path of the associated PDF file.
Definition at line 62 of file qgspdfrenderer.h.
bool QgsPdfRenderer::render | ( | QPainter * | painter, |
const QRectF & | painterRect, | ||
int | pageIndex | ||
) |
Renders the PDF from the specified path to a painter.
The painterRect argument specifies the target rectangle for the PDF page in painter coordinates.
QgsNotSupportedException | on QGIS builds without PDF4Qt library support. |
Definition at line 106 of file qgspdfrenderer.cpp.