diff --git a/src/pdf2htmlEX.cc b/src/pdf2htmlEX.cc index 8bec400..0c158c5 100644 --- a/src/pdf2htmlEX.cc +++ b/src/pdf2htmlEX.cc @@ -12,6 +12,8 @@ #include #include +#include + #include #include @@ -24,6 +26,7 @@ #include "HTMLRenderer/HTMLRenderer.h" #include "util/ArgParser.h" #include "util/path.h" +#include "util/ffw.h" using namespace std; using namespace pdf2htmlEX; @@ -33,10 +36,6 @@ ArgParser argparser; void show_usage_and_exit(const char * dummy = nullptr) { - cerr << "pdftohtmlEX version " << PDF2HTMLEX_VERSION << endl; - cerr << endl; - cerr << "Copyright 2012 Lu Wang " << endl; - cerr << endl; cerr << "Usage: pdf2htmlEX [Options] []" << endl; cerr << endl; cerr << "Options:" << endl; @@ -47,11 +46,21 @@ void show_usage_and_exit(const char * dummy = nullptr) exit(EXIT_FAILURE); } +void show_version_and_exit(const char * dummy = nullptr) +{ + cerr << "pdftohtmlEX version " << PDF2HTMLEX_VERSION << endl; + cerr << "Copyright 2012 Lu Wang " << endl; + cerr << "Libraries: "; + cerr << "poppler " << POPPLER_VERSION << ", "; + cerr << "libfontforge " << ffw_get_version() << endl; + exit(EXIT_FAILURE); +} + void parse_options (int argc, char **argv) { argparser .add("help,h", "show all options", &show_usage_and_exit) - .add("version,v", "show copyright and version info", &show_usage_and_exit) + .add("version,v", "show copyright and version info", &show_version_and_exit) .add("owner-password,o", ¶m.owner_password, "", "owner password (for encrypted files)", nullptr, true) .add("user-password,u", ¶m.user_password, "", "user password (for encrypted files)", nullptr, true) diff --git a/src/util/ffw.c b/src/util/ffw.c index d0e0858..7106235 100644 --- a/src/util/ffw.c +++ b/src/util/ffw.c @@ -400,3 +400,8 @@ void ffw_auto_hint(void) FVAutoHint(cur_fv); FVAutoInstr(cur_fv); } + +long ffw_get_version(void) +{ + return library_version_configuration.library_source_versiondate; +} \ No newline at end of file diff --git a/src/util/ffw.h b/src/util/ffw.h index d388677..bfcdacd 100644 --- a/src/util/ffw.h +++ b/src/util/ffw.h @@ -23,6 +23,7 @@ extern "C" { // global void ffw_init(int debug); void ffw_finalize(void); +long ffw_get_version(void); //////////////////////// // load & save