summaryrefslogtreecommitdiff
path: root/src/data/pdfdocument.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/data/pdfdocument.h')
-rw-r--r--src/data/pdfdocument.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/data/pdfdocument.h b/src/data/pdfdocument.h
new file mode 100644
index 0000000..ebd33e9
--- /dev/null
+++ b/src/data/pdfdocument.h
@@ -0,0 +1,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