QGIS API Documentation 4.3.0-Master (d583d975f4e)
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 "qgsconfig.h"
22
23#include <memory>
24
25#include "qgis.h"
26#include "qgis_core.h"
27#include "qgis_sip.h"
28
29#include <QString>
30
31#ifdef HAVE_PDF4QT
32#endif
33
34class QPainter;
35class QRectF;
36class PdfDocumentContainer;
37
38
50class CORE_EXPORT QgsPdfRenderer
51{
52 public:
58
59 QgsPdfRenderer( const QgsPdfRenderer &other ) = delete;
60 QgsPdfRenderer &operator=( const QgsPdfRenderer &other ) = delete;
61
65 QString path() const { return mPath; }
66
72 int pageCount() const SIP_THROW( QgsNotSupportedException );
73
79 QRectF pageMediaBox( int pageNumber ) const SIP_THROW( QgsNotSupportedException );
80
89 bool render( QPainter *painter, const QRectF &painterRect, int pageIndex ) SIP_THROW( QgsNotSupportedException );
90
91 private:
92#ifdef SIP_RUN
93 QgsPdfRenderer( const QgsPdfRenderer &other );
94#endif
95
96 QString mPath;
98
99#ifdef HAVE_PDF4QT
100 std::unique_ptr< PdfDocumentContainer> mDocumentContainer;
101#endif
102};
103
104#endif // QGSPDFRENDERER_H
QFlags< PdfRenderFlag > PdfRenderFlags
PDF rendering flags.
Definition qgis.h:6960
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.
QgsPdfRenderer(const QString &path, Qgis::PdfRenderFlags flags=Qgis::PdfRenderFlags())
Constructs a PDF renderer for the file at the specified path.
#define SIP_THROW(name,...)
Definition qgis_sip.h:210