mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-12-22 13:00:08 +00:00
commit
8c621e5c0d
15
.travis.yml
Normal file
15
.travis.yml
Normal 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
|
@ -51,7 +51,7 @@ else()
|
|||||||
include_directories(${FONTFORGE_INCLUDE_DIRS})
|
include_directories(${FONTFORGE_INCLUDE_DIRS})
|
||||||
# MacOSX gettext is in /opt/local/include - strange
|
# MacOSX gettext is in /opt/local/include - strange
|
||||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
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)
|
if(GETTEXT_INCLUDE_PATH)
|
||||||
include_directories(${GETTEXT_INCLUDE_PATH})
|
include_directories(${GETTEXT_INCLUDE_PATH})
|
||||||
else()
|
else()
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
# pdf2htmlEX
|
# 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:
|
A beautiful demo is worth a thousand words:
|
||||||
|
|
||||||
|
@ -35,6 +35,9 @@ Specify owner password
|
|||||||
.B -u, --user-password <password>
|
.B -u, --user-password <password>
|
||||||
Specify user password
|
Specify user password
|
||||||
.TP
|
.TP
|
||||||
|
.B --no-drm <0|1> (Default: 0)
|
||||||
|
Override document DRM settings
|
||||||
|
.TP
|
||||||
.B --dest-dir <dir> (Default: .)
|
.B --dest-dir <dir> (Default: .)
|
||||||
Specify destination folder
|
Specify destination folder
|
||||||
.TP
|
.TP
|
||||||
|
@ -18,6 +18,7 @@ struct Param
|
|||||||
// PDF stuff
|
// PDF stuff
|
||||||
std::string owner_password, user_password;
|
std::string owner_password, user_password;
|
||||||
std::string input_filename, output_filename;
|
std::string input_filename, output_filename;
|
||||||
|
int no_drm;
|
||||||
|
|
||||||
// path
|
// path
|
||||||
std::string dest_dir, tmp_dir, data_dir;
|
std::string dest_dir, tmp_dir, data_dir;
|
||||||
|
@ -53,7 +53,7 @@ void show_version_and_exit(const char * dummy = nullptr)
|
|||||||
cerr << "Libraries: ";
|
cerr << "Libraries: ";
|
||||||
cerr << "poppler " << POPPLER_VERSION << ", ";
|
cerr << "poppler " << POPPLER_VERSION << ", ";
|
||||||
cerr << "libfontforge " << ffw_get_version() << endl;
|
cerr << "libfontforge " << ffw_get_version() << endl;
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void parse_options (int argc, char **argv)
|
void parse_options (int argc, char **argv)
|
||||||
@ -64,6 +64,7 @@ void parse_options (int argc, char **argv)
|
|||||||
|
|
||||||
.add("owner-password,o", ¶m.owner_password, "", "owner password (for encrypted files)", nullptr, true)
|
.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)
|
.add("user-password,u", ¶m.user_password, "", "user password (for encrypted files)", nullptr, true)
|
||||||
|
.add("no-drm", ¶m.no_drm, 0, "override document DRM settings")
|
||||||
|
|
||||||
.add("dest-dir", ¶m.dest_dir, ".", "specify destination directory")
|
.add("dest-dir", ¶m.dest_dir, ".", "specify destination directory")
|
||||||
.add("data-dir", ¶m.data_dir, PDF2HTMLEX_DATA_PATH, "specify data directory")
|
.add("data-dir", ¶m.data_dir, PDF2HTMLEX_DATA_PATH, "specify data directory")
|
||||||
@ -192,7 +193,10 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
// check for copy permission
|
// check for copy permission
|
||||||
if (!doc->okToCopy()) {
|
if (!doc->okToCopy()) {
|
||||||
throw "Copying of text from this document is not allowed.";
|
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.first_page = min<int>(max<int>(param.first_page, 1), doc->getNumPages());
|
||||||
|
Loading…
Reference in New Issue
Block a user