1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 13:00:08 +00:00

Merge pull request #75 from jahewson/master

Travis CI, etc.
This commit is contained in:
Lu Wang 2013-01-25 05:20:05 -08:00
commit 8c621e5c0d
6 changed files with 29 additions and 4 deletions

15
.travis.yml Normal file
View File

@ -0,0 +1,15 @@
language: cpp
compiler: gcc
before_install:
- sudo add-apt-repository ppa:coolwanglu/pdf2htmlex --yes
- sudo apt-get update -qq
- sudo apt-get install -qq libpoppler-dev libfontforge-dev libspiro-dev
before_script:
- cmake .
script:
- make
- sudo make install
- /usr/local/bin/pdf2htmlEX -v
branches:
only:
- master

View File

@ -51,7 +51,7 @@ else()
include_directories(${FONTFORGE_INCLUDE_DIRS})
# MacOSX gettext is in /opt/local/include - strange
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
find_path(GETTEXT_INCLUDE_PATH libintl.h)
find_path(GETTEXT_INCLUDE_PATH libintl.h HINTS "/usr/local/opt/gettext/include") # homebrew
if(GETTEXT_INCLUDE_PATH)
include_directories(${GETTEXT_INCLUDE_PATH})
else()

View File

@ -1,5 +1,7 @@
# pdf2htmlEX
[![Build Status](https://secure.travis-ci.org/coolwanglu/pdf2htmlEX.png)](http://travis-ci.org/coolwanglu/pdf2htmlEX)
A beautiful demo is worth a thousand words:
- [**Typography**](http://coolwanglu.github.com/pdf2htmlEX/demo/geneve.html) [Original](https://github.com/raphink/geneve_1564/raw/master/geneve_1564.pdf)

View File

@ -35,6 +35,9 @@ Specify owner password
.B -u, --user-password <password>
Specify user password
.TP
.B --no-drm <0|1> (Default: 0)
Override document DRM settings
.TP
.B --dest-dir <dir> (Default: .)
Specify destination folder
.TP

View File

@ -18,6 +18,7 @@ struct Param
// PDF stuff
std::string owner_password, user_password;
std::string input_filename, output_filename;
int no_drm;
// path
std::string dest_dir, tmp_dir, data_dir;

View File

@ -53,7 +53,7 @@ void show_version_and_exit(const char * dummy = nullptr)
cerr << "Libraries: ";
cerr << "poppler " << POPPLER_VERSION << ", ";
cerr << "libfontforge " << ffw_get_version() << endl;
exit(EXIT_FAILURE);
exit(EXIT_SUCCESS);
}
void parse_options (int argc, char **argv)
@ -64,6 +64,7 @@ void parse_options (int argc, char **argv)
.add("owner-password,o", &param.owner_password, "", "owner password (for encrypted files)", nullptr, true)
.add("user-password,u", &param.user_password, "", "user password (for encrypted files)", nullptr, true)
.add("no-drm", &param.no_drm, 0, "override document DRM settings")
.add("dest-dir", &param.dest_dir, ".", "specify destination directory")
.add("data-dir", &param.data_dir, PDF2HTMLEX_DATA_PATH, "specify data directory")
@ -192,8 +193,11 @@ int main(int argc, char **argv)
// check for copy permission
if (!doc->okToCopy()) {
if (param.no_drm == 0) {
throw "Copying of text from this document is not allowed.";
}
cerr << "Document has copy-protection bit set." << endl;
}
param.first_page = min<int>(max<int>(param.first_page, 1), doc->getNumPages());
param.last_page = min<int>(max<int>(param.last_page, param.first_page), doc->getNumPages());