From 6f7bfe5269912021229e570675ac0fbd9ad4f082 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 27 Feb 2018 10:24:37 -0500 Subject: Get lumina-pdf all up and running again. 1. Abstract out the backend renderer into a new class 2. The Renderer can be selected at build time by setting the "USE_MUPDF" build flag to use mupdf instead of poppler (default). --- src-qt5/desktop-utils/lumina-pdf/Renderer.h | 39 +++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src-qt5/desktop-utils/lumina-pdf/Renderer.h (limited to 'src-qt5/desktop-utils/lumina-pdf/Renderer.h') diff --git a/src-qt5/desktop-utils/lumina-pdf/Renderer.h b/src-qt5/desktop-utils/lumina-pdf/Renderer.h new file mode 100644 index 00000000..09e9c425 --- /dev/null +++ b/src-qt5/desktop-utils/lumina-pdf/Renderer.h @@ -0,0 +1,39 @@ +// ================================ +// Simple abstraction class between backend renderers +// ================================ +// Written by Ken Moore: Feb 26, 2018 +// Available under the 3-Clause BSD License +// ================================ +#ifndef _LUMINA_PDF_BACKEND_RENDERER_H +#define _LUMINA_PDF_BACKEND_RENDERER_H + +#include +#include +#include +#include +#include "textData.h" + +class Renderer{ +private: + int pnum; //number of pages - set on loading document + bool needpass; + QString docpath; //save the path for the currently-loaded document + QString doctitle; +public: + Renderer(); + ~Renderer(); + bool loadMultiThread(); + + //Information functions (usually needs to be loaded first) + int numPages(){ return pnum; } + bool needPassword(){ return needpass; } + QString title(){ return doctitle; } + QJsonObject properties(); + + //Main access functions + bool loadDocument(QString path, QString password); + QImage renderPage(int pagenum, QSize DPI); + QList searchDocument(QString text, bool matchCase); +}; + +#endif -- cgit