mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-12-22 04:50:09 +00:00
Merge pull request #14 from stephengaito/update-poppler
Update poppler to 0.83.0 Updated poppler dependency to poppler-0.83.0 as well as some minor build script refactoring (alas we can still not build on homebrew)
This commit is contained in:
commit
ae62ce9762
@ -16,23 +16,18 @@ echo ""
|
||||
#
|
||||
# see: https://github.com/travis-ci/travis-ci/issues/5301 (unfixed)
|
||||
#
|
||||
if [ -n "$PYTHON_CFLAGS" ] ; then
|
||||
export PYTHON_CFLAGS="$(python3-config --cflags) $PYTHON_CFLAGS"
|
||||
fi
|
||||
|
||||
if [ -n "$PYTHON_LIBS" ] ; then
|
||||
export PYTHON_LIBS="$(python3-config --ldflags) $PYTHON_LIBS"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "PYTHON_CFLAGS:"
|
||||
echo "-------------------------------"
|
||||
export PYTHON_CFLAGS="$(python3-config --cflags) $PYTHON_CFLAGS"
|
||||
echo $PYTHON_CFLAGS
|
||||
echo "-------------------------------"
|
||||
echo ""
|
||||
echo ""
|
||||
echo "PYTHON_LIBS:"
|
||||
echo "-------------------------------"
|
||||
export PYTHON_LIBS="$(python3-config --ldflags) $PYTHON_LIBS"
|
||||
echo $PYTHON_LIBS
|
||||
echo "-------------------------------"
|
||||
echo ""
|
||||
@ -45,7 +40,7 @@ cd fontforge
|
||||
./bootstrap
|
||||
|
||||
./configure \
|
||||
--prefix=/usr/local \
|
||||
--prefix=$PDF2HTMLEX_PREFIX \
|
||||
--enable-python-scripting=3 \
|
||||
--disable-dependency-tracking \
|
||||
--disable-silent-rules \
|
||||
|
@ -1,41 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This bash script builds the complete pdf2htmlEX application LOCALLY
|
||||
# (It does not create the AppImage or Docker images)
|
||||
|
||||
# Adjust the following two environment variables to suit your needs
|
||||
#
|
||||
export UNATTENDED="--assume-yes"
|
||||
export MAKE_PARALLEL="-j $(nproc)"
|
||||
|
||||
# choose one of the following...
|
||||
#
|
||||
export PDF2HTMLEX_BRANCH=fontforge-update
|
||||
# export PDF2HTMLEX_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
|
||||
|
||||
################
|
||||
# do the build
|
||||
|
||||
./buildScripts/versionEnvs || { echo 'versionEnvs FAILED' ; exit 1 ; }
|
||||
|
||||
./buildScripts/reportEnvs || { echo 'reportEnvs FAILED' ; exit 1 ; }
|
||||
|
||||
./buildScripts/getBuildTools || { echo 'getBuildTools FAILED' ; exit 1 ; }
|
||||
|
||||
./buildScripts/getDevLibraries || { echo 'getDevLibraries FAILED' ; exit 1 ; }
|
||||
|
||||
./buildScripts/getPoppler || { echo 'getPoppler FAILED' ; exit 1 ; }
|
||||
|
||||
./buildScripts/buildPoppler || { echo 'buildPoppler FAILED' ; exit 1 ; }
|
||||
|
||||
./buildScripts/installPoppler || { echo 'installPoppler FAILED' ; exit 1 ; }
|
||||
|
||||
./buildScripts/getFontforge || { echo 'getFontforge FAILED' ; exit 1 ; }
|
||||
|
||||
./buildScripts/buildFontforge || { echo 'buildFontforge FAILED' ; exit 1 ; }
|
||||
|
||||
./buildScripts/installFontforge || { echo 'installFontforge FAILED' ; exit 1 ; }
|
||||
|
||||
./buildScripts/buildPdf2htmlEX || { echo 'buildPdf2htmlEX FAILED' ; exit 1 ; }
|
||||
|
||||
./buildScripts/installPdf2htmlEX || { echo 'installPdf2htmlEX FAILED' ; exit 1 ; }
|
47
buildScripts/buildInstallLocallyApt
Executable file
47
buildScripts/buildInstallLocallyApt
Executable file
@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This bash script builds the complete pdf2htmlEX application LOCALLY
|
||||
# (It does not create the AppImage or Docker images)
|
||||
|
||||
# Adjust the following two environment variables to suit your needs
|
||||
#
|
||||
export UNATTENDED="--assume-yes"
|
||||
export MAKE_PARALLEL="-j $(nproc)"
|
||||
|
||||
# choose one of the following...
|
||||
#
|
||||
export PDF2HTMLEX_BRANCH=update-poppler
|
||||
# export PDF2HTMLEX_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
|
||||
|
||||
# The following environment variable determines where the poppler,
|
||||
# poppler-data, fontforge and pdf2htmlEX packages are installed.
|
||||
# CHANGE IT TO SUIT YOUR NEEDS:
|
||||
#
|
||||
export PDF2HTMLEX_PREFIX=/usr/local
|
||||
|
||||
################
|
||||
# do the build
|
||||
|
||||
./buildScripts/versionEnvs || { echo 'versionEnvs FAILED' ; exit 1 ; }
|
||||
|
||||
./buildScripts/reportEnvs || { echo 'reportEnvs FAILED' ; exit 1 ; }
|
||||
|
||||
./buildScripts/getBuildToolsApt || { echo 'getBuildToolsApt FAILED' ; exit 1 ; }
|
||||
|
||||
./buildScripts/getDevLibrariesApt || { echo 'getDevLibrariesApt FAILED' ; exit 1 ; }
|
||||
|
||||
./buildScripts/getPoppler || { echo 'getPoppler FAILED' ; exit 1 ; }
|
||||
|
||||
./buildScripts/buildPoppler || { echo 'buildPoppler FAILED' ; exit 1 ; }
|
||||
|
||||
./buildScripts/installPoppler || { echo 'installPoppler FAILED' ; exit 1 ; }
|
||||
|
||||
./buildScripts/getFontforge || { echo 'getFontforge FAILED' ; exit 1 ; }
|
||||
|
||||
./buildScripts/buildFontforge || { echo 'buildFontforge FAILED' ; exit 1 ; }
|
||||
|
||||
./buildScripts/installFontforge || { echo 'installFontforge FAILED' ; exit 1 ; }
|
||||
|
||||
./buildScripts/buildPdf2htmlEX || { echo 'buildPdf2htmlEX FAILED' ; exit 1 ; }
|
||||
|
||||
./buildScripts/installPdf2htmlEX || { echo 'installPdf2htmlEX FAILED' ; exit 1 ; }
|
43
buildScripts/buildInstallLocallyBrew
Executable file
43
buildScripts/buildInstallLocallyBrew
Executable file
@ -0,0 +1,43 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This bash script builds the complete pdf2htmlEX application LOCALLY
|
||||
# (It does not create the AppImage or Docker images)
|
||||
|
||||
# Adjust the following two environment variables to suit your needs
|
||||
#
|
||||
export UNATTENDED="--assume-yes"
|
||||
export MAKE_PARALLEL="-j $(nproc)"
|
||||
|
||||
# choose one of the following...
|
||||
#
|
||||
export PDF2HTMLEX_BRANCH=update-poppler
|
||||
# export PDF2HTMLEX_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
|
||||
|
||||
export PDF2HTMLEX_PREFIX=toBeDetermined
|
||||
|
||||
################
|
||||
# do the build
|
||||
|
||||
./buildScripts/versionEnvs || { echo 'versionEnvs FAILED' ; exit 1 ; }
|
||||
|
||||
./buildScripts/reportEnvs || { echo 'reportEnvs FAILED' ; exit 1 ; }
|
||||
|
||||
./buildScripts/getBuildToolsBrew || { echo 'getBuildToolsBrew FAILED' ; exit 1 ; }
|
||||
|
||||
./buildScripts/getDevLibrariesBrew || { echo 'getDevLibrariesBrew FAILED' ; exit 1 ; }
|
||||
|
||||
./buildScripts/getPoppler || { echo 'getPoppler FAILED' ; exit 1 ; }
|
||||
|
||||
./buildScripts/buildPoppler || { echo 'buildPoppler FAILED' ; exit 1 ; }
|
||||
|
||||
./buildScripts/installPoppler || { echo 'installPoppler FAILED' ; exit 1 ; }
|
||||
|
||||
./buildScripts/getFontforge || { echo 'getFontforge FAILED' ; exit 1 ; }
|
||||
|
||||
./buildScripts/buildFontforge || { echo 'buildFontforge FAILED' ; exit 1 ; }
|
||||
|
||||
./buildScripts/installFontforge || { echo 'installFontforge FAILED' ; exit 1 ; }
|
||||
|
||||
./buildScripts/buildPdf2htmlEX || { echo 'buildPdf2htmlEX FAILED' ; exit 1 ; }
|
||||
|
||||
./buildScripts/installPdf2htmlEX || { echo 'installPdf2htmlEX FAILED' ; exit 1 ; }
|
@ -11,5 +11,5 @@ echo ""
|
||||
cd pdf2htmlEX
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PDF2HTMLEX_PREFIX ..
|
||||
make $MAKE_PARALLEL
|
||||
|
@ -11,5 +11,5 @@ echo ""
|
||||
cd pdf2htmlEX
|
||||
mkdir build
|
||||
cd build
|
||||
CC=clang CXX=clang++ cmake -DCMAKE_INSTALL_PREFIX=/usr/local ..
|
||||
CC=clang CXX=clang++ cmake -DCMAKE_INSTALL_PREFIX=$PDF2HTMLEX_PREFIX ..
|
||||
make $MAKE_PARALLEL
|
||||
|
@ -11,6 +11,6 @@ echo ""
|
||||
cd poppler
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local \
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PDF2HTMLEX_PREFIX \
|
||||
-DENABLE_LIBOPENJPEG=none ..
|
||||
make $MAKE_PARALLEL
|
||||
|
@ -25,7 +25,11 @@ sudo rm -rf install_manifest.txt
|
||||
|
||||
make install DESTDIR=../../imageBuild/appDir
|
||||
|
||||
cd ../../imageBuild
|
||||
cd ../../poppler-data
|
||||
|
||||
make install prefix=$PDF2HTMLEX_PREFIX DESTDIR=../imageBuild/appDir
|
||||
|
||||
cd ../imageBuild
|
||||
|
||||
# force libfontconfig into AppImage (linuxdeploy blacklists libfontconfig)
|
||||
#
|
||||
@ -38,7 +42,7 @@ wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/$LI
|
||||
chmod a+x $LINUX_DEPLOY_APP_IMAGE
|
||||
|
||||
./$LINUX_DEPLOY_APP_IMAGE \
|
||||
-e appDir/usr/local/bin/pdf2htmlEX \
|
||||
-e appDir/$PDF2HTMLEX_PREFIX/bin/pdf2htmlEX \
|
||||
--create-desktop-file \
|
||||
-i ../pdf2htmlEX/logo/pdf2htmlEX.svg \
|
||||
--appdir=appDir \
|
||||
|
@ -48,7 +48,11 @@ echo "export DOCKER_NAME=\"$DOCKER_NAME\"" >> buildScripts/reSourceVersi
|
||||
|
||||
make install DESTDIR=../../imageBuild/dockerDir
|
||||
|
||||
cd ../../imageBuild/dockerDir
|
||||
cd ../../poppler-data
|
||||
|
||||
make install prefix=$PDF2HTMLEX_PREFIX DESTDIR=../imageBuild/dockerDir
|
||||
|
||||
cd ../imageBuild/dockerDir
|
||||
|
||||
copy_deps
|
||||
|
||||
@ -58,7 +62,7 @@ echo "export DOCKER_NAME=\"$DOCKER_NAME\"" >> buildScripts/reSourceVersi
|
||||
FROM $DOCKER_FROM
|
||||
COPY ./ /
|
||||
RUN ldconfig
|
||||
ENTRYPOINT ["/usr/local/bin/pdf2htmlEX"]
|
||||
ENTRYPOINT ["$PDF2HTMLEX_PREFIX/bin/pdf2htmlEX"]
|
||||
DOCKERFILE_HERE_DOC
|
||||
|
||||
cd ..
|
||||
|
24
buildScripts/getBuildToolsBrew
Executable file
24
buildScripts/getBuildToolsBrew
Executable file
@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This bash script automates getting the required build tools (brew install)
|
||||
|
||||
echo ""
|
||||
echo "-------------------------------------------------------------------"
|
||||
echo "INSTALLING Build Tools (using Home/Linux Brew)"
|
||||
echo "-------------------------------------------------------------------"
|
||||
echo ""
|
||||
|
||||
brew update
|
||||
brew install \
|
||||
git \
|
||||
pkg-config \
|
||||
ruby \
|
||||
autoconf \
|
||||
libtool \
|
||||
cmake \
|
||||
make \
|
||||
gcc \
|
||||
gettext \
|
||||
openjdk \
|
||||
jq \
|
||||
tree
|
@ -19,7 +19,6 @@ sudo apt-get $UNATTENDED install \
|
||||
libspiro-dev \
|
||||
libpng-dev \
|
||||
libjpeg-dev \
|
||||
poppler-data \
|
||||
libpango1.0-dev \
|
||||
liblcms2-dev \
|
||||
libxml2-dev \
|
21
buildScripts/getDevLibrariesBrew
Executable file
21
buildScripts/getDevLibrariesBrew
Executable file
@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This bash script automates getting the development libraries required to
|
||||
# build poppler and fontforge (using Home/Linux Brew)
|
||||
|
||||
echo ""
|
||||
echo "-------------------------------------------------------------------"
|
||||
echo "INSTALLING development libraries (using Home/Linux Brew)"
|
||||
echo "-------------------------------------------------------------------"
|
||||
echo ""
|
||||
|
||||
brew update
|
||||
brew install \
|
||||
cairo \
|
||||
libspiro \
|
||||
libpng \
|
||||
jpeg \
|
||||
pango \
|
||||
little-cms2 \
|
||||
libxml2 \
|
||||
libuninameslist \
|
@ -3,7 +3,7 @@
|
||||
# This bash script automates the process of getting the original pdf2htmlEX
|
||||
# source
|
||||
|
||||
PDF2HTMLEX_BRANCH=fontforge-update
|
||||
PDF2HTMLEX_BRANCH=update-poppler
|
||||
|
||||
echo ""
|
||||
echo "-------------------------------------------------------------------"
|
24
buildScripts/getPdf2htmlEXBrew
Executable file
24
buildScripts/getPdf2htmlEXBrew
Executable file
@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This bash script automates the process of getting the original pdf2htmlEX
|
||||
# source
|
||||
|
||||
PDF2HTMLEX_BRANCH=update-poppler
|
||||
|
||||
echo ""
|
||||
echo "-------------------------------------------------------------------"
|
||||
echo "GETTING pdf2htmlEX sources (using wget)"
|
||||
echo " (PDF2HTMLEX_BRANCH: [$PDF2HTMLEX_BRANCH])"
|
||||
echo "-------------------------------------------------------------------"
|
||||
echo ""
|
||||
|
||||
|
||||
wget https://codeload.github.com/stephengaito/pdf2htmlEX/zip/$PDF2HTMLEX_BRANCH
|
||||
|
||||
mv $PDF2HTMLEX_BRANCH $PDF2HTMLEX_BRANCH.zip
|
||||
|
||||
brew install unzip
|
||||
|
||||
unzip $PDF2HTMLEX_BRANCH.zip
|
||||
|
||||
mv pdf2htmlEX-$PDF2HTMLEX_BRANCH pdf2htmlEX
|
@ -21,4 +21,12 @@ wget https://poppler.freedesktop.org/$POPPLER_VERSION.tar.xz
|
||||
|
||||
tar xvf $POPPLER_VERSION.tar.xz
|
||||
|
||||
echo "Getting poppler-data version: 0.4.9"
|
||||
|
||||
mv $POPPLER_VERSION poppler
|
||||
|
||||
wget https://poppler.freedesktop.org/poppler-data-0.4.9.tar.gz
|
||||
|
||||
tar xvf poppler-data-0.4.9.tar.gz
|
||||
|
||||
mv poppler-data-0.4.9 poppler-data
|
||||
|
@ -26,17 +26,22 @@ sudo make install
|
||||
|
||||
cd ..
|
||||
|
||||
sudo mkdir -p /usr/local/include/poppler
|
||||
sudo cp poppler/*.h /usr/local/include/poppler
|
||||
sudo mkdir -p $PDF2HTMLEX_PREFIX/include/poppler
|
||||
sudo cp poppler/*.h $PDF2HTMLEX_PREFIX/include/poppler
|
||||
|
||||
sudo mkdir -p /usr/local/include/poppler/goo
|
||||
sudo cp goo/*.h /usr/local/include/poppler/goo
|
||||
sudo mkdir -p $PDF2HTMLEX_PREFIX/include/poppler/goo
|
||||
sudo cp goo/*.h $PDF2HTMLEX_PREFIX/include/poppler/goo
|
||||
|
||||
sudo mkdir -p /usr/local/include/poppler/fofi
|
||||
sudo cp fofi/*.h /usr/local/include/poppler/fofi
|
||||
sudo mkdir -p $PDF2HTMLEX_PREFIX/include/poppler/fofi
|
||||
sudo cp fofi/*.h $PDF2HTMLEX_PREFIX/include/poppler/fofi
|
||||
|
||||
sudo mkdir -p /usr/local/include/poppler/splash
|
||||
sudo cp splash/*.h /usr/local/include/poppler/splash
|
||||
sudo mkdir -p $PDF2HTMLEX_PREFIX/include/poppler/splash
|
||||
sudo cp splash/*.h $PDF2HTMLEX_PREFIX/include/poppler/splash
|
||||
|
||||
sudo cp build/poppler/poppler-config.h \
|
||||
/usr/local/include/poppler
|
||||
$PDF2HTMLEX_PREFIX/include/poppler
|
||||
|
||||
cd ../poppler-data
|
||||
|
||||
sudo make install prefix=$PDF2HTMLEX_PREFIX
|
||||
|
||||
|
9
buildScripts/listFilesByChangeTime
Executable file
9
buildScripts/listFilesByChangeTime
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
# see:https://stackoverflow.com/a/7448828
|
||||
|
||||
find . -type f -print0 | \
|
||||
xargs -0 stat --format '%Y :%y %n' | \
|
||||
sort -nr | \
|
||||
grep -v build | \
|
||||
cut -d: -f2-
|
@ -10,9 +10,9 @@ echo " build dir: [$TRAVIS_BUILD_DIR]"
|
||||
echo " repo slug: [$TRAVIS_REPO_SLUG]"
|
||||
|
||||
echo "Build env:"
|
||||
echo " prefix: [$PDF2HTMLEX_PREFIX]"
|
||||
echo " unattended: [$UNATTENDED]"
|
||||
echo " make parallel: [$MAKE_PARALLEL]"
|
||||
|
||||
source ./buildScripts/reSourceVersionEnvs
|
||||
|
||||
echo "pdf2htmlEX env:"
|
||||
|
@ -26,23 +26,23 @@ echo $LDFLAGS
|
||||
echo $CPPFLAGS
|
||||
which clang
|
||||
echo "-------------------------------------------------"
|
||||
brew install llvm
|
||||
brew install -v python@2
|
||||
brew install jq
|
||||
#brew install llvm
|
||||
#brew install -v python@2
|
||||
#brew install jq
|
||||
echo "-------------------------------------------------"
|
||||
echo $PATH
|
||||
echo $LDFLAGS
|
||||
echo $CPPFLAGS
|
||||
which clang
|
||||
export llvmVersion=$(brew info --json=v1 llvm | jq '.[].installed[].version' | tr -d '"')
|
||||
#export llvmVersion=$(brew info --json=v1 llvm | jq '.[].installed[].version' | tr -d '"')
|
||||
echo $llvmVersion
|
||||
export python2Version=$(brew info --json=v1 python@2 | jq '.[].installed[].version' | tr -d '"')
|
||||
#export python2Version=$(brew info --json=v1 python@2 | jq '.[].installed[].version' | tr -d '"')
|
||||
echo $python2Version
|
||||
echo "-------------------------------------------------"
|
||||
brew info llvm
|
||||
brew switch llvm $llvmVersion
|
||||
brew info python@2
|
||||
brew switch python@2 $python2Version
|
||||
#brew info llvm
|
||||
#brew switch llvm $llvmVersion
|
||||
#brew info python@2
|
||||
#brew switch python@2 $python2Version
|
||||
echo "-------------------------------------------------"
|
||||
echo $PATH
|
||||
echo $LDFLAGS
|
||||
|
@ -3,8 +3,9 @@
|
||||
# This bash script exports environment variables for the latest software
|
||||
# versions
|
||||
|
||||
export POPPLER_VERSION=poppler-0.83.0
|
||||
#export POPPLER_VERSION=poppler-0.82.0
|
||||
export POPPLER_VERSION=poppler-0.81.0
|
||||
#export POPPLER_VERSION=poppler-0.81.0
|
||||
|
||||
export FONTFORGE_VERSION=20190801
|
||||
#export FONTFORGE_VERSION=20170731
|
||||
@ -31,4 +32,4 @@ echo "export FONTFORGE_VERSION=\"$FONTFORGE_VERSION\"" >> buildScripts/reSourceV
|
||||
echo "export PDF2HTMLEX_BRANCH=\"$PDF2HTMLEX_BRANCH\"" >> buildScripts/reSourceVersionEnvs
|
||||
echo "export MACHINE_ARCH=\"$MACHINE_ARCH\"" >> buildScripts/reSourceVersionEnvs
|
||||
echo "export BUILD_TIME=\"$BUILD_TIME\"" >> buildScripts/reSourceVersionEnvs
|
||||
|
||||
echo "export PDF2HTMLEX_PREFIX=\"$PDF2HTMLEX_PREFIX\"" >> buildScripts/reSourceVersionEnvs
|
||||
|
@ -90,7 +90,7 @@ CairoFont::getFontFace(void) {
|
||||
|
||||
unsigned long
|
||||
CairoFont::getGlyph(CharCode code,
|
||||
Unicode *u, int uLen) {
|
||||
const Unicode *u, int uLen) {
|
||||
FT_UInt gid;
|
||||
|
||||
if (codeToGID && code < codeToGIDLen) {
|
||||
|
@ -15,7 +15,7 @@
|
||||
// under GPL version 2 or later
|
||||
//
|
||||
// Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com>
|
||||
// Copyright (C) 2005, 2018 Albert Astals Cid <aacid@kde.org>
|
||||
// Copyright (C) 2005, 2018, 2019 Albert Astals Cid <aacid@kde.org>
|
||||
// Copyright (C) 2006, 2007 Jeff Muizelaar <jeff@infidigm.net>
|
||||
// Copyright (C) 2006, 2010 Carlos Garcia Campos <carlosgc@gnome.org>
|
||||
// Copyright (C) 2008, 2017 Adrian Johnson <ajohnson@redneon.com>
|
||||
@ -54,7 +54,7 @@ public:
|
||||
|
||||
virtual bool matches(Ref &other, bool printing);
|
||||
cairo_font_face_t *getFontFace(void);
|
||||
unsigned long getGlyph(CharCode code, Unicode *u, int uLen);
|
||||
unsigned long getGlyph(CharCode code, const Unicode *u, int uLen);
|
||||
double getSubstitutionCorrection(GfxFont *gfxFont);
|
||||
|
||||
bool isSubstitute() { return substitute; }
|
||||
|
@ -712,7 +712,7 @@ void CairoOutputDev::updateFont(GfxState *state) {
|
||||
|
||||
/* Align stroke coordinate i if the point is the start or end of a
|
||||
* horizontal or vertical line */
|
||||
void CairoOutputDev::alignStrokeCoords(GfxSubpath *subpath, int i, double *x, double *y)
|
||||
void CairoOutputDev::alignStrokeCoords(const GfxSubpath *subpath, int i, double *x, double *y)
|
||||
{
|
||||
double x1, y1, x2, y2;
|
||||
bool align = false;
|
||||
@ -752,13 +752,12 @@ void CairoOutputDev::alignStrokeCoords(GfxSubpath *subpath, int i, double *x, do
|
||||
|
||||
#undef STROKE_COORD_TOLERANCE
|
||||
|
||||
void CairoOutputDev::doPath(cairo_t *c, GfxState *state, GfxPath *path) {
|
||||
GfxSubpath *subpath;
|
||||
void CairoOutputDev::doPath(cairo_t *c, GfxState *state, const GfxPath *path) {
|
||||
int i, j;
|
||||
double x, y;
|
||||
cairo_new_path (c);
|
||||
for (i = 0; i < path->getNumSubpaths(); ++i) {
|
||||
subpath = path->getSubpath(i);
|
||||
const GfxSubpath *subpath = path->getSubpath(i);
|
||||
if (subpath->getNumPoints() > 0) {
|
||||
if (align_stroke_coords) {
|
||||
alignStrokeCoords(subpath, 0, &x, &y);
|
||||
@ -1395,7 +1394,7 @@ void CairoOutputDev::beginString(GfxState *state, const GooString *s)
|
||||
void CairoOutputDev::drawChar(GfxState *state, double x, double y,
|
||||
double dx, double dy,
|
||||
double originX, double originY,
|
||||
CharCode code, int nBytes, Unicode *u, int uLen)
|
||||
CharCode code, int nBytes, const Unicode *u, int uLen)
|
||||
{
|
||||
if (currentFont) {
|
||||
glyphs[glyphCount].index = currentFont->getGlyph (code, u, uLen);
|
||||
@ -1512,7 +1511,7 @@ finish:
|
||||
|
||||
bool CairoOutputDev::beginType3Char(GfxState *state, double x, double y,
|
||||
double dx, double dy,
|
||||
CharCode code, Unicode *u, int uLen) {
|
||||
CharCode code, const Unicode *u, int uLen) {
|
||||
|
||||
cairo_save (cairo);
|
||||
cairo_matrix_t matrix;
|
||||
@ -3068,7 +3067,7 @@ private:
|
||||
GfxRGB *lookup;
|
||||
int width;
|
||||
GfxImageColorMap *colorMap;
|
||||
int *maskColors;
|
||||
const int *maskColors;
|
||||
int current_row;
|
||||
bool imageError;
|
||||
|
||||
@ -3078,7 +3077,7 @@ public:
|
||||
int scaledWidth, int scaledHeight,
|
||||
bool printing,
|
||||
GfxImageColorMap *colorMapA,
|
||||
int *maskColorsA) {
|
||||
const int *maskColorsA) {
|
||||
cairo_surface_t *image = nullptr;
|
||||
int i;
|
||||
|
||||
@ -3253,7 +3252,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
|
||||
int widthA, int heightA,
|
||||
GfxImageColorMap *colorMap,
|
||||
bool interpolate,
|
||||
int *maskColors, bool inlineImg)
|
||||
const int *maskColors, bool inlineImg)
|
||||
{
|
||||
cairo_surface_t *image;
|
||||
cairo_pattern_t *pattern, *maskPattern;
|
||||
@ -3474,7 +3473,7 @@ void CairoImageOutputDev::setSoftMaskFromImageMask(GfxState *state, Object *ref,
|
||||
|
||||
void CairoImageOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
|
||||
int width, int height, GfxImageColorMap *colorMap,
|
||||
bool interpolate, int *maskColors, bool inlineImg)
|
||||
bool interpolate, const int *maskColors, bool inlineImg)
|
||||
{
|
||||
cairo_t *cr;
|
||||
cairo_surface_t *surface;
|
||||
|
12
pdf2htmlEX/3rdparty/poppler/git/CairoOutputDev.h
vendored
12
pdf2htmlEX/3rdparty/poppler/git/CairoOutputDev.h
vendored
@ -192,13 +192,13 @@ public:
|
||||
void drawChar(GfxState *state, double x, double y,
|
||||
double dx, double dy,
|
||||
double originX, double originY,
|
||||
CharCode code, int nBytes, Unicode *u, int uLen) override;
|
||||
CharCode code, int nBytes, const Unicode *u, int uLen) override;
|
||||
void beginActualText(GfxState *state, const GooString *text) override;
|
||||
void endActualText(GfxState *state) override;
|
||||
|
||||
bool beginType3Char(GfxState *state, double x, double y,
|
||||
double dx, double dy,
|
||||
CharCode code, Unicode *u, int uLen) override;
|
||||
CharCode code, const Unicode *u, int uLen) override;
|
||||
void endType3Char(GfxState *state) override;
|
||||
void beginTextObject(GfxState *state) override;
|
||||
void endTextObject(GfxState *state) override;
|
||||
@ -221,7 +221,7 @@ public:
|
||||
|
||||
void drawImage(GfxState *state, Object *ref, Stream *str,
|
||||
int width, int height, GfxImageColorMap *colorMap,
|
||||
bool interpolate, int *maskColors, bool inlineImg) override;
|
||||
bool interpolate, const int *maskColors, bool inlineImg) override;
|
||||
void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
|
||||
int width, int height,
|
||||
GfxImageColorMap *colorMap,
|
||||
@ -274,7 +274,7 @@ public:
|
||||
double *getType3GlyphBBox () { return t3_glyph_bbox; }
|
||||
|
||||
protected:
|
||||
void doPath(cairo_t *cairo, GfxState *state, GfxPath *path);
|
||||
void doPath(cairo_t *cairo, GfxState *state, const GfxPath *path);
|
||||
cairo_surface_t *downscaleSurface(cairo_surface_t *orig_surface);
|
||||
void getScaledSize(const cairo_matrix_t *matrix,
|
||||
int orig_width, int orig_height,
|
||||
@ -285,7 +285,7 @@ protected:
|
||||
void setMimeData(GfxState *state, Stream *str, Object *ref,
|
||||
GfxImageColorMap *colorMap, cairo_surface_t *image, int height);
|
||||
void fillToStrokePathClip(GfxState *state);
|
||||
void alignStrokeCoords(GfxSubpath *subpath, int i, double *x, double *y);
|
||||
void alignStrokeCoords(const GfxSubpath *subpath, int i, double *x, double *y);
|
||||
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 14, 0)
|
||||
bool setMimeDataForJBIG2Globals (Stream *str, cairo_surface_t *image);
|
||||
#endif
|
||||
@ -469,7 +469,7 @@ public:
|
||||
bool interpolate, bool inlineImg) override;
|
||||
void drawImage(GfxState *state, Object *ref, Stream *str,
|
||||
int width, int height, GfxImageColorMap *colorMap,
|
||||
bool interpolate, int *maskColors, bool inlineImg) override;
|
||||
bool interpolate, const int *maskColors, bool inlineImg) override;
|
||||
void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
|
||||
int width, int height,
|
||||
GfxImageColorMap *colorMap,
|
||||
|
@ -62,8 +62,8 @@
|
||||
|
||||
static void downsample_row_box_filter (
|
||||
int start, int width,
|
||||
uint32_t *src, uint32_t *src_limit, uint32_t *dest,
|
||||
int coverage[], int pixel_coverage)
|
||||
uint32_t *src, const uint32_t *src_limit, uint32_t *dest,
|
||||
const int coverage[], int pixel_coverage)
|
||||
{
|
||||
/* we need an array of the pixel contribution of each destination pixel on the boundaries.
|
||||
* we invert the value to get the value on the other size of the box */
|
||||
|
@ -82,9 +82,11 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Woverloaded-virtual")
|
||||
|
||||
# CYGWIN or GCC 4.5.x bug
|
||||
if(CYGWIN)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")
|
||||
# was: set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")
|
||||
# the following change is untested:
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14")
|
||||
else()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -pthread")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -pthread")
|
||||
endif()
|
||||
|
||||
# check the C++11 features we need
|
||||
|
@ -46,7 +46,7 @@ CairoBackgroundRenderer::~CairoBackgroundRenderer()
|
||||
void CairoBackgroundRenderer::drawChar(GfxState *state, double x, double y,
|
||||
double dx, double dy,
|
||||
double originX, double originY,
|
||||
CharCode code, int nBytes, Unicode *u, int uLen)
|
||||
CharCode code, int nBytes, const Unicode *u, int uLen)
|
||||
{
|
||||
// draw characters as image when
|
||||
// - in fallback mode
|
||||
|
@ -42,7 +42,7 @@ public:
|
||||
virtual void drawChar(GfxState *state, double x, double y,
|
||||
double dx, double dy,
|
||||
double originX, double originY,
|
||||
CharCode code, int nBytes, Unicode *u, int uLen);
|
||||
CharCode code, int nBytes, const Unicode *u, int uLen);
|
||||
|
||||
//for proof
|
||||
void beginTextObject(GfxState *state);
|
||||
|
@ -65,7 +65,7 @@ void SplashBackgroundRenderer::startPage(int pageNum, GfxState *state, XRef *xre
|
||||
void SplashBackgroundRenderer::drawChar(GfxState *state, double x, double y,
|
||||
double dx, double dy,
|
||||
double originX, double originY,
|
||||
CharCode code, int nBytes, Unicode *u, int uLen)
|
||||
CharCode code, int nBytes, const Unicode *u, int uLen)
|
||||
{
|
||||
if (param.proof || html_renderer->is_char_covered(drawn_char_count)) {
|
||||
SplashOutputDev::drawChar(state,x,y,dx,dy,originX,originY,code,nBytes,u,uLen);
|
||||
|
@ -44,7 +44,7 @@ public:
|
||||
virtual void drawChar(GfxState *state, double x, double y,
|
||||
double dx, double dy,
|
||||
double originX, double originY,
|
||||
CharCode code, int nBytes, Unicode *u, int uLen);
|
||||
CharCode code, int nBytes, const Unicode *u, int uLen);
|
||||
|
||||
//for proof
|
||||
void beginTextObject(GfxState *state);
|
||||
|
@ -136,10 +136,10 @@ void DrawingTracer::restore()
|
||||
#endif
|
||||
}
|
||||
|
||||
void DrawingTracer::do_path(GfxState * state, GfxPath * path)
|
||||
void DrawingTracer::do_path(GfxState * state, const GfxPath * path)
|
||||
{
|
||||
//copy from CairoOutputDev::doPath
|
||||
GfxSubpath *subpath;
|
||||
const GfxSubpath *subpath;
|
||||
int i, j;
|
||||
double x, y;
|
||||
cairo_new_path(cairo);
|
||||
@ -220,9 +220,9 @@ void DrawingTracer::stroke(GfxState * state)
|
||||
break;
|
||||
}
|
||||
|
||||
GfxPath * path = state->getPath();
|
||||
const GfxPath * path = state->getPath();
|
||||
for (int i = 0; i < path->getNumSubpaths(); ++i) {
|
||||
GfxSubpath * subpath = path->getSubpath(i);
|
||||
const GfxSubpath * subpath = path->getSubpath(i);
|
||||
if (subpath->getNumPoints() <= 0)
|
||||
continue;
|
||||
double x = subpath->getX(0);
|
||||
|
@ -65,7 +65,7 @@ public:
|
||||
private:
|
||||
void finish();
|
||||
// Following methods operate in user space (just before CTM is applied)
|
||||
void do_path(GfxState * state, GfxPath * path);
|
||||
void do_path(GfxState * state, const GfxPath * path);
|
||||
void draw_non_char_bbox(GfxState * state, double * bbox, int what);
|
||||
void draw_char_bbox(GfxState * state, double * bbox, int inTransparencyGroup);
|
||||
// If cairo is available, parameter state is ignored
|
||||
|
@ -156,7 +156,9 @@ struct HTMLRenderer : OutputDev
|
||||
|
||||
virtual void drawString(GfxState * state, const GooString * s);
|
||||
|
||||
virtual void drawImage(GfxState * state, Object * ref, Stream * str, int width, int height, GfxImageColorMap * colorMap, bool interpolate, int *maskColors, bool inlineImg);
|
||||
virtual void drawImage(GfxState * state, Object * ref, Stream * str,
|
||||
int width, int height, GfxImageColorMap * colorMap,
|
||||
bool interpolate, const int *maskColors, bool inlineImg);
|
||||
|
||||
virtual void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
|
||||
int width, int height,
|
||||
|
@ -636,7 +636,8 @@ void HTMLRenderer::embed_font(const string & filepath, GfxFont * font, FontInfo
|
||||
if(mapped_code > max_key)
|
||||
max_key = mapped_code;
|
||||
|
||||
Unicode u, *pu=&u;
|
||||
Unicode u;
|
||||
Unicode const *pu=&u;
|
||||
if(info.use_tounicode)
|
||||
{
|
||||
int n = ctu ?
|
||||
|
@ -12,7 +12,9 @@
|
||||
|
||||
namespace pdf2htmlEX {
|
||||
|
||||
void HTMLRenderer::drawImage(GfxState * state, Object * ref, Stream * str, int width, int height, GfxImageColorMap * colorMap, bool interpolate, int *maskColors, bool inlineImg)
|
||||
void HTMLRenderer::drawImage(GfxState * state, Object * ref, Stream * str,
|
||||
int width, int height, GfxImageColorMap * colorMap,
|
||||
bool interpolate, const int *maskColors, bool inlineImg)
|
||||
{
|
||||
tracer.draw_image(state);
|
||||
|
||||
|
@ -74,7 +74,7 @@ void HTMLRenderer::drawString(GfxState * state, const GooString * s)
|
||||
int uLen;
|
||||
|
||||
CharCode code;
|
||||
Unicode *u = nullptr;
|
||||
Unicode const *u = nullptr;
|
||||
|
||||
HR_DEBUG(printf("HTMLRenderer::drawString:len=%d\n", len));
|
||||
|
||||
|
@ -65,7 +65,7 @@ void Preprocessor::process(PDFDoc * doc)
|
||||
void Preprocessor::drawChar(GfxState *state, double x, double y,
|
||||
double dx, double dy,
|
||||
double originX, double originY,
|
||||
CharCode code, int nBytes, Unicode *u, int uLen)
|
||||
CharCode code, int nBytes, const Unicode *u, int uLen)
|
||||
{
|
||||
GfxFont * font = state->getFont();
|
||||
if(!font) return;
|
||||
|
@ -39,7 +39,7 @@ public:
|
||||
virtual void drawChar(GfxState *state, double x, double y,
|
||||
double dx, double dy,
|
||||
double originX, double originY,
|
||||
CharCode code, int nBytes, Unicode *u, int uLen);
|
||||
CharCode code, int nBytes, const Unicode *u, int uLen);
|
||||
|
||||
// Start a page.
|
||||
// UGLY: These 2 versions are for different versions of poppler
|
||||
|
@ -407,8 +407,11 @@ int main(int argc, char **argv)
|
||||
param.tmp_dir.c_str());
|
||||
|
||||
bool finished = false;
|
||||
// read config file
|
||||
globalParams = new GlobalParams(!param.poppler_data_dir.empty() ? param.poppler_data_dir.c_str() : NULL);
|
||||
// read poppler config file
|
||||
globalParams = std::make_unique<GlobalParams>(
|
||||
!param.poppler_data_dir.empty() ? param.poppler_data_dir.c_str() : NULL
|
||||
);
|
||||
|
||||
// open PDF file
|
||||
PDFDoc * doc = nullptr;
|
||||
try
|
||||
@ -435,8 +438,11 @@ int main(int argc, char **argv)
|
||||
cerr << "Document has copy-protection bit set." << endl;
|
||||
}
|
||||
|
||||
param.first_page = min<int>(max<int>(param.first_page, 1), doc->getNumPages());
|
||||
param.last_page = min<int>(max<int>(param.last_page, param.first_page), doc->getNumPages());
|
||||
param.first_page =
|
||||
min<int>(max<int>(param.first_page, 1), doc->getNumPages());
|
||||
param.last_page =
|
||||
min<int>(max<int>(param.last_page, param.first_page),
|
||||
doc->getNumPages());
|
||||
|
||||
|
||||
unique_ptr<HTMLRenderer>(new HTMLRenderer(argv[0], param))->process(doc);
|
||||
@ -454,7 +460,7 @@ int main(int argc, char **argv)
|
||||
|
||||
// clean up
|
||||
delete doc;
|
||||
delete globalParams;
|
||||
globalParams.reset();
|
||||
|
||||
// check for memory leaks
|
||||
// Poppler Object class (Object.h) no longer has memCheck
|
||||
|
@ -55,7 +55,7 @@ Unicode unicode_from_font (CharCode code, GfxFont * font)
|
||||
return map_to_private(code);
|
||||
}
|
||||
|
||||
Unicode check_unicode(Unicode * u, int len, CharCode code, GfxFont * font)
|
||||
Unicode check_unicode(Unicode const * u, int len, CharCode code, GfxFont * font)
|
||||
{
|
||||
if(len == 0)
|
||||
return map_to_private(code);
|
||||
|
@ -83,7 +83,7 @@ Unicode unicode_from_font (CharCode code, GfxFont * font);
|
||||
* if we got multi-unicode values, it might be expanded ligature, try to restore it
|
||||
* if we cannot figure it out at the end, use a private mapping
|
||||
*/
|
||||
Unicode check_unicode(Unicode * u, int len, CharCode code, GfxFont * font);
|
||||
Unicode check_unicode(Unicode const * u, int len, CharCode code, GfxFont * font);
|
||||
|
||||
|
||||
} // namespace pdf2htmlEX
|
||||
|
Loading…
Reference in New Issue
Block a user