1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-21 20:50:07 +00:00

rearrange files

This commit is contained in:
Lu Wang 2012-09-10 13:03:25 +08:00
parent 04293c1dbf
commit 236d3ff668
14 changed files with 40 additions and 61 deletions

View File

@ -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

2
TODO
View File

@ -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

View File

@ -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<string, string> 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<string, string> 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"},
});

View File

@ -1,26 +0,0 @@
/*
* Constants
*
* by WangLu
* 2012.08.07
*/
#ifndef CONSTS_H__
#define CONSTS_H__
#include <string>
#include <map>
#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<std::string, std::string> BASE_14_FONT_CSS_FONT_MAP;
extern const std::map<std::string, std::string> GB_ENCODED_FONT_NAME_MAP;
#endif //CONSTS_H__

View File

@ -1,5 +1,5 @@
/*
* Misc functions
* Constants & Misc functions
*
*
* by WangLu
@ -14,6 +14,8 @@
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <UTF8.h>
@ -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<std::string, std::string> BASE_14_FONT_CSS_FONT_MAP;
extern const std::map<std::string, std::string> GB_ENCODED_FONT_NAME_MAP;
// mute gcc warning of unused function
namespace
{

View File

@ -10,6 +10,7 @@
#include <string>
#include <limits>
#include <iostream>
#include <getopt.h>
#include <boost/program_options.hpp>

View File

@ -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<string, string> 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<string, string> 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)
{