From a479f2fc1e382b810724ae6a7e80915c839a80d9 Mon Sep 17 00:00:00 2001 From: Teddytrombone Date: Wed, 27 Jan 2016 14:45:44 +0100 Subject: [PATCH] [BUGFIX] Add option to override poppler data dir (resolves #572) --- src/Param.h | 1 + src/pdf2htmlEX.cc | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Param.h b/src/Param.h index 84fa426..571fa28 100644 --- a/src/Param.h +++ b/src/Param.h @@ -75,6 +75,7 @@ struct Param // misc. int clean_tmp; std::string data_dir; + std::string poppler_data_dir; std::string tmp_dir; int debug; int proof; diff --git a/src/pdf2htmlEX.cc b/src/pdf2htmlEX.cc index b56e8e9..cf568b2 100644 --- a/src/pdf2htmlEX.cc +++ b/src/pdf2htmlEX.cc @@ -198,6 +198,7 @@ void parse_options (int argc, char **argv) .add("clean-tmp", ¶m.clean_tmp, 1, "remove temporary files after conversion") .add("tmp-dir", ¶m.tmp_dir, param.tmp_dir, "specify the location of temporary directory.") .add("data-dir", ¶m.data_dir, param.data_dir, "specify data directory") + .add("poppler-data-dir", ¶m.poppler_data_dir, param.poppler_data_dir, "specify poppler data directory") .add("debug", ¶m.debug, 0, "print debugging information") .add("proof", ¶m.proof, 0, "texts are drawn on both text layer and background for proof.") @@ -387,7 +388,7 @@ int main(int argc, char **argv) bool finished = false; // read config file - globalParams = new GlobalParams(); + globalParams = new GlobalParams(!param.poppler_data_dir.empty() ? param.poppler_data_dir.c_str() : NULL); // open PDF file PDFDoc * doc = nullptr; try