1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 13:00:08 +00:00

fix build for old poppler

This commit is contained in:
Lu Wang 2013-09-16 20:39:53 +08:00
parent 99102fb90c
commit 14815eb666
6 changed files with 31 additions and 7 deletions

View File

@ -15,7 +15,13 @@ add_custom_target(dist
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
find_package(PkgConfig) find_package(PkgConfig)
pkg_check_modules(POPPLER REQUIRED poppler>=0.20.0) pkg_check_modules(POPPLER poppler>=0.23.0)
if(POPPLER_FOUND)
set(POPPLER_OLDER_THAN_0_23_0 0)
else()
set(POPPLER_OLDER_THAN_0_23_0 1)
pkg_check_modules(POPPLER REQUIRED poppler>=0.20.0)
endif()
include_directories(${POPPLER_INCLUDE_DIRS}) include_directories(${POPPLER_INCLUDE_DIRS})
link_directories(${POPPLER_LIBRARY_DIRS}) link_directories(${POPPLER_LIBRARY_DIRS})
set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} ${POPPLER_LIBRARIES}) set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} ${POPPLER_LIBRARIES})

View File

@ -27,9 +27,17 @@ const SplashColor SplashBackgroundRenderer::white = {255,255,255};
* And thus have modified region set to the whole page area * And thus have modified region set to the whole page area
* We do not want that. * We do not want that.
*/ */
#if POPPLER_OLDER_THAN_0_23_0
void SplashBackgroundRenderer::startPage(int pageNum, GfxState *state)
#else
void SplashBackgroundRenderer::startPage(int pageNum, GfxState *state, XRef *xrefA) void SplashBackgroundRenderer::startPage(int pageNum, GfxState *state, XRef *xrefA)
#endif
{ {
#if POPPLER_OLDER_THAN_0_23_0
SplashOutputDev::startPage(pageNum, state);
#else
SplashOutputDev::startPage(pageNum, state, xrefA); SplashOutputDev::startPage(pageNum, state, xrefA);
#endif
clearModRegion(); clearModRegion();
} }

View File

@ -15,6 +15,8 @@
#include <splash/SplashBitmap.h> #include <splash/SplashBitmap.h>
#include <SplashOutputDev.h> #include <SplashOutputDev.h>
#include "pdf2htmlEX-config.h"
#include "Param.h" #include "Param.h"
#include "HTMLRenderer/HTMLRenderer.h" #include "HTMLRenderer/HTMLRenderer.h"
@ -34,7 +36,11 @@ public:
virtual ~SplashBackgroundRenderer() { } virtual ~SplashBackgroundRenderer() { }
#if POPPLER_OLDER_THAN_0_23_0
virtual void startPage(int pageNum, GfxState *state);
#else
virtual void startPage(int pageNum, GfxState *state, XRef *xrefA); virtual void startPage(int pageNum, GfxState *state, XRef *xrefA);
#endif
virtual void drawChar(GfxState *state, double x, double y, virtual void drawChar(GfxState *state, double x, double y,
double dx, double dy, double dx, double dy,

View File

@ -20,6 +20,8 @@
#include <GfxFont.h> #include <GfxFont.h>
#include <Annot.h> #include <Annot.h>
#include "pdf2htmlEX-config.h"
#include "Param.h" #include "Param.h"
#include "Preprocessor.h" #include "Preprocessor.h"
#include "StringFormatter.h" #include "StringFormatter.h"
@ -73,9 +75,11 @@ public:
virtual void setDefaultCTM(double *ctm); virtual void setDefaultCTM(double *ctm);
// Start a page. // Start a page.
// UGLY: These 2 versions are for different versions of poppler #if POPPLER_OLDER_THAN_0_23_0
virtual void startPage(int pageNum, GfxState *state); virtual void startPage(int pageNum, GfxState *state);
#else
virtual void startPage(int pageNum, GfxState *state, XRef * xref); virtual void startPage(int pageNum, GfxState *state, XRef * xref);
#endif
// End a page. // End a page.
virtual void endPage(); virtual void endPage();

View File

@ -165,12 +165,11 @@ void HTMLRenderer::setDefaultCTM(double *ctm)
memcpy(default_ctm, ctm, sizeof(default_ctm)); memcpy(default_ctm, ctm, sizeof(default_ctm));
} }
void HTMLRenderer::startPage(int pageNum, GfxState *state) #if POPPLER_OLDER_THAN_0_23_0
{ void HTMLRenderer::startPage(int pageNum, GfxState *state)
startPage(pageNum, state, nullptr); #else
}
void HTMLRenderer::startPage(int pageNum, GfxState *state, XRef * xref) void HTMLRenderer::startPage(int pageNum, GfxState *state, XRef * xref)
#endif
{ {
this->pageNum = pageNum; this->pageNum = pageNum;

View File

@ -11,6 +11,7 @@
#include <string> #include <string>
#define POPPLER_OLDER_THAN_0_23_0 @POPPLER_OLDER_THAN_0_23_0@
#define HAVE_CAIRO @HAVE_CAIRO@ #define HAVE_CAIRO @HAVE_CAIRO@
namespace pdf2htmlEX { namespace pdf2htmlEX {