Engauge Digitizer  2
Pdf.h
1 /******************************************************************************************************
2  * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3  * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4  * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5  ******************************************************************************************************/
6 
7 #ifndef PDF_H
8 #define PDF_H
9 
10 #include "ImportCropping.h"
11 
12 namespace Poppler {
13  class Document;
14 }
15 class QImage;
16 class QString;
17 
19 enum PdfReturn {
20  PDF_RETURN_CANCELED,
21  PDF_RETURN_FAILED,
22  PDF_RETURN_SUCCESS
23 };
24 
28 class Pdf
29 {
30 public:
32  Pdf();
33 
35  PdfReturn load (const QString &fileName,
36  QImage &image,
37  int resolution,
38  ImportCropping importCropping,
39  bool isErrorReportRegressionTest) const;
40 
41 private:
42 
43  PdfReturn loadWithCropping (Poppler::Document *document,
44  QImage &image,
45  int resolution) const; // Dialog is used when not testing
46  PdfReturn loadWithoutCropping (const QString &fileName,
47  QImage &image,
48  int resolution) const; // No dialog is used during testing. Entire first page will be loaded
49 
50 };
51 
52 #endif // PDF_H
Wrapper around the Poppler library.
Definition: Pdf.h:28
Storage of one imported image and the data attached to that image.
Definition: Document.h:41