From 548e7efbbcc8ed270fbfaac8de94e9b446877f69 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Fri, 10 Aug 2012 21:41:24 +0800 Subject: [PATCH] use tmp dir --- bin/pdf2htmlEX | 14 ++++++++++---- src/Consts.cc | 8 ++++++-- src/Consts.h | 6 ++++-- src/HTMLRenderer.cc | 6 +++--- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/bin/pdf2htmlEX b/bin/pdf2htmlEX index 8469cdc..a6e5682 100755 --- a/bin/pdf2htmlEX +++ b/bin/pdf2htmlEX @@ -1,6 +1,12 @@ #!/bin/bash set -e +TMPDIR=/tmp/pdf2htmlEX + +# prepare the temporary directory +test -d $TMPDIR || mkdir -p $TMPDIR +rm -f $TMPDIR/* 2>/dev/null + # Get directory of the script SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done @@ -8,13 +14,13 @@ SCRIPT_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"/ # Execute ${SCRIPT_DIR}/pdftohtmlEX $* -if [ -f convert.pe ]; then +if [ -f $TMPDIR/convert.pe ]; then echo -n "Converting fonts: " - fontforge -script convert.pe 2>/dev/null + fontforge -script $TMPDIR/convert.pe 2>/dev/null echo "." -# rm convert.pe fi -rm *.encoding 2>/dev/null +#clean +rm -f $TMPDIR/* 2>/dev/null echo "Done." diff --git a/src/Consts.cc b/src/Consts.cc index 87ee1cf..07abc62 100644 --- a/src/Consts.cc +++ b/src/Consts.cc @@ -9,7 +9,7 @@ const double EPS = 1e-6; -const char * HTML_HEAD = "\n\ +const std::string HTML_HEAD = "\n\ \ \