QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
qgspdfrenderer.h
Go to the documentation of this file.
1/***************************************************************************
2 qgspdfrenderer.h
3 -------------------
4 begin : December 2023
5 copyright : (C) 2023 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSPDFRENDERER_H
19#define QGSPDFRENDERER_H
20
21#include "qgis_sip.h"
22#include "qgis_core.h"
23#include "qgsconfig.h"
24#include <QString>
25#include <memory>
26
27#ifdef HAVE_PDF4QT
28#endif
29
30class QPainter;
31class QRectF;
32class PdfDocumentContainer;
33
34
46class CORE_EXPORT QgsPdfRenderer
47{
48 public:
49
53 QgsPdfRenderer( const QString &path );
55
56 QgsPdfRenderer( const QgsPdfRenderer &other ) = delete;
57 QgsPdfRenderer &operator=( const QgsPdfRenderer &other ) = delete;
58
62 QString path() const { return mPath; }
63
69 int pageCount() const SIP_THROW( QgsNotSupportedException );
70
76 QRectF pageMediaBox( int pageNumber ) const SIP_THROW( QgsNotSupportedException );
77
86 bool render( QPainter *painter, const QRectF &painterRect, int pageIndex ) SIP_THROW( QgsNotSupportedException );
87
88 private:
89
90#ifdef SIP_RUN
91 QgsPdfRenderer( const QgsPdfRenderer &other );
92#endif
93
94 QString mPath;
95
96#ifdef HAVE_PDF4QT
97 std::unique_ptr< PdfDocumentContainer> mDocumentContainer;
98#endif
99};
100
101#endif // QGSPDFRENDERER_H
Custom exception class which is raised when an operation is not supported.
Utility class for rendering PDF documents.
QgsPdfRenderer & operator=(const QgsPdfRenderer &other)=delete
QgsPdfRenderer(const QgsPdfRenderer &other)=delete
QString path() const
Returns the file path of the associated PDF file.
#define SIP_THROW(name,...)
Definition qgis_sip.h:203