Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drymar/889f2d2921c4b9c3f882263a2f034475 to your computer and use it in GitHub Desktop.
Save drymar/889f2d2921c4b9c3f882263a2f034475 to your computer and use it in GitHub Desktop.
Installing pdf2htmlEX on Ubuntu Server 14.04
#!/bin/sh
RESTORE=$(echo '\033[0m')
BOLD=$(echo '\033[1m')
GREEN=$(echo '\033[1;32m')
echo
echo ${GREEN}
echo "------------------------------"
echo " Installing prerequisites "
echo "------------------------------"
echo
echo ${RESTORE}
apt-get update
apt-get install -y build-essential checkinstall git cmake
apt-get install -y poppler-data autotools-dev libjpeg-dev libtiff4-dev libpng12-dev libgif-dev libxt-dev autoconf automake libtool bzip2 libxml2-dev libuninameslist-dev libspiro-dev python-dev libpango1.0-dev libcairo2-dev chrpath uuid-dev uthash-dev libopenjpeg-dev
cd ~
mkdir src
cd src/
echo ${GREEN}
echo
echo "--------------------------"
echo " Downloading sources "
echo "--------------------------"
echo
echo ${RESTORE}
wget http://poppler.freedesktop.org/poppler-0.26.5.tar.xz
wget http://download.savannah.gnu.org/releases-noredirect/freetype/freetype-2.6.3.tar.gz
wget http://www.freedesktop.org/software/fontconfig/release/fontconfig-2.12.0.tar.bz2
git clone https://github.com/coolwanglu/fontforge.git
git clone https://github.com/coolwanglu/pdf2htmlEX.git
echo ${GREEN}
echo
echo "------------------------"
echo " Installing poppler "
echo "------------------------"
echo
echo ${RESTORE}
tar xf poppler-0.26.5.tar.xz
cd poppler-0.26.5
./configure --prefix=/usr --enable-xpdf-headers && make && make install
cd ..
echo ${GREEN}
echo
echo "-------------------------"
echo " Installing freetype "
echo "-------------------------"
echo
echo ${RESTORE}
tar -zvxf freetype-2.6.3.tar.gz
cd freetype-2.6.3
./configure && make && make install
cd ..
echo ${GREEN}
echo
echo "---------------------------"
echo " Installing fontconfig "
echo "---------------------------"
echo
echo ${RESTORE}
tar jxvf fontconfig-2.12.0.tar.bz2
cd fontconfig-2.12.0
./configure && make && make install
cd ..
echo ${GREEN}
echo
echo "-------------------------------------------"
echo " Installing fontforge "
echo
echo " This will take a while, grab a coffee "
echo "-------------------------------------------"
echo
echo ${RESTORE}
cd fontforge
git checkout pdf2htmlEX
./autogen.sh
./configure --prefix=/usr && make && make install
cd ..
echo ${GREEN}
echo
echo "---------------------------"
echo " Installing pdf2htmlEX "
echo "---------------------------"
echo
echo ${RESTORE}
cd pdf2htmlEX
cmake . && make && make install
echo ${GREEN}
echo
echo "------------------------------------------------"
echo " FINISHED! "
echo "------------------------------------------------"
echo
echo ${RESTORE}
echo ${BOLD}
pdf2htmlEX --version
echo ${RESTORE}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment