1 --- a/scribus/plugins/import/pdf/importpdf.cpp
2 +++ b/scribus/plugins/import/pdf/importpdf.cpp
3 @@ -74,7 +74,11 @@ PdfPlug::PdfPlug(ScribusDoc* doc, int flags)
4 QImage PdfPlug::readThumbnail(const QString& fName)
\r
6 QString pdfFile = QDir::toNativeSeparators(fName);
\r
7 +#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)
\r
8 + globalParams.reset(new GlobalParams());
\r
10 globalParams = new GlobalParams();
\r
14 #if defined(Q_OS_WIN32) && POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 62, 0)
\r
15 @@ -89,7 +93,9 @@ QImage PdfPlug::readThumbnail(const QString& fName)
16 if (pdfDoc->getErrorCode() == errEncrypted)
\r
19 +#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)
\r
20 delete globalParams;
\r
25 @@ -133,11 +139,15 @@ QImage PdfPlug::readThumbnail(const QString& fName)
26 image.setText("YSize", QString("%1").arg(h));
\r
29 +#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)
\r
30 delete globalParams;
\r
35 +#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)
\r
36 delete globalParams;
\r
41 @@ -343,7 +353,11 @@ bool PdfPlug::convert(const QString& fn)
42 qApp->processEvents();
\r
45 +#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)
\r
46 + globalParams.reset(new GlobalParams());
\r
48 globalParams = new GlobalParams();
\r
50 GooString *userPW = nullptr;
\r
53 @@ -385,7 +399,9 @@ bool PdfPlug::convert(const QString& fn)
55 progressDialog->close();
\r
57 +#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)
\r
58 delete globalParams;
\r
63 @@ -430,7 +446,9 @@ bool PdfPlug::convert(const QString& fn)
64 progressDialog->close();
\r
67 +#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)
\r
68 delete globalParams;
\r
72 pageString = optImp->getPagesString();
\r
73 @@ -843,8 +861,12 @@ bool PdfPlug::convert(const QString& fn)
77 +#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)
\r
78 + globalParams.release();
\r
80 delete globalParams;
\r
81 globalParams = nullptr;
\r
84 // qDebug() << "converting finished";
\r
85 // qDebug() << "Imported" << Elements.count() << "Elements";
\r
86 diff --git a/scribus/plugins/import/pdf/importpdfconfig.h b/scribus/plugins/import/pdf/importpdfconfig.h
87 index 9913ee382..5a7e0d216 100644
88 --- a/scribus/plugins/import/pdf/importpdfconfig.h
89 +++ b/scribus/plugins/import/pdf/importpdfconfig.h
90 @@ -58,4 +58,10 @@ for which a new license (GPL+exception) is in place.
91 #define POPPLER_CONST_082
\r
94 +#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)
\r
95 +#define POPPLER_CONST_083 const
\r
97 +#define POPPLER_CONST_083
\r
101 diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
102 index 5e4d32a55..ffcfa8450 100644
103 --- a/scribus/plugins/import/pdf/slaoutput.cpp
104 +++ b/scribus/plugins/import/pdf/slaoutput.cpp
105 @@ -3678,7 +3678,7 @@ QString SlaOutputDev::getAnnotationColor(const AnnotColor *color)
109 -QString SlaOutputDev::convertPath(GfxPath *path)
\r
110 +QString SlaOutputDev::convertPath(POPPLER_CONST_083 GfxPath *path)
\r
114 @@ -3688,7 +3688,7 @@ QString SlaOutputDev::convertPath(GfxPath *path)
116 for (int i = 0; i < path->getNumSubpaths(); ++i)
\r
118 - GfxSubpath * subpath = path->getSubpath(i);
\r
119 + POPPLER_CONST_083 GfxSubpath * subpath = path->getSubpath(i);
\r
120 if (subpath->getNumPoints() > 0)
\r
122 output += QString("M %1 %2").arg(subpath->getX(0)).arg(subpath->getY(0));
\r
123 diff --git a/scribus/plugins/import/pdf/slaoutput.h b/scribus/plugins/import/pdf/slaoutput.h
124 index 60fb90061..d928fada8 100644
125 --- a/scribus/plugins/import/pdf/slaoutput.h
126 +++ b/scribus/plugins/import/pdf/slaoutput.h
127 @@ -282,7 +282,7 @@ private:
128 void getPenState(GfxState *state);
\r
129 QString getColor(GfxColorSpace *color_space, POPPLER_CONST_070 GfxColor *color, int *shade);
\r
130 QString getAnnotationColor(const AnnotColor *color);
\r
131 - QString convertPath(GfxPath *path);
\r
132 + QString convertPath(POPPLER_CONST_083 GfxPath *path);
\r
133 int getBlendMode(GfxState *state);
\r
134 void applyMask(PageItem *ite);
\r
135 void pushGroup(const QString& maskName = "", GBool forSoftMask = gFalse, GBool alpha = gFalse, bool inverted = false);
\r
136 --- a/scribus/plugins/import/pdf/slaoutput.cpp
137 +++ b/scribus/plugins/import/pdf/slaoutput.cpp
138 @@ -1189,6 +1189,11 @@ void SlaOutputDev::startDoc(PDFDoc *doc, XRef *xrefA, Catalog *catA)
141 updateGUICounter = 0;
\r
142 +#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 84, 0)
\r
143 + m_fontEngine = new SplashFontEngine(true, true, true, true);
\r
144 +#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 61, 0)
\r
145 + m_fontEngine = new SplashFontEngine(globalParams->getEnableFreeType(), true, true, true);
\r
147 m_fontEngine = new SplashFontEngine(
\r
149 globalParams->getEnableT1lib(),
\r
150 @@ -1199,6 +1204,7 @@ void SlaOutputDev::startDoc(PDFDoc *doc, XRef *xrefA, Catalog *catA)
157 void SlaOutputDev::startPage(int pageNum, GfxState *, XRef *)
\r