mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-12-22 04:50:09 +00:00
fix build for old poppler
This commit is contained in:
parent
99102fb90c
commit
14815eb666
@ -15,7 +15,13 @@ add_custom_target(dist
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
|
||||
|
||||
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})
|
||||
link_directories(${POPPLER_LIBRARY_DIRS})
|
||||
set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} ${POPPLER_LIBRARIES})
|
||||
|
@ -27,9 +27,17 @@ const SplashColor SplashBackgroundRenderer::white = {255,255,255};
|
||||
* And thus have modified region set to the whole page area
|
||||
* 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)
|
||||
#endif
|
||||
{
|
||||
#if POPPLER_OLDER_THAN_0_23_0
|
||||
SplashOutputDev::startPage(pageNum, state);
|
||||
#else
|
||||
SplashOutputDev::startPage(pageNum, state, xrefA);
|
||||
#endif
|
||||
clearModRegion();
|
||||
}
|
||||
|
||||
|
@ -15,6 +15,8 @@
|
||||
#include <splash/SplashBitmap.h>
|
||||
#include <SplashOutputDev.h>
|
||||
|
||||
#include "pdf2htmlEX-config.h"
|
||||
|
||||
#include "Param.h"
|
||||
#include "HTMLRenderer/HTMLRenderer.h"
|
||||
|
||||
@ -34,7 +36,11 @@ public:
|
||||
|
||||
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);
|
||||
#endif
|
||||
|
||||
virtual void drawChar(GfxState *state, double x, double y,
|
||||
double dx, double dy,
|
||||
|
@ -20,6 +20,8 @@
|
||||
#include <GfxFont.h>
|
||||
#include <Annot.h>
|
||||
|
||||
#include "pdf2htmlEX-config.h"
|
||||
|
||||
#include "Param.h"
|
||||
#include "Preprocessor.h"
|
||||
#include "StringFormatter.h"
|
||||
@ -73,9 +75,11 @@ public:
|
||||
virtual void setDefaultCTM(double *ctm);
|
||||
|
||||
// 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);
|
||||
#else
|
||||
virtual void startPage(int pageNum, GfxState *state, XRef * xref);
|
||||
#endif
|
||||
|
||||
// End a page.
|
||||
virtual void endPage();
|
||||
|
@ -165,12 +165,11 @@ void HTMLRenderer::setDefaultCTM(double *ctm)
|
||||
memcpy(default_ctm, ctm, sizeof(default_ctm));
|
||||
}
|
||||
|
||||
void HTMLRenderer::startPage(int pageNum, GfxState *state)
|
||||
{
|
||||
startPage(pageNum, state, nullptr);
|
||||
}
|
||||
|
||||
#if POPPLER_OLDER_THAN_0_23_0
|
||||
void HTMLRenderer::startPage(int pageNum, GfxState *state)
|
||||
#else
|
||||
void HTMLRenderer::startPage(int pageNum, GfxState *state, XRef * xref)
|
||||
#endif
|
||||
{
|
||||
this->pageNum = pageNum;
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#define POPPLER_OLDER_THAN_0_23_0 @POPPLER_OLDER_THAN_0_23_0@
|
||||
#define HAVE_CAIRO @HAVE_CAIRO@
|
||||
|
||||
namespace pdf2htmlEX {
|
||||
|
Loading…
Reference in New Issue
Block a user