From 6cd6467566b53bab745ad8450adb6f7324206a18 Mon Sep 17 00:00:00 2001 From: Luigi Arone Date: Tue, 12 May 2026 20:48:08 -0300 Subject: [PATCH] Support Poppler 26.4+ API change In Poppler 26.4, getString() was changed to return a reference to GooString instead of a pointer. This break compilation against recent Poppler versions. Add a new branch to the version check to handle the new API while keeping compatibility with older versions. --- src/pdf/XPDFRenderer.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pdf/XPDFRenderer.cpp b/src/pdf/XPDFRenderer.cpp index 8e361430c..4965ea0cc 100644 --- a/src/pdf/XPDFRenderer.cpp +++ b/src/pdf/XPDFRenderer.cpp @@ -176,9 +176,11 @@ QString XPDFRenderer::title() const Object title; infoDict->lookup((char*)"Title", &title); #endif - if (title.isString()) - { -#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 72 + if (title.isString()) + { +#if POPPLER_VERSION_MAJOR > 26 || (POPPLER_VERSION_MAJOR == 26 && POPPLER_VERSION_MINOR >= 4) + return QString(title.getString().c_str()); +#elif POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 72 return QString(title.getString()->c_str()); #else return QString(title.getString()->getCString());