summaryrefslogtreecommitdiff
path: root/src/data/pdfdocument.h
blob: ebd33e9ebcba00768de008cdae5ca710a950ef9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef PDFDOCUMENT_H
#define PDFDOCUMENT_H

#include <QObject>
#include <QString>
#include <QLabel>

#include <poppler/qt5/poppler-qt5.h>

class PdfDocument : public QObject
{
    Q_OBJECT
public:
    explicit PdfDocument(QString file, QObject *parent = nullptr);
    void renderTo(QLabel *label, QRect rect);
    bool isValid();
//    void exportToSvg(QString file, QSize size);
    bool exportImage(QString file, const char *format, QSize outputSize=QSize());
    bool exportPdf(QString file);
    void copyImageToClipboard(QSize outputSize=QSize());
    QImage asImage(QSize outputSize=QSize());
    QSize size();
private:
    Poppler::Document *_doc;
    Poppler::Page *_page;
};

#endif // PDFDOCUMENT_H