From be1d2079ac789f6338f0e22b274af2704761e728 Mon Sep 17 00:00:00 2001 From: Stephen Gaito Date: Sat, 30 May 2020 09:55:35 +0000 Subject: [PATCH 1/2] poppler 0.84.0 removed ModRegion tracking --- buildScripts/versionEnvs | 4 ++-- .../SplashBackgroundRenderer.cc | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/buildScripts/versionEnvs b/buildScripts/versionEnvs index f38df05..5f552a6 100755 --- a/buildScripts/versionEnvs +++ b/buildScripts/versionEnvs @@ -12,8 +12,8 @@ #export POPPLER_VERSION=poppler-0.86.1 #export POPPLER_VERSION=poppler-0.86.0 #export POPPLER_VERSION=poppler-0.85.0 -#export POPPLER_VERSION=poppler-0.84.0 -export POPPLER_VERSION=poppler-0.83.0 +export POPPLER_VERSION=poppler-0.84.0 +#export POPPLER_VERSION=poppler-0.83.0 #export POPPLER_VERSION=poppler-0.82.0 #export POPPLER_VERSION=poppler-0.81.0 diff --git a/pdf2htmlEX/src/BackgroundRenderer/SplashBackgroundRenderer.cc b/pdf2htmlEX/src/BackgroundRenderer/SplashBackgroundRenderer.cc index 757f0a1..7ce22d7 100644 --- a/pdf2htmlEX/src/BackgroundRenderer/SplashBackgroundRenderer.cc +++ b/pdf2htmlEX/src/BackgroundRenderer/SplashBackgroundRenderer.cc @@ -59,7 +59,7 @@ SplashBackgroundRenderer::SplashBackgroundRenderer(const string & imgFormat, HTM void SplashBackgroundRenderer::startPage(int pageNum, GfxState *state, XRef *xrefA) { SplashOutputDev::startPage(pageNum, state, xrefA); - clearModRegion(); +// clearModRegion(); } void SplashBackgroundRenderer::drawChar(GfxState *state, double x, double y, @@ -127,8 +127,17 @@ void SplashBackgroundRenderer::embed_image(int pageno) { // xmin->xmax is top->bottom int xmin, xmax, ymin, ymax; - getModRegion(&xmin, &ymin, &xmax, &ymax); - +// getModRegion(&xmin, &ymin, &xmax, &ymax); +// poppler-0.84.0 hack to recover from the removal of ModRegion tracking +// + auto * bitmap = getBitmap(); + xmin = 0; + xmax = bitmap->getWidth(); + ymin = 0; + ymax = bitmap->getHeight(); +// +// end of hack + // dump the background image only when it is not empty if((xmin <= xmax) && (ymin <= ymax)) { From e60bd3819efa42bd0e7c08a604c022627cf57fda Mon Sep 17 00:00:00 2001 From: Stephen Gaito Date: Sat, 30 May 2020 11:21:22 +0000 Subject: [PATCH 2/2] tidied up previous changes --- pdf2htmlEX/src/BackgroundRenderer/SplashBackgroundRenderer.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pdf2htmlEX/src/BackgroundRenderer/SplashBackgroundRenderer.cc b/pdf2htmlEX/src/BackgroundRenderer/SplashBackgroundRenderer.cc index 7ce22d7..1f6c184 100644 --- a/pdf2htmlEX/src/BackgroundRenderer/SplashBackgroundRenderer.cc +++ b/pdf2htmlEX/src/BackgroundRenderer/SplashBackgroundRenderer.cc @@ -59,7 +59,6 @@ SplashBackgroundRenderer::SplashBackgroundRenderer(const string & imgFormat, HTM void SplashBackgroundRenderer::startPage(int pageNum, GfxState *state, XRef *xrefA) { SplashOutputDev::startPage(pageNum, state, xrefA); -// clearModRegion(); } void SplashBackgroundRenderer::drawChar(GfxState *state, double x, double y, @@ -127,8 +126,7 @@ void SplashBackgroundRenderer::embed_image(int pageno) { // xmin->xmax is top->bottom int xmin, xmax, ymin, ymax; -// getModRegion(&xmin, &ymin, &xmax, &ymax); -// poppler-0.84.0 hack to recover from the removal of ModRegion tracking +// poppler-0.84.0 hack to recover from the removal of *ModRegion tracking // auto * bitmap = getBitmap(); xmin = 0;