diff --git a/CMakeLists.txt b/CMakeLists.txt index 33d3cad..d769cf1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ project(pdftohtmlEX) cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR) -include_directories(${CMAKE_SOURCE_DIR}/src) +include_directories(${CMAKE_SOURCE_DIR}/src/include) find_package(PkgConfig) pkg_check_modules(POPPLER REQUIRED poppler>=0.20.0) @@ -56,7 +56,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++0x") #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb") -configure_file (${CMAKE_SOURCE_DIR}/src/config.h.in ${CMAKE_SOURCE_DIR}/src/config.h) +configure_file (${CMAKE_SOURCE_DIR}/src/include/pdf2htmlEX-config.h.in ${CMAKE_SOURCE_DIR}/src/include/pdf2htmlEX-config.h) add_executable(pdf2htmlEX src/pdf2htmlEX.cc diff --git a/TODO b/TODO index 09dea20..9a3eee1 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,7 @@ bug found in baidu & github +argument auto-completion + option for tounicode-map get unicode from charname using fontforge (test with 'Font' croc.pdf) also for CID Type 0 diff --git a/src/Consts.cc b/src/Consts.cc deleted file mode 100644 index ca651e2..0000000 --- a/src/Consts.cc +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Constants - * - * by WangLu - * 2012.08.10 - */ - -#include "Consts.h" - -using std::map; -using std::string; - - -const double id_matrix[6] = {1.0, 0.0, 0.0, 1.0, 0.0, 0.0}; - -const map BASE_14_FONT_CSS_FONT_MAP({ - { "Courier", "Courier,monospace" }, - { "Helvetica", "Helvetica,Arial,\"Nimbus Sans L\",sans-serif" }, - { "Times", "Times,\"Time New Roman\",\"Nimbus Roman No9 L\",serif" }, - { "Symbol", "Symbol,\"Standard Symbols L\"" }, - { "ZapfDingbats", "ZapfDingbats,\"Dingbats\"" }, -}); - -const map GB_ENCODED_FONT_NAME_MAP({ - {"\xCB\xCE\xCC\xE5", "SimSun"}, - {"\xBA\xDA\xCC\xE5", "SimHei"}, - {"\xBF\xAC\xCC\xE5_GB2312", "SimKai"}, - {"\xB7\xC2\xCB\xCE_GB2312", "SimFang"}, - {"\xC1\xA5\xCA\xE9", "SimLi"}, -}); - - diff --git a/src/Consts.h b/src/Consts.h deleted file mode 100644 index fe115c5..0000000 --- a/src/Consts.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Constants - * - * by WangLu - * 2012.08.07 - */ - -#ifndef CONSTS_H__ -#define CONSTS_H__ - -#include -#include - -#ifndef nullptr -#define nullptr (NULL) -#endif - -static const double EPS = 1e-6; -extern const double id_matrix[6]; - -static const double DEFAULT_DPI = 72.0; - -extern const std::map BASE_14_FONT_CSS_FONT_MAP; -extern const std::map GB_ENCODED_FONT_NAME_MAP; - -#endif //CONSTS_H__ diff --git a/src/ff/ff.c b/src/ff.c similarity index 100% rename from src/ff/ff.c rename to src/ff.c diff --git a/src/BackgroundRenderer.h b/src/include/BackgroundRenderer.h similarity index 100% rename from src/BackgroundRenderer.h rename to src/include/BackgroundRenderer.h diff --git a/src/FontPreprocessor.h b/src/include/FontPreprocessor.h similarity index 100% rename from src/FontPreprocessor.h rename to src/include/FontPreprocessor.h diff --git a/src/HTMLRenderer.h b/src/include/HTMLRenderer.h similarity index 100% rename from src/HTMLRenderer.h rename to src/include/HTMLRenderer.h diff --git a/src/Param.h b/src/include/Param.h similarity index 100% rename from src/Param.h rename to src/include/Param.h diff --git a/src/ff/ff.h b/src/include/ff.h similarity index 100% rename from src/ff/ff.h rename to src/include/ff.h diff --git a/src/config.h.in b/src/include/pdf2htmlEX-config.h.in similarity index 100% rename from src/config.h.in rename to src/include/pdf2htmlEX-config.h.in diff --git a/src/util.h b/src/include/util.h similarity index 93% rename from src/util.h rename to src/include/util.h index ca3985d..cce21a5 100644 --- a/src/util.h +++ b/src/include/util.h @@ -1,5 +1,5 @@ /* - * Misc functions + * Constants & Misc functions * * * by WangLu @@ -14,6 +14,8 @@ #include #include #include +#include +#include #include @@ -24,6 +26,18 @@ using std::ostream; using std::max; using std::abs; +#ifndef nullptr +#define nullptr (NULL) +#endif + +static const double EPS = 1e-6; +extern const double id_matrix[6]; + +static const double DEFAULT_DPI = 72.0; + +extern const std::map BASE_14_FONT_CSS_FONT_MAP; +extern const std::map GB_ENCODED_FONT_NAME_MAP; + // mute gcc warning of unused function namespace { diff --git a/src/pdf2htmlEX.cc b/src/pdf2htmlEX.cc index 0253609..2f48a98 100644 --- a/src/pdf2htmlEX.cc +++ b/src/pdf2htmlEX.cc @@ -10,6 +10,7 @@ #include #include #include +#include #include diff --git a/src/util.cc b/src/util.cc index 614390e..954a1da 100644 --- a/src/util.cc +++ b/src/util.cc @@ -21,6 +21,26 @@ using std::cerr; using std::endl; using std::string; +using std::map; + + +const double id_matrix[6] = {1.0, 0.0, 0.0, 1.0, 0.0, 0.0}; + +const map BASE_14_FONT_CSS_FONT_MAP({ + { "Courier", "Courier,monospace" }, + { "Helvetica", "Helvetica,Arial,\"Nimbus Sans L\",sans-serif" }, + { "Times", "Times,\"Time New Roman\",\"Nimbus Roman No9 L\",serif" }, + { "Symbol", "Symbol,\"Standard Symbols L\"" }, + { "ZapfDingbats", "ZapfDingbats,\"Dingbats\"" }, +}); + +const map GB_ENCODED_FONT_NAME_MAP({ + {"\xCB\xCE\xCC\xE5", "SimSun"}, + {"\xBA\xDA\xCC\xE5", "SimHei"}, + {"\xBF\xAC\xCC\xE5_GB2312", "SimKai"}, + {"\xB7\xC2\xCB\xCE_GB2312", "SimFang"}, + {"\xC1\xA5\xCA\xE9", "SimLi"}, +}); bool isLegalUnicode(Unicode u) {