Fix with poppler-26.01.0 -- poppler-26.04.0.

From https://gitlab.com/KrIr17/inkscape/-/commits/poppler_26_04_1.4.3

Index: src/extension/internal/pdfinput/svg-builder.cpp
--- src/extension/internal/pdfinput/svg-builder.cpp.orig
+++ src/extension/internal/pdfinput/svg-builder.cpp
@@ -32,6 +32,7 @@
 #include <poppler/GfxState.h>
 #include <poppler/Page.h>
 #include <poppler/Stream.h>
+#include <poppler/goo/gmem.h>
 
 #include "color.h"
 #include "color/cms-util.h"
@@ -1385,7 +1386,7 @@ void SvgBuilder::updateFont(GfxState *state, std::shar
     sp_repr_css_set_property(_css_font, "font-variant", "normal");
 
     // Writing mode
-    if ( font->getWMode() == 0 ) {
+    if ( font->getWMode() == _POPPLER_WMODE_HORIZONTAL ) {
         sp_repr_css_set_property(_css_font, "writing-mode", "lr");
     } else {
         sp_repr_css_set_property(_css_font, "writing-mode", "tb");
@@ -1397,7 +1398,7 @@ void SvgBuilder::updateFont(GfxState *state, std::shar
  */
 void SvgBuilder::updateTextShift(GfxState *state, double shift) {
     double shift_value = -shift * 0.001 * fabs(state->getFontSize());
-    if (state->getFont()->getWMode()) {
+    if (state->getFont()->getWMode() != _POPPLER_WMODE_HORIZONTAL) {
         _text_position[1] += shift_value;
     } else {
         _text_position[0] += shift_value;
@@ -1451,7 +1452,7 @@ Inkscape::XML::Node* SvgBuilder::_flushTextText(GfxSta
 
     // Text direction is a property of the <text> element.
     auto font = state->getFont();
-    if (font->getWMode() == 1) {
+    if (font->getWMode() == _POPPLER_WMODE_VERTICAL) {
         // Only set if vertical.
         auto css_text = sp_repr_css_attr_new();
         sp_repr_css_set_property(css_text, "writing-mode", "tb");
@@ -1545,8 +1546,8 @@ Inkscape::XML::Node* SvgBuilder::_flushTextText(GfxSta
         bool output_tspan =
             next_it == _glyphs.end() ||
             next_it->style_changed   ||
-            (writing_mode == 0 && std::abs(glyph.text_position[1] - next_it->text_position[1]) > 0.1) ||
-            (writing_mode == 1 && std::abs(glyph.text_position[0] - next_it->text_position[0]) > 0.1);
+            (writing_mode == _POPPLER_WMODE_HORIZONTAL && std::abs(glyph.text_position[1] - next_it->text_position[1]) > 0.1) ||
+            (writing_mode == _POPPLER_WMODE_VERTICAL   && std::abs(glyph.text_position[0] - next_it->text_position[0]) > 0.1);
 
         if (output_tspan) {
 
@@ -2093,7 +2094,21 @@ Inkscape::XML::Node *SvgBuilder::_createImage(Stream *
         } else {
             image_stream = new ImageStream(str, width, 1, 1);
         }
+#if POPPLER_CHECK_VERSION(26, 0, 0)
+        if(!image_stream->rewind())
+        {
+            g_warning("ImageStream: Failed to rewind image stream");
+            png_destroy_write_struct(&png_ptr, &info_ptr);
+            if (!_embed_images) {
+                fclose(fp);
+                g_free(file_name);
+            }
+            delete image_stream;
+            return nullptr;
+        }
+#else
         image_stream->reset();
+#endif
 
         // Convert grayscale values
         unsigned char *buffer = new unsigned char[width];
@@ -2119,7 +2134,21 @@ Inkscape::XML::Node *SvgBuilder::_createImage(Stream *
         image_stream = new ImageStream(str, width,
                                        color_map->getNumPixelComps(),
                                        color_map->getBits());
+#if POPPLER_CHECK_VERSION(26, 0, 0)
+        if(!image_stream->rewind())
+        {
+            g_warning("ImageStream: Failed to rewind image stream");
+            png_destroy_write_struct(&png_ptr, &info_ptr);
+            if (!_embed_images) {
+                fclose(fp);
+                g_free(file_name);
+            }
+            delete image_stream;
+            return nullptr;
+        }
+#else
         image_stream->reset();
+#endif
 
         // Convert RGB values
         unsigned int *buffer = new unsigned int[width];
