0

I'm trying to build a docker file which uses pdf2htmlEX-0.18.7-poppler-0.81.0 but I keep getting CairoFontEngine Errors, here's my dockerfile:

FROM <>

RUN dpkg --configure -a 
RUN apt-get clean
RUN apt-get update 
RUN apt-get install -f -y python3
RUN apt-get install dialog apt-utils -y
RUN apt-get install -f -y python3-pip 
RUN apt-get install -f -y python3-setuptools 
RUN apt-get install -f -y wget 
RUN apt-get install -f -y poppler-utils 
RUN apt-get install -f -y jq 
RUN apt-get install -f -y pdftk 
RUN apt-get install -f -y ffmpeg 
RUN apt-get install -f -y build-essential 
RUN apt-get install -f -y cmake 
RUN apt-get install -f -y make
RUN apt-get install -f -y libpoppler-private-dev
RUN apt-get install -f -y pkg-config
RUN apt-get install -f -y gcc
RUN apt-get install -f -y g++
RUN apt-get install -f -y libcairo-dev
RUN apt-get install -f -y libspiro-dev
RUN apt-get install -f -y libpng-dev
RUN apt-get install -f -y libjpeg-dev

RUN apt-get install -f -y libpoppler-dev
RUN apt-get install -f -y libpango1.0-dev
RUN apt-get install -f -y poppler-data
RUN apt-get install -f -y openjdk-8-jre-headless

RUN apt-get install -f -y libfontforge-dev
RUN pip3 install --upgrade pip \
    && apt-get clean
RUN pip3 --no-cache-dir install --upgrade awscli
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
 
WORKDIR /tmp

COPY lib/poppler-poppler-0.81.0.tar.gz /tmp
RUN tar -xvf poppler-poppler-0.81.0.tar.gz
WORKDIR /tmp/poppler-poppler-0.81.0
# # compile and install the poppler for debian..
RUN mkdir build && cd build && cmake  -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -L$HOME/prefix/lib -I$HOME/prefix/include -DTESTDATADIR=$PWD/testfiles -DENABLE_XPDF_HEADERS=ON  .. && make && make install

WORKDIR /tmp
COPY lib/pdf2htmlEX-0.18.7-poppler-0.81.0.tar.gz /tmp
RUN tar -xf /tmp/pdf2htmlEX-0.18.7-poppler-0.81.0.tar.gz

RUN cp /tmp/poppler-poppler-0.81.0/build/config.h /tmp/pdf2htmlEX-0.18.7-poppler-0.81.0/3rdparty/poppler/git/

WORKDIR /tmp/pdf2htmlEX-0.18.7-poppler-0.81.0
RUN ./dobuild

When I build the docker image I get the following errors:

/tmp/pdf2htmlEX-0.18.7-poppler-0.81.0/3rdparty/poppler/git/CairoFontEngine.cc: In member function 'virtual bool CairoFont::matches(Ref&, bool)': /tmp/pdf2htmlEX-0.18.7-poppler-0.81.0/3rdparty/poppler/git/CairoFontEngine.cc:83:17: error: no match for 'operator==' (operand types are 'Ref' and 'Ref') return (other == ref); ~~~~~~^~~~~~ /tmp/pdf2htmlEX-0.18.7-poppler-0.81.0/3rdparty/poppler/git/CairoFontEngine.cc: In static member function 'static CairoFreeTypeFont* CairoFreeTypeFont::create(GfxFont*, XRef*, FT_Library, bool)': /tmp/pdf2htmlEX-0.18.7-poppler-0.81.0/3rdparty/poppler/git/CairoFontEngine.cc:420:47: error: 'class GooString' has no member named 'c_str' gfxFont->getName() ? gfxFont->getName()->c_str() ^~~~~ /tmp/pdf2htmlEX-0.18.7-poppler-0.81.0/3rdparty/poppler/git/CairoFontEngine.cc:439:27: error: 'class GooString' has no member named 'c_str' fileNameC = fileName->c_str(); ^~~~~ /tmp/pdf2htmlEX-0.18.7-poppler-0.81.0/3rdparty/poppler/git/CairoFontEngine.cc:488:42: error: invalid conversion from 'const char*' to 'char*' [-fpermissive] ff = FoFiTrueType::load(fileNameC); ^ In file included from /tmp/pdf2htmlEX-0.18.7-poppler-0.81.0/3rdparty/poppler/git/CairoFontEngine.cc:45:0: /usr/include/poppler/fofi/FoFiTrueType.h:53:24: note: initializing argument 1 of 'static FoFiTrueType* FoFiTrueType::load(char*, int)' static FoFiTrueType load(char fileName, int faceIndexA=0); ^~~~ /tmp/pdf2htmlEX-0.18.7-poppler-0.81.0/3rdparty/poppler/git/CairoFontEngine.cc:502:40: error: invalid conversion from 'const char' to 'char' [-fpermissive] ff = FoFiTrueType::load(fileNameC); ^ In file included from /tmp/pdf2htmlEX-0.18.7-poppler-0.81.0/3rdparty/poppler/git/CairoFontEngine.cc:45:0: /usr/include/poppler/fofi/FoFiTrueType.h:53:24: note: initializing argument 1 of 'static FoFiTrueType* FoFiTrueType::load(char*, int)' static FoFiTrueType load(char fileName, int faceIndexA=0); ^~~~ /tmp/pdf2htmlEX-0.18.7-poppler-0.81.0/3rdparty/poppler/git/CairoFontEngine.cc:531:42: error: invalid conversion from 'const char' to 'char' [-fpermissive] ff1c = FoFiType1C::load(fileNameC); ^ In file included from /tmp/pdf2htmlEX-0.18.7-poppler-0.81.0/3rdparty/poppler/git/CairoFontEngine.cc:46:0: /usr/include/poppler/fofi/FoFiType1C.h:154:22: note: initializing argument 1 of 'static FoFiType1C* FoFiType1C::load(char*)' static FoFiType1C load(char fileName); ^~~~ /tmp/pdf2htmlEX-0.18.7-poppler-0.81.0/3rdparty/poppler/git/CairoFontEngine.cc:563:37: error: invalid conversion from 'const char' to 'char' [-fpermissive] ff = FoFiTrueType::load(fileNameC); ^ In file included from /tmp/pdf2htmlEX-0.18.7-poppler-0.81.0/3rdparty/poppler/git/CairoFontEngine.cc:45:0: /usr/include/poppler/fofi/FoFiTrueType.h:53:24: note: initializing argument 1 of 'static FoFiTrueType* FoFiTrueType::load(char*, int)' static FoFiTrueType load(char fileName, int faceIndexA=0); ^~~~ /tmp/pdf2htmlEX-0.18.7-poppler-0.81.0/3rdparty/poppler/git/CairoFontEngine.cc: In function 'cairo_status_t _render_type3_glyph(cairo_scaled_font_t, long unsigned int, cairo_t, cairo_text_extents_t*)': /tmp/pdf2htmlEX-0.18.7-poppler-0.81.0/3rdparty/poppler/git/CairoFontEngine.cc:700:37: error: no matching function for call to 'Dict::getVal(long unsigned int&)' charProc = charProcs->getVal(glyph); ^ In file included from /usr/include/poppler/Object.h:314:0, from /usr/include/poppler/GfxFont.h:41, from /tmp/pdf2htmlEX-0.18.7-poppler-0.81.0/3rdparty/poppler/git/CairoFontEngine.h:38, from /tmp/pdf2htmlEX-0.18.7-poppler-0.81.0/3rdparty/poppler/git/CairoFontEngine.cc:42: /usr/include/poppler/Dict.h:85:11: note: candidate: Object* Dict::getVal(int, Object*) Object *getVal(int i, Object *obj); ^~~~~~ /usr/include/poppler/Dict.h:85:11: note: candidate expects 2 arguments, 1 provided /tmp/pdf2htmlEX-0.18.7-poppler-0.81.0/3rdparty/poppler/git/CairoFontEngine.cc: In member function 'virtual bool CairoType3Font::matches(Ref&, bool)': /tmp/pdf2htmlEX-0.18.7-poppler-0.81.0/3rdparty/poppler/git/CairoFontEngine.cc:786:17: error: no match for 'operator==' (operand types are 'Ref' and 'Ref') return (other == ref && printing == printingA); ~~~~~~^~~~~~ CMakeFiles/pdf2htmlEX.dir/build.make:62: recipe for target 'CMakeFiles/pdf2htmlEX.dir/3rdparty/poppler/git/CairoFontEngine.cc.o' failed make[2]: *** [CMakeFiles/pdf2htmlEX.dir/3rdparty/poppler/git/CairoFontEngine.cc.o] Error 1 CMakeFiles/Makefile2:355: recipe for target 'CMakeFiles/pdf2htmlEX.dir/all' failed make[1]: *** [CMakeFiles/pdf2htmlEX.dir/all] Error 2 Makefile:138: recipe for target 'all' failed make: *** [all] Error 2

Please advise how can I resolve this.

4

0 回答 0