File tree Expand file tree Collapse file tree
dependency-builder/src/main/cpp/packages Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- --- pdf2htmlEX.cc 2020-06-08 17:39:30.027000000 +0300
2- +++ pdf2htmlEX.cc 2020-06-08 17:55:56.809000000 +0300
3- @@ -406,14 +406,24 @@
1+ --- src/pdf2htmlEX.cc 2020-06-08 17:39:30.027000000 +0300
2+ +++ src/pdf2htmlEX.cc 2020-06-08 18:46:17.304000000 +0300
3+ @@ -25,6 +25,8 @@
4+
5+ #include "pdf2htmlEX-config.h"
6+
7+ + #include "poppler/ErrorCodes.h"
8+ +
9+ #if ENABLE_SVG
10+ #include <cairo.h>
11+ #endif
12+ @@ -406,14 +408,25 @@
413 }
514
615 if (!doc->isOk())
716- throw "Cannot read the file";
817+ {
918+ int errCode = doc->getErrorCode();
10- + std::cerr << std::to_string(errCode) << std::endl;
19+ + std::cerr << "Cannot read the file. " << std::to_string(errCode) << std::endl;
1120+ if (errCode == errEncrypted) {
1221+ return 2;
1322+ } else {
1827 // check for copy permission
1928 if (!doc->okToCopy())
2029 {
21- - if (param.no_drm == 0)
30+ + std::cerr << "Document has copy-protection bit set." << std::endl;
31+ if (param.no_drm == 0)
2232- throw "Copying of text from this document is not allowed.";
2333- cerr << "Document has copy-protection bit set." << endl;
24- + std::cerr << "Document has copy-protection bit set." << std::endl;
25- + if (param->no_drm == 0) {
34+ + {
2635+ std::cerr << "Copying of text from this document is not allowed." << std::endl;
2736+ return 3;
2837+ }
You can’t perform that action at this time.
0 commit comments