GithubHelp home page GithubHelp logo

Comments (4)

GMolini avatar GMolini commented on May 8, 2024 2

You should try poppler version 0.81 and fontforge tag 20170731.

To install poppler:

apt-get install pkg-config fontconfig libfontconfig1-dev libjpeg-dev libtiff5 libtiff5-dev libnss3 libnss3-dev libcairo2 libcairo2-dev cmake libopenjp2-7 libopenjp2-7-dev 

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_UNSTABLE_API_ABI_HEADERS=ON ..
make
sudo make install

to install fontforge:

apt-get install libpango1.0-0 libpango1.0-dev libxml2 libxml2-dev libspiro-dev libgif-dev
git clone --depth 1 --single-branch --branch 20170731 https://github.com/fontforge/fontforge.git
cd fontforge/
git checkout tags/20170731
./bootstrap
./configure --without-x
make
make install

from pdf2htmlex.

ViliusSutkus89 avatar ViliusSutkus89 commented on May 8, 2024 1

Hey ik0,

This is a two part problem.

First part is installing to a different prefix.
CMake builds take INSTALL_PREFIX argument. For Poppler it will be

mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/home/ik0/pdf2htmlEX_and_deps -DCMAKE_BUILD_TYPE=Release -DENABLE_UNSTABLE_API_ABI_HEADERS=ON ..
make
make install

Autotools takes --prefix argument, so you can

./configure --prefix=/home/ik0/pdf2htmlEX_and_deps
make
make install

Second part is telling pdf2htmlEX to consume libraries from /home/ik0/pdf2htmlEX_and_deps and
Most libraries produce either pkg-config.pc or CMake find_package configs.
The former available in /usr/lib/pkgconfig, the latter in /usr/lib/cmake.

To find these libraries pdf2htmlEX uses pkg_check_modules, which internally uses pkg-config,
so that's the only one that we need to worry about right now.

First verify that you can find them manually.
pkg-config accepts PKG_CONFIG_PATH environment variable to tell it where it should look for .pc files first, before trying /usr/lib/pkgconfig . If I recall correctly one of these dependencies is installed to lib, other is to lib64, so we need to pass both.

PKG_CONFIG_PATH=/home/ik0/pdf2htmlEX_and_deps/lib/pkgconfig:/home/ik0/pdf2htmlEX_and_deps/lib64/pkgconfig pkg-config --cflags poppler libfontforge

Once you know that they're both installed "correctly", you can compile pdf2htmlEX with them

cd pdf2htmlEX_sources
mkdir build
cd build
PKG_CONFIG_PATH=/home/ik0/pdf2htmlEX_and_deps/lib/pkgconfig:/home/ik0/pdf2htmlEX_and_deps/lib64/pkgconfig cmake -DCMAKE_INSTALL_PREFIX=/home/ik0/pdf2htmlEX_and_deps ..
make

At this point you may be greeted by an error, which tells you that some header from poppler can't find "poppler/GfxState.h". Poppler's pkgconfig.pc file defines it's include path as /home/ik0/pdf2htmlEX_and_deps/include/poppler/ and this requested file would look like /home/ik0/pdf2htmlEX_and_deps/include/poppler/poppler/GfxState.h

Edit Poppler's pkgconfig.pc ( /home/ik0/pdf2htmlEX_and_deps/lib64/pkgconfig/poppler.pc ), so it includes the root include dir too.

CFlags: -I${includedir}/poppler

becomes

CFlags: -I${includedir}/poppler -I${includedir}

Try buildinging pdf2htmlEX again

cd pdf2htmlEX_sources
mkdir build
cd build
PKG_CONFIG_PATH=/home/ik0/pdf2htmlEX_and_deps/lib/pkgconfig:/home/ik0/pdf2htmlEX_and_deps/lib64/pkgconfig cmake -DCMAKE_INSTALL_PREFIX=/home/ik0/pdf2htmlEX_and_deps ..
make
make install

Try running the newly installed pdf2htmlEX

/home/ik0/pdf2htmlEX_and_deps/bin/pdf2htmlEX

You might get an error complaining about libpoppler.so not being found.

LD_LIBRARY_PATH=/home/ik0/pdf2htmlEX_and_deps/lib:/home/ik0/pdf2htmlEX_and_deps/lib64 /home/ik0/pdf2htmlEX_and_deps/bin/pdf2htmlEX

from pdf2htmlex.

ik0 avatar ik0 commented on May 8, 2024

Hi, Guillermo,

thanks for reply. I've compiled poppler 0.81 and fontforge. How to tell pdf2htmlEX to use them in non standard path ? I do not want to overwrite my system libraries before I test everything .

from pdf2htmlex.

ik0 avatar ik0 commented on May 8, 2024

Hey Guillermo and Vilius

thanks a lot ! That should be written in some Howto or Wiki. Very useful !

a little details: i did not get error about "poppler/GfxState.h" . I've installed poppler in /usr/local/poppler-0.81 and add path to file in /etc/ld.so.conf.d/ so everyone could start pdf2htmlEX without adding LD_LIBRARY_PATH every time.

from pdf2htmlex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.