From 244771b2dc3e565cb02ad3d46812d0c4add3b7c0 Mon Sep 17 00:00:00 2001
From: Matthias Kilian <kili@outback.escape.de>
Date: Wed, 11 Mar 2026 23:17:00 +0100
Subject: [PATCH] Fix build with poppler-26.03.0.

(cherry picked from commit 754a866b878623554ade26d53496eeb8687c4685)
---
 src/extension/internal/pdfinput/pdf-parser.cpp    | 4 ++++
 src/extension/internal/pdfinput/poppler-utils.cpp | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
index c44bef277f..9f9fcea40a 100644
--- a/src/extension/internal/pdfinput/pdf-parser.cpp
+++ b/src/extension/internal/pdfinput/pdf-parser.cpp
@@ -2951,7 +2951,11 @@ Stream *PdfParser::buildImageStream() {
 
   // build dictionary
 #if defined(POPPLER_NEW_OBJECT_API)
+#if POPPLER_CHECK_VERSION(26, 3, 0)
+  dict = Object(std::make_unique<Dict>(xref));
+#else
   dict = Object(new Dict(xref));
+#endif
 #else
   dict.initDict(xref);
 #endif
diff --git a/src/extension/internal/pdfinput/poppler-utils.cpp b/src/extension/internal/pdfinput/poppler-utils.cpp
index fac42152eb..b85963e65e 100644
--- a/src/extension/internal/pdfinput/poppler-utils.cpp
+++ b/src/extension/internal/pdfinput/poppler-utils.cpp
@@ -88,7 +88,11 @@ InkFontDict::InkFontDict(XRef *xref, Ref *fontDictRef, Dict *fontDict)
                 r.num = hashFontObject(&obj2);
             }
             // Newer poppler will require some reworking as it gives a shared ptr.
+#if POPPLER_CHECK_VERSION(26,3,0)
+            fonts[i] = GfxFont::makeFont(xref, fontDict->getKey(i), r, *obj2.getDict());
+#else
             fonts[i] = GfxFont::makeFont(xref, fontDict->getKey(i), r, obj2.getDict());
+#endif
             if (fonts[i] && !fonts[i]->isOk()) {
                 fonts[i] = nullptr;
             }
-- 
GitLab


