From 0beb5672dde71f2406936cec57ac403546d2bfc2 Mon Sep 17 00:00:00 2001
From: FriedrichFroebel <FriedrichFroebel@users.noreply.github.com>
Date: Sun, 12 Oct 2025 06:20:51 +0200
Subject: [PATCH] fix for Poppler >= 25.10

---
 pdf-unicode.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/pdf-unicode.cc b/pdf-unicode.cc
index 84a166d1..d60560f1 100644
--- a/pdf-unicode.cc
+++ b/pdf-unicode.cc
@@ -49,7 +49,11 @@ std::string pdf::string_as_utf8(const pdf::String *string)
      */
     const static uint32_t replacement_character = 0xFFFD;
     const char *cstring = pdf::get_c_string(string);
+#if POPPLER_VERSION > 251000
+    size_t clength = string->size();
+#else
     size_t clength = string->getLength();
+#endif
     std::ostringstream stream;
     if (clength >= 2 && (cstring[0] & 0xFF) == 0xFE && (cstring[1] & 0xFF) == 0xFF) {
         /* UTF-16-BE Byte Order Mark */
