Engauge Digitizer 2
Loading...
Searching...
No Matches
Pdf Class Reference

Wrapper around the Poppler library. More...

#include <Pdf.h>

Collaboration diagram for Pdf:
Collaboration graph

Public Member Functions

 Pdf ()
 Single constructor.
PdfReturn load (const QString &fileName, QImage &image, int resolution, ImportCropping importCropping, bool isErrorReportRegressionTest) const
 Try to load the specified file. Success is indicated in the function return value.

Detailed Description

Wrapper around the Poppler library.

Engauge uses that library to read and import PDF files.

This class is only compiled and linked in when ENGAUGE_PDF is defined, since it links to the optional poppler library.

Definition at line 28 of file Pdf.h.

Constructor & Destructor Documentation

◆ Pdf()

Pdf::Pdf ( )

Single constructor.

Definition at line 21 of file Pdf.cpp.

22{
23}

Member Function Documentation

◆ load()

PdfReturn Pdf::load ( const QString & fileName,
QImage & image,
int resolution,
ImportCropping importCropping,
bool isErrorReportRegressionTest ) const

Try to load the specified file. Success is indicated in the function return value.

Definition at line 25 of file Pdf.cpp.

30{
31 Document *document = nullptr;
32
33 ImportCroppingUtilPdf importCroppingUtil;
34 bool cropping = importCroppingUtil.applyImportCropping (isErrorReportRegressionTest,
35 fileName,
36 importCropping,
37 document);
38
39 PdfReturn rtn;
40 QApplication::setOverrideCursor(Qt::BusyCursor); // Since loading can be slow
41 if (cropping) {
42
43 rtn = loadWithCropping (document,
44 image,
45 resolution);
46
47 } else {
48
49 rtn = loadWithoutCropping (fileName,
50 image,
51 resolution);
52
53 }
54 QApplication::restoreOverrideCursor();
55
56 delete document;
57 document = nullptr;
58
59 return rtn;
60}
PdfReturn
Return values from load operation.
Definition Pdf.h:19
bool applyImportCropping(bool isRegression, const QString &fileName, ImportCropping importCropping, Poppler::Document *&document) const
For pdf files, skip cropping dialog during regression testing, otherwise crop if it is always turned ...

The documentation for this class was generated from the following files: