mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-12-22 13:00:08 +00:00
enhanced version information
This commit is contained in:
parent
d274d4f6c8
commit
b1dc3eb11a
@ -12,6 +12,8 @@
|
||||
#include <iostream>
|
||||
#include <getopt.h>
|
||||
|
||||
#include <poppler-config.h>
|
||||
|
||||
#include <goo/GooString.h>
|
||||
|
||||
#include <Object.h>
|
||||
@ -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;
|
||||
@ -31,11 +34,17 @@ using namespace pdf2htmlEX;
|
||||
Param param;
|
||||
ArgParser argparser;
|
||||
|
||||
void show_usage_and_exit(const char * dummy = nullptr)
|
||||
void show_version()
|
||||
{
|
||||
cerr << "pdftohtmlEX version " << PDF2HTMLEX_VERSION << endl;
|
||||
cerr << "pdftohtmlEX version " << PDF2HTMLEX_VERSION;
|
||||
cerr << " (poppler " << POPPLER_VERSION;
|
||||
cerr << ", libfontforge " << ffw_get_version() << ")";
|
||||
cerr << endl;
|
||||
cerr << "Copyright 2012 Lu Wang <coolwanglu@gmail.com>" << endl;
|
||||
}
|
||||
|
||||
void show_usage()
|
||||
{
|
||||
cerr << endl;
|
||||
cerr << "Usage: pdf2htmlEX [Options] <input.pdf> [<output.html>]" << endl;
|
||||
cerr << endl;
|
||||
@ -47,11 +56,24 @@ void show_usage_and_exit(const char * dummy = nullptr)
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
void show_usage_and_exit(const char * dummy = nullptr)
|
||||
{
|
||||
show_version();
|
||||
show_usage();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
void show_version_and_exit(const char * dummy = nullptr)
|
||||
{
|
||||
show_version();
|
||||
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)
|
||||
|
@ -400,3 +400,10 @@ void ffw_auto_hint(void)
|
||||
FVAutoHint(cur_fv);
|
||||
FVAutoInstr(cur_fv);
|
||||
}
|
||||
|
||||
char* ffw_get_version(void)
|
||||
{
|
||||
char* str = (char*)malloc(sizeof(char) * 20);
|
||||
printf("%d", library_version_configuration.library_source_versiondate);
|
||||
return str;
|
||||
}
|
@ -23,6 +23,7 @@ extern "C" {
|
||||
// global
|
||||
void ffw_init(int debug);
|
||||
void ffw_finalize(void);
|
||||
char* ffw_get_version(void);
|
||||
|
||||
////////////////////////
|
||||
// load & save
|
||||
|
Loading…
Reference in New Issue
Block a user