Skip to content

Commit 2041c5d

Browse files
committed
Merge pull request coolwanglu#609 from Teddytrombone/master
[BUGFIX] Add option to override poppler data dir (resolves coolwanglu#572)
2 parents ce0fa97 + a479f2f commit 2041c5d

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

src/Param.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ struct Param
7575
// misc.
7676
int clean_tmp;
7777
std::string data_dir;
78+
std::string poppler_data_dir;
7879
std::string tmp_dir;
7980
int debug;
8081
int proof;

src/pdf2htmlEX.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ void parse_options (int argc, char **argv)
198198
.add("clean-tmp", &param.clean_tmp, 1, "remove temporary files after conversion")
199199
.add("tmp-dir", &param.tmp_dir, param.tmp_dir, "specify the location of temporary directory.")
200200
.add("data-dir", &param.data_dir, param.data_dir, "specify data directory")
201+
.add("poppler-data-dir", &param.poppler_data_dir, param.poppler_data_dir, "specify poppler data directory")
201202
.add("debug", &param.debug, 0, "print debugging information")
202203
.add("proof", &param.proof, 0, "texts are drawn on both text layer and background for proof.")
203204

@@ -387,7 +388,7 @@ int main(int argc, char **argv)
387388

388389
bool finished = false;
389390
// read config file
390-
globalParams = new GlobalParams();
391+
globalParams = new GlobalParams(!param.poppler_data_dir.empty() ? param.poppler_data_dir.c_str() : NULL);
391392
// open PDF file
392393
PDFDoc * doc = nullptr;
393394
try

0 commit comments

Comments
 (0)