From 4df11418d8715f6bb82967d8ed81675625d49169 Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Sun, 31 May 2026 14:15:52 +0200 Subject: [PATCH 01/19] bump poppler 26.05.0 --- buildScripts/versionEnvs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/buildScripts/versionEnvs b/buildScripts/versionEnvs index 9ef5f8b7..7fb20282 100755 --- a/buildScripts/versionEnvs +++ b/buildScripts/versionEnvs @@ -8,7 +8,8 @@ export PDF2HTMLEX_VERSION=0.18.8.rc2 -export POPPLER_VERSION=poppler-24.06.1 +export POPPLER_VERSION=poppler-26.05.0 +#export POPPLER_VERSION=poppler-24.06.1 #export POPPLER_VERSION=poppler-24.01.0 #export POPPLER_VERSION=poppler-23.12.0 #export POPPLER_VERSION=poppler-21.02.0 From 3d22c4784f61bd08b72f2dcb8e63abc4961669f4 Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Sun, 31 May 2026 14:19:36 +0200 Subject: [PATCH 02/19] increase ubuntu version --- .github/workflows/build.yml | 2 +- .travis.yml | 28 ---------------------------- 2 files changed, 1 insertion(+), 29 deletions(-) delete mode 100644 .travis.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c1a39cfa..dcadb51d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,7 +4,7 @@ on: [push] jobs: build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Checkout Code uses: actions/checkout@v4 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9189c38b..00000000 --- a/.travis.yml +++ /dev/null @@ -1,28 +0,0 @@ -language: cpp - -# NOTE: Since we do not have direct access to either MacOS or Windows -# machines on which to develop WE DO NOT support building on MacOS or -# Windows. - -# For Windows, it is known that the more recent Windows 10 versions are -# able to use either the debian archive OR AppImage (as Windows 10 now -# allows FUSE). - -compiler: gcc - -branches: - except: # do not build tags that we create using the upload.sh script - - /^(?i:continuous.*)$/ - -jobs: - fast_finish: true - include: - - os: linux - dist: bionic - env: CONTAINER_FROM="ubuntu:18.04" - services: - - docker - addons: - firefox: latest - script: - - ./buildScripts/travisLinuxDoItAll From 9c86640dc30f21d8998bd343dc0c5376ecb54942 Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Sun, 31 May 2026 14:42:14 +0200 Subject: [PATCH 03/19] couple of fixes --- buildScripts/versionEnvs | 1 + pdf2htmlEX/src/HTMLRenderer/font.cc | 38 +++++++++++------------------ pdf2htmlEX/src/StateManager.h | 4 +-- 3 files changed, 17 insertions(+), 26 deletions(-) diff --git a/buildScripts/versionEnvs b/buildScripts/versionEnvs index 7fb20282..8555690b 100755 --- a/buildScripts/versionEnvs +++ b/buildScripts/versionEnvs @@ -27,6 +27,7 @@ export POPPLER_VERSION=poppler-26.05.0 # see: https://github.com/fontforge/fontforge/releases # current working: 20230101 +#export FONTFORGE_VERSION=20251009 export FONTFORGE_VERSION=20230101 #export FONTFORGE_VERSION=20220308 #export FONTFORGE_VERSION=20190801 diff --git a/pdf2htmlEX/src/HTMLRenderer/font.cc b/pdf2htmlEX/src/HTMLRenderer/font.cc index ff27da24..027d6ae0 100644 --- a/pdf2htmlEX/src/HTMLRenderer/font.cc +++ b/pdf2htmlEX/src/HTMLRenderer/font.cc @@ -158,7 +158,7 @@ string HTMLRenderer::dump_embedded_font (GfxFont * font, FontInfo & info) throw 0; } - obj.streamReset(); + obj.streamRewind(); filepath = (char*)str_fmt("%s/f%llx%s", param.tmp_dir.c_str(), fn_id, suffix.c_str()); tmp_files.add(filepath); @@ -205,8 +205,8 @@ string HTMLRenderer::dump_type3_font (GfxFont * font, FontInfo & info) auto used_map = preprocessor.get_code_map(hash_ref(font->getID())); //calculate transformed metrics - const double * font_bbox = font->getFontBBox(); - const double * font_matrix = font->getFontMatrix(); + const double * font_bbox = font->getFontBBox().data(); + const double * font_matrix = font->getFontMatrix().data(); double transformed_bbox[4]; memcpy(transformed_bbox, font_bbox, 4 * sizeof(double)); /* @@ -266,7 +266,7 @@ string HTMLRenderer::dump_type3_font (GfxFont * font, FontInfo & info) cairo_set_font_matrix(cr, &m1); cairo_glyph_t glyph; - glyph.index = cur_font->getGlyph(code, nullptr, 0); + glyph.index = cur_font->getGlyph(code); glyph.x = 0; glyph.y = GLYPH_DUMP_EM_SIZE; cairo_show_glyphs(cr, &glyph, 1); @@ -403,8 +403,7 @@ void HTMLRenderer::embed_font(const string & filepath, GfxFont * font, FontInfo ofstream((char*)fn, ofstream::binary) << ifstream(filepath).rdbuf(); } - int * code2GID = nullptr; - int code2GID_len = 0; + std::vector code2GID; int maxcode = 0; Gfx8BitFont * font_8bit = nullptr; @@ -486,10 +485,9 @@ void HTMLRenderer::embed_font(const string & filepath, GfxFont * font, FontInfo else { ffw_reencode_glyph_order(); - if(std::unique_ptr fftt = FoFiTrueType::load((char*)filepath.c_str())) + if(std::unique_ptr fftt = FoFiTrueType::load(filepath.c_str(), 0)) { code2GID = font_8bit->getCodeToGIDMap(fftt.get()); - code2GID_len = 256; } } } @@ -547,14 +545,13 @@ void HTMLRenderer::embed_font(const string & filepath, GfxFont * font, FontInfo if((code2GID = _font->getCIDToGID())) { // use the mapping stored in _font - code2GID_len = _font->getCIDToGIDLen(); } else { // use the mapping stored in the file - if(std::unique_ptr fftt = FoFiTrueType::load((char*)filepath.c_str())) + if(std::unique_ptr fftt = FoFiTrueType::load(filepath.c_str(), 0)) { - code2GID = _font->getCodeToGIDMap(fftt.get(), &code2GID_len); + code2GID = _font->getCodeToGIDMap(fftt.get()); } } } @@ -592,17 +589,13 @@ void HTMLRenderer::embed_font(const string & filepath, GfxFont * font, FontInfo unordered_set codeset; bool name_conflict_warned = false; - auto ctu = font->getToUnicode(); - // NOTE: Poppler has changed its effective ABI - // in now expects the USER to increment any ref counters - assert(ctu); - ((CharCodeToUnicode *)ctu)->incRefCnt(); + const CharCodeToUnicode* ctu = font->getToUnicode(); std::fill(cur_mapping.begin(), cur_mapping.end(), -1); std::fill(width_list.begin(), width_list.end(), -1); - if(code2GID) - maxcode = min(maxcode, code2GID_len - 1); + if(!code2GID.empty()) + maxcode = min(maxcode, code2GID.size() - 1); bool is_truetype = is_truetype_suffix(suffix); int max_key = maxcode; @@ -625,7 +618,7 @@ void HTMLRenderer::embed_font(const string & filepath, GfxFont * font, FontInfo } int mapped_code = cur_code; - if(code2GID) + if(!code2GID.empty()) { // for fonts with GID (e.g. TTF) we need to map GIDs instead of codes if((mapped_code = code2GID[cur_code]) == 0) continue; @@ -639,7 +632,7 @@ void HTMLRenderer::embed_font(const string & filepath, GfxFont * font, FontInfo if(info.use_tounicode) { int n = ctu ? - (((CharCodeToUnicode *)ctu)->mapToUnicode(cur_code, &pu)) : + ctu->mapToUnicode(cur_code, &pu)) : 0; u = check_unicode(pu, n, cur_code, font); } @@ -760,9 +753,6 @@ void HTMLRenderer::embed_font(const string & filepath, GfxFont * font, FontInfo { cerr << "space width: " << info.space_width << endl; } - - if(ctu) - ((CharCodeToUnicode *)ctu)->decRefCnt(); } /* @@ -897,7 +887,7 @@ const FontInfo * HTMLRenderer::install_font(GfxFont * font) #endif return &new_font_info; } - if(font->getWMode()) { + if(font->getWMode() != GfxFont::WritingMode::Horizontal) { cerr << "Writing mode is unsupported and will be rendered as Image" << endl; export_remote_default_font(new_fn_id); return &new_font_info; diff --git a/pdf2htmlEX/src/StateManager.h b/pdf2htmlEX/src/StateManager.h index 9b6d44ea..db232572 100644 --- a/pdf2htmlEX/src/StateManager.h +++ b/pdf2htmlEX/src/StateManager.h @@ -107,7 +107,7 @@ class StateManager // return id long long install(const double * new_value) { Matrix m; - memcpy(m.m, new_value, 4 * sizeof(double)); + memcpy(m.m.data(), new_value, 4 * sizeof(double)); auto iter = value_map.lower_bound(m); if((iter != value_map.end()) && (tm_equal(m.m, iter->first.m, 4))) { @@ -316,7 +316,7 @@ class TransformMatrixManager : public StateManager Date: Sun, 31 May 2026 14:52:46 +0200 Subject: [PATCH 04/19] more fixes --- pdf2htmlEX/src/HTMLRenderer/font.cc | 17 +++++++++-------- pdf2htmlEX/src/HTMLRenderer/link.cc | 2 +- pdf2htmlEX/src/HTMLRenderer/state.cc | 2 +- pdf2htmlEX/src/StateManager.h | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/pdf2htmlEX/src/HTMLRenderer/font.cc b/pdf2htmlEX/src/HTMLRenderer/font.cc index 027d6ae0..7502c46a 100644 --- a/pdf2htmlEX/src/HTMLRenderer/font.cc +++ b/pdf2htmlEX/src/HTMLRenderer/font.cc @@ -265,12 +265,13 @@ string HTMLRenderer::dump_type3_font (GfxFont * font, FontInfo & info) cairo_matrix_multiply(&m1, &m1, &m2); cairo_set_font_matrix(cr, &m1); - cairo_glyph_t glyph; - glyph.index = cur_font->getGlyph(code); - glyph.x = 0; - glyph.y = GLYPH_DUMP_EM_SIZE; - cairo_show_glyphs(cr, &glyph, 1); - + if (auto glyphIndexOpt = cur_font->getGlyph(code)) { + cairo_glyph_t glyph; + glyph.index = *glyphIndexOpt; + glyph.x = 0; + glyph.y = GLYPH_DUMP_EM_SIZE; + cairo_show_glyphs(cr, &glyph, 1); + } // apply the type 3 font's font matrix before m1 // such that we got the mapping from type 3 font space to user space, then we will be able to calculate mapped position for ox,oy and glyph_width @@ -542,7 +543,7 @@ void HTMLRenderer::embed_font(const string & filepath, GfxFont * font, FontInfo // To locate CID2GID for the font // as in CairoFontEngine.cc - if((code2GID = _font->getCIDToGID())) + if(!(code2GID = _font->getCIDToGID()).empty()) { // use the mapping stored in _font } @@ -632,7 +633,7 @@ void HTMLRenderer::embed_font(const string & filepath, GfxFont * font, FontInfo if(info.use_tounicode) { int n = ctu ? - ctu->mapToUnicode(cur_code, &pu)) : + ctu->mapToUnicode(cur_code, &pu) : 0; u = check_unicode(pu, n, cur_code, font); } diff --git a/pdf2htmlEX/src/HTMLRenderer/link.cc b/pdf2htmlEX/src/HTMLRenderer/link.cc index c7fcd959..7bc92d85 100644 --- a/pdf2htmlEX/src/HTMLRenderer/link.cc +++ b/pdf2htmlEX/src/HTMLRenderer/link.cc @@ -273,7 +273,7 @@ void HTMLRenderer::processLink(AnnotLink * al) double r,g,b; if(color && (color->getSpace() == AnnotColor::colorRGB)) { - const double * v = color->getValues(); + const auto v = color->getValues(); r = v[0]; g = v[1]; b = v[2]; diff --git a/pdf2htmlEX/src/HTMLRenderer/state.cc b/pdf2htmlEX/src/HTMLRenderer/state.cc index 4595c63d..128525b4 100644 --- a/pdf2htmlEX/src/HTMLRenderer/state.cc +++ b/pdf2htmlEX/src/HTMLRenderer/state.cc @@ -252,7 +252,7 @@ void HTMLRenderer::check_state_change(GfxState * state) m1[5] = state->getRise(); m1[1] = m1[2] = m1[4] = 0; - tm_multiply(m2, state->getCTM(), state->getTextMat()); + tm_multiply(m2, state->getCTM().data(), state->getTextMat().data()); tm_multiply(new_text_tm, m2, m1); if(!tm_equal(new_text_tm, cur_text_tm)) diff --git a/pdf2htmlEX/src/StateManager.h b/pdf2htmlEX/src/StateManager.h index db232572..de2eafc9 100644 --- a/pdf2htmlEX/src/StateManager.h +++ b/pdf2htmlEX/src/StateManager.h @@ -109,7 +109,7 @@ class StateManager Matrix m; memcpy(m.m.data(), new_value, 4 * sizeof(double)); auto iter = value_map.lower_bound(m); - if((iter != value_map.end()) && (tm_equal(m.m, iter->first.m, 4))) + if((iter != value_map.end()) && (tm_equal(m.m.data(), iter->first.m, 4))) { return iter->second; } From 9642e6e03cc27a324cdf1bbf69e633b4907c2f6f Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Sun, 31 May 2026 14:56:14 +0200 Subject: [PATCH 05/19] data! --- pdf2htmlEX/src/StateManager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdf2htmlEX/src/StateManager.h b/pdf2htmlEX/src/StateManager.h index de2eafc9..169b8337 100644 --- a/pdf2htmlEX/src/StateManager.h +++ b/pdf2htmlEX/src/StateManager.h @@ -109,7 +109,7 @@ class StateManager Matrix m; memcpy(m.m.data(), new_value, 4 * sizeof(double)); auto iter = value_map.lower_bound(m); - if((iter != value_map.end()) && (tm_equal(m.m.data(), iter->first.m, 4))) + if((iter != value_map.end()) && (tm_equal(m.m.data(), iter->first.m.data(), 4))) { return iter->second; } From f8e5b97699d95dc3b7d165aaa4430500641d84c7 Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Sun, 31 May 2026 15:09:54 +0200 Subject: [PATCH 06/19] more fixes --- pdf2htmlEX/src/BackgroundRenderer/BackgroundRenderer.cc | 7 ++++--- .../src/BackgroundRenderer/CairoBackgroundRenderer.cc | 2 +- .../src/BackgroundRenderer/SplashBackgroundRenderer.cc | 2 +- pdf2htmlEX/src/DrawingTracer.cc | 4 ++-- pdf2htmlEX/src/HTMLRenderer/text.cc | 8 ++++---- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/pdf2htmlEX/src/BackgroundRenderer/BackgroundRenderer.cc b/pdf2htmlEX/src/BackgroundRenderer/BackgroundRenderer.cc index dbd7137e..33b2233b 100644 --- a/pdf2htmlEX/src/BackgroundRenderer/BackgroundRenderer.cc +++ b/pdf2htmlEX/src/BackgroundRenderer/BackgroundRenderer.cc @@ -5,6 +5,7 @@ * Copyright (C) 2013 Lu Wang */ +#include #include #include "HTMLRenderer/HTMLRenderer.h" @@ -55,8 +56,8 @@ void BackgroundRenderer::proof_begin_text_object(GfxState *state, OutputDev * de { PDFRectangle rect(0, 0, state->getPageWidth(), state->getPageHeight()); proof_state.reset(new GfxState(state->getHDPI(), state->getVDPI(), &rect, state->getRotate(), dev->upsideDown())); - proof_state->setFillColorSpace(new GfxDeviceRGBColorSpace()); - proof_state->setStrokeColorSpace(new GfxDeviceRGBColorSpace()); + proof_state->setFillColorSpace(std::make_unique()); + proof_state->setStrokeColorSpace(std::make_unique()); } // Save original render mode in proof_state, and restore in proof_end_text_object() @@ -72,7 +73,7 @@ void BackgroundRenderer::proof_begin_string(GfxState *state, OutputDev * dev) return; double lx = state->getFontSize() / 70, ly = lx; - tm_transform(state->getTextMat(), lx, ly, true); + tm_transform(state->getTextMat().data(), lx, ly, true); proof_state->setLineWidth(sqrt(lx * lx + ly * ly)); static const Color red(1, 0, 0), green(0, 1, 0), blue(0, 0, 1), yellow(1, 1, 0), white(1, 1, 1); diff --git a/pdf2htmlEX/src/BackgroundRenderer/CairoBackgroundRenderer.cc b/pdf2htmlEX/src/BackgroundRenderer/CairoBackgroundRenderer.cc index 4621db9b..8ba9ab01 100644 --- a/pdf2htmlEX/src/BackgroundRenderer/CairoBackgroundRenderer.cc +++ b/pdf2htmlEX/src/BackgroundRenderer/CairoBackgroundRenderer.cc @@ -56,7 +56,7 @@ void CairoBackgroundRenderer::drawChar(GfxState *state, double x, double y, // - OR the text is used as path if((param.fallback || param.proof) || ( (state->getFont()) - && ( (state->getFont()->getWMode()) + && ( (state->getFont()->getWMode() != GfxFont::WritingMode::Horizontal) || ((state->getFont()->getType() == fontType3) && (!param.process_type3)) || (state->getRender() >= 4) ) diff --git a/pdf2htmlEX/src/BackgroundRenderer/SplashBackgroundRenderer.cc b/pdf2htmlEX/src/BackgroundRenderer/SplashBackgroundRenderer.cc index 780c008a..82f1bed4 100644 --- a/pdf2htmlEX/src/BackgroundRenderer/SplashBackgroundRenderer.cc +++ b/pdf2htmlEX/src/BackgroundRenderer/SplashBackgroundRenderer.cc @@ -20,7 +20,7 @@ using std::ifstream; const SplashColor SplashBackgroundRenderer::white = {255,255,255}; SplashBackgroundRenderer::SplashBackgroundRenderer(const string & imgFormat, HTMLRenderer * html_renderer, const Param & param) - : SplashOutputDev(splashModeRGB8, 4, false, (SplashColorPtr)(&white), true, splashThinLineSolid) // DCRH: Make thin line mode = solid + : SplashOutputDev(splashModeRGB8, 4, (SplashColorPtr)(&white), true, splashThinLineSolid) // DCRH: Make thin line mode = solid , html_renderer(html_renderer) , param(param) , format(imgFormat) diff --git a/pdf2htmlEX/src/DrawingTracer.cc b/pdf2htmlEX/src/DrawingTracer.cc index 5d23d421..5bd2e594 100644 --- a/pdf2htmlEX/src/DrawingTracer.cc +++ b/pdf2htmlEX/src/DrawingTracer.cc @@ -403,7 +403,7 @@ void DrawingTracer::draw_char(GfxState *state, double x, double y, double width, { //printf("x=%f,y=%f,width=%f,height=%f\n", x, y, width, height); Matrix tm, itm; - memcpy(tm.m, state->getTextMat(), sizeof(tm.m)); + memcpy(tm.m.data(), state->getTextMat().data(), sizeof(tm.m)); //printf("tm = %f,%f,%f,%f,%f,%f\n", tm.m[0], tm.m[1], tm.m[2], tm.m[3], tm.m[4], tm.m[5]); double cx = state->getCurX(), cy = state->getCurY(), fs = state->getFontSize(), @@ -424,7 +424,7 @@ void DrawingTracer::draw_char(GfxState *state, double x, double y, double width, //printf("char_m = %f,%f,%f,%f,%f,%f\n", char_m[0], char_m[1], char_m[2], char_m[3], char_m[4], char_m[5]); double final_m[6]; - tm_multiply(final_m, tm.m, char_m); + tm_multiply(final_m, tm.m.data(), char_m); //printf("final_m = %f,%f,%f,%f,%f,%f\n", final_m[0], final_m[1], final_m[2], final_m[3], final_m[4], final_m[5]); double final_after_ctm[6]; diff --git a/pdf2htmlEX/src/HTMLRenderer/text.cc b/pdf2htmlEX/src/HTMLRenderer/text.cc index 723704ee..01bd032d 100644 --- a/pdf2htmlEX/src/HTMLRenderer/text.cc +++ b/pdf2htmlEX/src/HTMLRenderer/text.cc @@ -25,7 +25,7 @@ using std::endl; void HTMLRenderer::drawString(GfxState * state, const GooString * s) { - if(s->getLength() == 0) + if(s->empty()) return; auto font = state->getFont(); @@ -41,7 +41,7 @@ void HTMLRenderer::drawString(GfxState * state, const GooString * s) if(state->getFont() - && ( (state->getFont()->getWMode()) + && ( (state->getFont()->getWMode() != GfxFont::WritingMode::Horizontal) || ((state->getFont()->getType() == fontType3) && (!param.process_type3)) || (state->getRender() >= 4) ) @@ -58,8 +58,8 @@ void HTMLRenderer::drawString(GfxState * state, const GooString * s) // Now ready to output // get the unicodes - const char *p = (s->toStr()).c_str(); - int len = s->getLength(); + const char *p = s->c_str(); + int len = s->size(); //accumulated displacement of chars in this string, in text object space double dx = 0; From 7e6f657d5692e5503d8f9e92961554b0d5de6ec9 Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Sun, 31 May 2026 15:27:26 +0200 Subject: [PATCH 07/19] try again --- pdf2htmlEX/CMakeLists.txt | 3 +++ .../src/BackgroundRenderer/CairoBackgroundRenderer.cc | 2 +- .../src/BackgroundRenderer/SplashBackgroundRenderer.cc | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pdf2htmlEX/CMakeLists.txt b/pdf2htmlEX/CMakeLists.txt index 2018ccfa..dce0ac9f 100644 --- a/pdf2htmlEX/CMakeLists.txt +++ b/pdf2htmlEX/CMakeLists.txt @@ -24,6 +24,9 @@ add_custom_target(dist find_package(PkgConfig) +find_package(GLIB 2.6 REQUIRED COMPONENTS gio gobject) + + # SINCE we have a very intimate relationship with a particular version of # poppler... we explicitly describe the poppler include and library # paths. diff --git a/pdf2htmlEX/src/BackgroundRenderer/CairoBackgroundRenderer.cc b/pdf2htmlEX/src/BackgroundRenderer/CairoBackgroundRenderer.cc index 8ba9ab01..7ef528c5 100644 --- a/pdf2htmlEX/src/BackgroundRenderer/CairoBackgroundRenderer.cc +++ b/pdf2htmlEX/src/BackgroundRenderer/CairoBackgroundRenderer.cc @@ -85,7 +85,7 @@ void CairoBackgroundRenderer::beginString(GfxState *state, const GooString * str { if (param.proof == 2) proof_begin_string(state, this); - CairoOutputDev::beginString(state, str); + CairoOutputDev::beginString(state, *str); } void CairoBackgroundRenderer::endTextObject(GfxState *state) diff --git a/pdf2htmlEX/src/BackgroundRenderer/SplashBackgroundRenderer.cc b/pdf2htmlEX/src/BackgroundRenderer/SplashBackgroundRenderer.cc index 82f1bed4..f70a3329 100644 --- a/pdf2htmlEX/src/BackgroundRenderer/SplashBackgroundRenderer.cc +++ b/pdf2htmlEX/src/BackgroundRenderer/SplashBackgroundRenderer.cc @@ -75,7 +75,7 @@ void SplashBackgroundRenderer::beginString(GfxState *state, const GooString * st { if (param.proof == 2) proof_begin_string(state, this); - SplashOutputDev::beginString(state, str); + SplashOutputDev::beginString(state, *str); } void SplashBackgroundRenderer::endTextObject(GfxState *state) @@ -125,8 +125,8 @@ bool SplashBackgroundRenderer::render_page(PDFDoc * doc, int pageno) throw string("Image format not supported: ") + format; SplashError e = bitmap->writeImgFile(splashImageFileFormat, (const char *)fn, param.actual_dpi, param.actual_dpi); - if (e != splashOk) - throw string("Cannot write background image. SplashErrorCode: ") + std::to_string(e); + if (e != SplashError::NoError) + throw string("Cannot write background image. SplashErrorCode: ") + std::to_string((int)e); if(param.embed_image) html_renderer->tmp_files.add((const char *)fn); From fb6de8026482b88021bf71eefe665b0e93df974d Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Sun, 31 May 2026 15:31:27 +0200 Subject: [PATCH 08/19] remove glib dep again --- pdf2htmlEX/CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/pdf2htmlEX/CMakeLists.txt b/pdf2htmlEX/CMakeLists.txt index dce0ac9f..2018ccfa 100644 --- a/pdf2htmlEX/CMakeLists.txt +++ b/pdf2htmlEX/CMakeLists.txt @@ -24,9 +24,6 @@ add_custom_target(dist find_package(PkgConfig) -find_package(GLIB 2.6 REQUIRED COMPONENTS gio gobject) - - # SINCE we have a very intimate relationship with a particular version of # poppler... we explicitly describe the poppler include and library # paths. From 4a2473580e04963516f4699b83d60978ba054977 Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Sun, 31 May 2026 15:43:50 +0200 Subject: [PATCH 09/19] fix --- pdf2htmlEX/src/BackgroundRenderer/CairoBackgroundRenderer.cc | 2 +- pdf2htmlEX/src/BackgroundRenderer/SplashBackgroundRenderer.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pdf2htmlEX/src/BackgroundRenderer/CairoBackgroundRenderer.cc b/pdf2htmlEX/src/BackgroundRenderer/CairoBackgroundRenderer.cc index 7ef528c5..e567994c 100644 --- a/pdf2htmlEX/src/BackgroundRenderer/CairoBackgroundRenderer.cc +++ b/pdf2htmlEX/src/BackgroundRenderer/CairoBackgroundRenderer.cc @@ -85,7 +85,7 @@ void CairoBackgroundRenderer::beginString(GfxState *state, const GooString * str { if (param.proof == 2) proof_begin_string(state, this); - CairoOutputDev::beginString(state, *str); + CairoOutputDev::beginString(state, str->toStr()); } void CairoBackgroundRenderer::endTextObject(GfxState *state) diff --git a/pdf2htmlEX/src/BackgroundRenderer/SplashBackgroundRenderer.cc b/pdf2htmlEX/src/BackgroundRenderer/SplashBackgroundRenderer.cc index f70a3329..bd0f4d6e 100644 --- a/pdf2htmlEX/src/BackgroundRenderer/SplashBackgroundRenderer.cc +++ b/pdf2htmlEX/src/BackgroundRenderer/SplashBackgroundRenderer.cc @@ -75,7 +75,7 @@ void SplashBackgroundRenderer::beginString(GfxState *state, const GooString * st { if (param.proof == 2) proof_begin_string(state, this); - SplashOutputDev::beginString(state, *str); + SplashOutputDev::beginString(state, str->toStr()); } void SplashBackgroundRenderer::endTextObject(GfxState *state) From 6c39256cd021ddd2ab026faf4ddc830b1c65dc77 Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Sun, 31 May 2026 16:02:37 +0200 Subject: [PATCH 10/19] debug --- buildScripts/buildPdf2htmlEX | 2 +- pdf2htmlEX/CMakeLists.txt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/buildScripts/buildPdf2htmlEX b/buildScripts/buildPdf2htmlEX index e5452b62..9759fd8a 100755 --- a/buildScripts/buildPdf2htmlEX +++ b/buildScripts/buildPdf2htmlEX @@ -20,4 +20,4 @@ rm -rf build mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PDF2HTMLEX_PREFIX .. -make $MAKE_PARALLEL +make $MAKE_PARALLEL VERBOSE=1 diff --git a/pdf2htmlEX/CMakeLists.txt b/pdf2htmlEX/CMakeLists.txt index 2018ccfa..7fac20c2 100644 --- a/pdf2htmlEX/CMakeLists.txt +++ b/pdf2htmlEX/CMakeLists.txt @@ -34,6 +34,8 @@ include_directories( ../poppler/poppler ../poppler ) +include_directories(${POPPLER_INCLUDE_DIRS}) +link_directories(${POPPLER_LIBRARY_DIRS}) # # The following order is critical as the glib functions use functions # located in the main poppler library From 75291c291225a73322fc125597f40003eb77ce3d Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Sun, 31 May 2026 16:12:14 +0200 Subject: [PATCH 11/19] try again --- pdf2htmlEX/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pdf2htmlEX/CMakeLists.txt b/pdf2htmlEX/CMakeLists.txt index 7fac20c2..6839222f 100644 --- a/pdf2htmlEX/CMakeLists.txt +++ b/pdf2htmlEX/CMakeLists.txt @@ -24,6 +24,11 @@ add_custom_target(dist find_package(PkgConfig) +find_package(GLIB REQUIRED COMPONENTS gio) +include_directories(${GLIB_INCLUDE_DIRS}) +link_directories(${GLIB_LIBRARY_DIRS}) + + # SINCE we have a very intimate relationship with a particular version of # poppler... we explicitly describe the poppler include and library # paths. From 808309bd064e849bcc111f410df3445443831155 Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Sun, 31 May 2026 16:20:28 +0200 Subject: [PATCH 12/19] try again --- pdf2htmlEX/CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pdf2htmlEX/CMakeLists.txt b/pdf2htmlEX/CMakeLists.txt index 6839222f..fc068648 100644 --- a/pdf2htmlEX/CMakeLists.txt +++ b/pdf2htmlEX/CMakeLists.txt @@ -24,11 +24,6 @@ add_custom_target(dist find_package(PkgConfig) -find_package(GLIB REQUIRED COMPONENTS gio) -include_directories(${GLIB_INCLUDE_DIRS}) -link_directories(${GLIB_LIBRARY_DIRS}) - - # SINCE we have a very intimate relationship with a particular version of # poppler... we explicitly describe the poppler include and library # paths. @@ -51,6 +46,11 @@ set(POPPLER_LIBRARIES ${POPPLER_LIBRARIES} ) +find_package(GLIB REQUIRED COMPONENTS gio) +include_directories(${GLIB_INCLUDE_DIRS}) +link_directories(${GLIB_LIBRARY_DIRS}) + + if(ENABLE_SVG) pkg_check_modules(CAIRO REQUIRED cairo>=1.10.0) message("-- Trying to locate cairo-svg...") From e03936424d85f5b2f1c03d33cdbcda071faa05e7 Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Sun, 31 May 2026 16:30:57 +0200 Subject: [PATCH 13/19] and again --- pdf2htmlEX/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pdf2htmlEX/CMakeLists.txt b/pdf2htmlEX/CMakeLists.txt index fc068648..d4f10619 100644 --- a/pdf2htmlEX/CMakeLists.txt +++ b/pdf2htmlEX/CMakeLists.txt @@ -28,6 +28,7 @@ find_package(PkgConfig) # poppler... we explicitly describe the poppler include and library # paths. # +list(APPEND CMAKE_MODULE_PATH "../poppler/cmake") include_directories( ../poppler/build/poppler ../poppler/build @@ -45,12 +46,10 @@ set(POPPLER_LIBRARIES ${POPPLER_LIBRARIES} ${CMAKE_SOURCE_DIR}/../poppler/build/libpoppler.a ) - find_package(GLIB REQUIRED COMPONENTS gio) include_directories(${GLIB_INCLUDE_DIRS}) link_directories(${GLIB_LIBRARY_DIRS}) - if(ENABLE_SVG) pkg_check_modules(CAIRO REQUIRED cairo>=1.10.0) message("-- Trying to locate cairo-svg...") @@ -73,6 +72,7 @@ if(ENABLE_SVG) # set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} ${FREETYPE_LIBRARIES}) endif() + # SINCE we have a very intimate relationship with a particular version of # fontforge... we explicitly describe the fontforge include and library # paths. @@ -83,7 +83,7 @@ include_directories( ../fontforge/build/inc ../fontforge/inc ) -# +list(APPEND CMAKE_MODULE_PATH "../fontforge/cmake") include_directories(${FONTFORGE_INCLUDE_DIRS}) link_directories(${FONTFORGE_LIBRARY_DIRS}) set(FONTFORGE_LIBRARIES ${FONTFORGE_LIBRARIES} From 424d73be058b296b641a080ec7f94c39815df20e Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Sun, 31 May 2026 16:42:54 +0200 Subject: [PATCH 14/19] try again --- pdf2htmlEX/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pdf2htmlEX/CMakeLists.txt b/pdf2htmlEX/CMakeLists.txt index d4f10619..f4a3c75d 100644 --- a/pdf2htmlEX/CMakeLists.txt +++ b/pdf2htmlEX/CMakeLists.txt @@ -28,7 +28,7 @@ find_package(PkgConfig) # poppler... we explicitly describe the poppler include and library # paths. # -list(APPEND CMAKE_MODULE_PATH "../poppler/cmake") +list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../poppler/cmake") include_directories( ../poppler/build/poppler ../poppler/build @@ -83,7 +83,7 @@ include_directories( ../fontforge/build/inc ../fontforge/inc ) -list(APPEND CMAKE_MODULE_PATH "../fontforge/cmake") +list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../fontforge/cmake") include_directories(${FONTFORGE_INCLUDE_DIRS}) link_directories(${FONTFORGE_LIBRARY_DIRS}) set(FONTFORGE_LIBRARIES ${FONTFORGE_LIBRARIES} From 44cc7d7e7d3f8bcfe37b4b1fbecb6fcec8350331 Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Sun, 31 May 2026 16:49:40 +0200 Subject: [PATCH 15/19] try again --- pdf2htmlEX/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdf2htmlEX/CMakeLists.txt b/pdf2htmlEX/CMakeLists.txt index f4a3c75d..fb2871ba 100644 --- a/pdf2htmlEX/CMakeLists.txt +++ b/pdf2htmlEX/CMakeLists.txt @@ -46,7 +46,7 @@ set(POPPLER_LIBRARIES ${POPPLER_LIBRARIES} ${CMAKE_SOURCE_DIR}/../poppler/build/libpoppler.a ) -find_package(GLIB REQUIRED COMPONENTS gio) +pkg_check_modules(GLIB2 IMPORTED_TARGET "glib-2.0>=2.80" "gio-2.0>=2.80") include_directories(${GLIB_INCLUDE_DIRS}) link_directories(${GLIB_LIBRARY_DIRS}) From f72d56d4de60eb8af6c6209a90b92f746361eb3f Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Sun, 31 May 2026 16:54:39 +0200 Subject: [PATCH 16/19] fix silly --- pdf2htmlEX/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdf2htmlEX/CMakeLists.txt b/pdf2htmlEX/CMakeLists.txt index fb2871ba..eb702bf5 100644 --- a/pdf2htmlEX/CMakeLists.txt +++ b/pdf2htmlEX/CMakeLists.txt @@ -46,7 +46,7 @@ set(POPPLER_LIBRARIES ${POPPLER_LIBRARIES} ${CMAKE_SOURCE_DIR}/../poppler/build/libpoppler.a ) -pkg_check_modules(GLIB2 IMPORTED_TARGET "glib-2.0>=2.80" "gio-2.0>=2.80") +pkg_check_modules(GLIB IMPORTED_TARGET "glib-2.0>=2.80" "gio-2.0>=2.80") include_directories(${GLIB_INCLUDE_DIRS}) link_directories(${GLIB_LIBRARY_DIRS}) From 81ef3bb46b44ac3a6f5446037fcbbb8bff00e9c2 Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Sun, 31 May 2026 16:58:40 +0200 Subject: [PATCH 17/19] fix --- pdf2htmlEX/src/DrawingTracer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdf2htmlEX/src/DrawingTracer.cc b/pdf2htmlEX/src/DrawingTracer.cc index 5bd2e594..99c31392 100644 --- a/pdf2htmlEX/src/DrawingTracer.cc +++ b/pdf2htmlEX/src/DrawingTracer.cc @@ -38,7 +38,7 @@ void DrawingTracer::reset(GfxState *state) Matrix ctm, ictm; state->getCTM(&ctm); ctm.invertTo(&ictm); - tm_transform_bbox(ictm.m, pbox); + tm_transform_bbox(ictm.m.data(), pbox); cairo_rectangle_t page_box { pbox[0], pbox[1], pbox[2] - pbox[0], pbox[3] - pbox[1] }; cairo_surface_t * surface = cairo_recording_surface_create(CAIRO_CONTENT_COLOR_ALPHA, &page_box); cairo = cairo_create(surface); From ec574f74245646ce6306ae7fc97b3ec0aa855a12 Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Sun, 31 May 2026 17:14:21 +0200 Subject: [PATCH 18/19] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- pdf2htmlEX/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdf2htmlEX/CMakeLists.txt b/pdf2htmlEX/CMakeLists.txt index eb702bf5..261b21a3 100644 --- a/pdf2htmlEX/CMakeLists.txt +++ b/pdf2htmlEX/CMakeLists.txt @@ -46,7 +46,7 @@ set(POPPLER_LIBRARIES ${POPPLER_LIBRARIES} ${CMAKE_SOURCE_DIR}/../poppler/build/libpoppler.a ) -pkg_check_modules(GLIB IMPORTED_TARGET "glib-2.0>=2.80" "gio-2.0>=2.80") +pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0>=2.80 gio-2.0>=2.80) include_directories(${GLIB_INCLUDE_DIRS}) link_directories(${GLIB_LIBRARY_DIRS}) From cbdb6236b23e3695a140497abbb30da5fc7cab5a Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Sun, 31 May 2026 17:16:47 +0200 Subject: [PATCH 19/19] pr feedback --- buildScripts/versionEnvs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/buildScripts/versionEnvs b/buildScripts/versionEnvs index 8555690b..2d454041 100755 --- a/buildScripts/versionEnvs +++ b/buildScripts/versionEnvs @@ -3,11 +3,11 @@ # This shell script exports environment variables for the latest software # versions -# see: https://poppler.freedesktop.org/releases.html -# current working: 24.06.1 - export PDF2HTMLEX_VERSION=0.18.8.rc2 +# see: https://poppler.freedesktop.org/releases.html +# current working: 26.05.0 + export POPPLER_VERSION=poppler-26.05.0 #export POPPLER_VERSION=poppler-24.06.1 #export POPPLER_VERSION=poppler-24.01.0