From 3875da3ae31515dad4f2aa7ac5f59f2c2f70c32c Mon Sep 17 00:00:00 2001
From: daeho-ro <lamanus@techready.ai>
Date: Sun, 7 Jun 2026 18:54:09 +0900
Subject: [PATCH] pdftoipe: Fix build on poppler 26.06

poppler 26.06 changed Page::getMediaBox()/getCropBox() to return a
const reference instead of a pointer. Guard with POPPLER_VERSION_AT_LEAST
so the code keeps building against both older and newer poppler.
---
 pdftoipe/xmloutputdev.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/pdftoipe/xmloutputdev.cpp b/pdftoipe/xmloutputdev.cpp
index eab6c44..39c48d6 100644
--- a/ipe-tools/pdftoipe/xmloutputdev.cpp
+++ b/ipe-tools/pdftoipe/xmloutputdev.cpp
@@ -64,8 +64,13 @@ XmlOutputDev::XmlOutputDev(const std::string &fileName, XRef *xrefA,
   }
   */
 
+#if POPPLER_VERSION_AT_LEAST(26, 6, 0)
+  const PDFRectangle *media = &page->getMediaBox();
+  const PDFRectangle *crop = &page->getCropBox();
+#else
   const PDFRectangle *media = page->getMediaBox();
   const PDFRectangle *crop = page->getCropBox();
+#endif
 
   fprintf(stderr, "MediaBox: %g %g %g %g (%g x %g)\n", media->x1, media->x2,
           media->y1, media->y2, wid, ht);
