pdf2htmlEX icon indicating copy to clipboard operation
pdf2htmlEX copied to clipboard

Could you supply a static builds of pdf2htmlEX?

Open TaoMasterCoder opened this issue 10 years ago • 7 comments

Pdf2hmtlEX is a very good tool. Could you give us a static builds of pdf2htmlEX like FFmped(http://johnvansickle.com/ffmpeg/) for it is the easiest way to running it in different linux release. In fact, I face this problem to install in in out redhat/centos and amazon linux.

Could you help us?

TaoMasterCoder avatar Aug 27 '15 07:08 TaoMasterCoder

I'd like to add this if anyone would like to maintain it.

coolwanglu avatar Sep 01 '15 08:09 coolwanglu

Could you add it first?

BRs Zhen

On 1 September 2015 at 16:45, Lu Wang [email protected] wrote:

I'd like to add this if anyone would like to maintain it.

— Reply to this email directly or view it on GitHub https://github.com/coolwanglu/pdf2htmlEX/issues/562#issuecomment-136638075 .

TaoMasterCoder avatar Sep 01 '15 10:09 TaoMasterCoder

I tried to make static builds for quite a long time. Until v0.11 it worked because an older version of fontforge could be used, where character conversions were done by internal functions. Since v0.12 newer fontforge versions are needed, which uses only glibc's iconv. And iconv dynamically loads the libraries of the encodings. So if you manage to build a static version of pdf2htmlEX and you want to run it, you get an error message like:

I can't figure out your version of iconv(). I need a name for the UCS-4 encoding and I can't find one. Reconfigure --without-iconv. Bye.

I didn't find a way, to get static builds work.

Teddytrombone avatar Sep 10 '15 11:09 Teddytrombone

I have succeed to compile a common builds(not a static builds) on Amazon Linux.

How can I make a static builds?

I would like to try to make a static builds when I'm free if you can share the detail methods with me.

BRs Zhen

On 10 September 2015 at 19:51, Teddytrombone [email protected] wrote:

I tried to make static builds for quite a long time. Until v0.11 it worked because an older version of fontforge could be used, where character conversions were done by internal functions. Since v0.12 newer fontforge versions are needed, which uses only glibc's iconv. And iconv dynamically loads the libraries of the encodings. So if you manage to build a static version of pdf2htmlEX and you want to run it, you get an error message like:

I can't figure out your version of iconv(). I need a name for the UCS-4 encoding and I can't find one. Reconfigure --without-iconv. Bye.

I didn't find a way, to get static builds work.

— Reply to this email directly or view it on GitHub https://github.com/coolwanglu/pdf2htmlEX/issues/562#issuecomment-139212369 .

TaoMasterCoder avatar Sep 11 '15 00:09 TaoMasterCoder

It's a little bit tricky. First of all you have to verify, that all dependencies are available as static libraries (fontforge, poppler, libjpeg, ...). As there is no built in possibility to make it static, you have to find out the linker call. For this you compile pdf2htmlEX as usual. When it's done, you remove only the generated pdf2htmlEX executable so it is relinked, when you call make again. Now you call make in Verbose mode: VERBOSE=1 make Now there should be a line starting with /usr/bin/c++ (depending on the linker you are using, but usually with gcc this should be the command). Now you take this line and add -static as extra parameter and every needed library added with -llibrary-name. You also have to find out the correct ordering of the libraries. For example my line was first

/usr/bin/c++    -Wall -std=c++0x -O2 -DNDEBUG    CMakeFiles/pdf2htmlEX.dir/3rdparty/poppler/git/CairoFontEngine.cc.o CMakeFiles/pdf2htmlEX.dir/3rdparty/poppler/git/CairoRescaleBox.cc.o CMakeFiles/pdf2htmlEX.dir/3rdparty/poppler/git/CairoOutputDev.cc.o CMakeFiles/pdf2htmlEX.dir/src/pdf2htmlEX.cc.o CMakeFiles/pdf2htmlEX.dir/src/HTMLRenderer/draw.cc.o CMakeFiles/pdf2htmlEX.dir/src/HTMLRenderer/general.cc.o CMakeFiles/pdf2htmlEX.dir/src/HTMLRenderer/image.cc.o CMakeFiles/pdf2htmlEX.dir/src/HTMLRenderer/font.cc.o CMakeFiles/pdf2htmlEX.dir/src/HTMLRenderer/form.cc.o CMakeFiles/pdf2htmlEX.dir/src/HTMLRenderer/link.cc.o CMakeFiles/pdf2htmlEX.dir/src/HTMLRenderer/outline.cc.o CMakeFiles/pdf2htmlEX.dir/src/HTMLRenderer/state.cc.o CMakeFiles/pdf2htmlEX.dir/src/HTMLRenderer/text.cc.o CMakeFiles/pdf2htmlEX.dir/src/BackgroundRenderer/BackgroundRenderer.cc.o CMakeFiles/pdf2htmlEX.dir/src/BackgroundRenderer/SplashBackgroundRenderer.cc.o CMakeFiles/pdf2htmlEX.dir/src/BackgroundRenderer/CairoBackgroundRenderer.cc.o CMakeFiles/pdf2htmlEX.dir/src/util/const.cc.o CMakeFiles/pdf2htmlEX.dir/src/util/encoding.cc.o CMakeFiles/pdf2htmlEX.dir/src/util/ffw.c.o CMakeFiles/pdf2htmlEX.dir/src/util/math.cc.o CMakeFiles/pdf2htmlEX.dir/src/util/misc.cc.o CMakeFiles/pdf2htmlEX.dir/src/util/path.cc.o CMakeFiles/pdf2htmlEX.dir/src/util/unicode.cc.o CMakeFiles/pdf2htmlEX.dir/src/util/mingw.cc.o CMakeFiles/pdf2htmlEX.dir/src/ArgParser.cc.o CMakeFiles/pdf2htmlEX.dir/src/Base64Stream.cc.o CMakeFiles/pdf2htmlEX.dir/src/Color.cc.o CMakeFiles/pdf2htmlEX.dir/src/CoveredTextDetector.cc.o CMakeFiles/pdf2htmlEX.dir/src/DrawingTracer.cc.o CMakeFiles/pdf2htmlEX.dir/src/HTMLTextLine.cc.o CMakeFiles/pdf2htmlEX.dir/src/HTMLTextPage.cc.o CMakeFiles/pdf2htmlEX.dir/src/Preprocessor.cc.o CMakeFiles/pdf2htmlEX.dir/src/StringFormatter.cc.o CMakeFiles/pdf2htmlEX.dir/src/TmpFiles.cc.o  -o pdf2htmlEX -rdynamic -L/usr/local/lib -lpoppler -lcairo -lfreetype -lfontforge -static -Wl,-rpath,/usr/local/lib:

Finally it was something like

/usr/bin/g++    -Wall -std=c++0x -O2 -DNDEBUG   CMakeFiles/pdf2htmlEX.dir/3rdparty/poppler/git/CairoFontEngine.cc.o CMakeFiles/pdf2htmlEX.dir/3rdparty/poppler/git/CairoRescaleBox.cc.o CMakeFiles/pdf2htmlEX.dir/3rdparty/poppler/git/CairoOutputDev.cc.o CMakeFiles/pdf2htmlEX.dir/src/pdf2htmlEX.cc.o CMakeFiles/pdf2htmlEX.dir/src/HTMLRenderer/draw.cc.o CMakeFiles/pdf2htmlEX.dir/src/HTMLRenderer/general.cc.o CMakeFiles/pdf2htmlEX.dir/src/HTMLRenderer/image.cc.o CMakeFiles/pdf2htmlEX.dir/src/HTMLRenderer/font.cc.o CMakeFiles/pdf2htmlEX.dir/src/HTMLRenderer/form.cc.o CMakeFiles/pdf2htmlEX.dir/src/HTMLRenderer/link.cc.o CMakeFiles/pdf2htmlEX.dir/src/HTMLRenderer/outline.cc.o CMakeFiles/pdf2htmlEX.dir/src/HTMLRenderer/state.cc.o CMakeFiles/pdf2htmlEX.dir/src/HTMLRenderer/text.cc.o CMakeFiles/pdf2htmlEX.dir/src/BackgroundRenderer/BackgroundRenderer.cc.o CMakeFiles/pdf2htmlEX.dir/src/BackgroundRenderer/SplashBackgroundRenderer.cc.o CMakeFiles/pdf2htmlEX.dir/src/BackgroundRenderer/CairoBackgroundRenderer.cc.o CMakeFiles/pdf2htmlEX.dir/src/util/const.cc.o CMakeFiles/pdf2htmlEX.dir/src/util/encoding.cc.o CMakeFiles/pdf2htmlEX.dir/src/util/ffw.c.o CMakeFiles/pdf2htmlEX.dir/src/util/math.cc.o CMakeFiles/pdf2htmlEX.dir/src/util/misc.cc.o CMakeFiles/pdf2htmlEX.dir/src/util/path.cc.o CMakeFiles/pdf2htmlEX.dir/src/util/unicode.cc.o CMakeFiles/pdf2htmlEX.dir/src/util/mingw.cc.o CMakeFiles/pdf2htmlEX.dir/src/ArgParser.cc.o CMakeFiles/pdf2htmlEX.dir/src/Base64Stream.cc.o CMakeFiles/pdf2htmlEX.dir/src/Color.cc.o CMakeFiles/pdf2htmlEX.dir/src/CoveredTextDetector.cc.o CMakeFiles/pdf2htmlEX.dir/src/DrawingTracer.cc.o CMakeFiles/pdf2htmlEX.dir/src/HTMLTextLine.cc.o CMakeFiles/pdf2htmlEX.dir/src/HTMLTextPage.cc.o CMakeFiles/pdf2htmlEX.dir/src/Preprocessor.cc.o CMakeFiles/pdf2htmlEX.dir/src/StringFormatter.cc.o CMakeFiles/pdf2htmlEX.dir/src/TmpFiles.cc.o  -o pdf2htmlEX -rdynamic -lpoppler -lcairo -lfreetype -lfontforge -llcms2 -lgunicode -lgutils -lz -lxml2 -lfontconfig -lopenjpeg -ljpeg -lpng -ltiff -lpixman-1 -lbz2 -lltdl -lgif -lreadline -luninameslist -lgio-2.0 -lgutils   -lglib-2.0 -lgobject-2.0 -lglib-2.0 -lgobject-2.0  -lpthread -lrt -lz -lfreetype -lexpat -ldl -lncurses -lgmodule-2.0 -lresolv -lffi -lglib-2.0  -static

And as I already mentioned: even if you manage to link it as static binary, I don't think it will succesfully convert a pdf because of the iconv issue in fontforge.

Teddytrombone avatar Sep 11 '15 07:09 Teddytrombone

anyone managed to do it successfully?

ardcore avatar Aug 31 '17 11:08 ardcore

Unfortunatly it's not possible anymore with the newer fontforge versions as of the mentioned iconv issue. But cou can make a dynamic linked build and ship all needed libraries and call the executable via your ld-linux.so. Or you could use tools like http://appimage.org/

Teddytrombone avatar Sep 04 '17 15:09 Teddytrombone