mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-12-22 13:00:08 +00:00
move data files to share/
This commit is contained in:
parent
1ac1780696
commit
e621ae6716
@ -39,5 +39,5 @@ add_executable(pdf2htmlEX
|
|||||||
target_link_libraries(pdf2htmlEX poppler boost_program_options boost_filesystem boost_system)
|
target_link_libraries(pdf2htmlEX poppler boost_program_options boost_filesystem boost_system)
|
||||||
|
|
||||||
install (TARGETS pdf2htmlEX DESTINATION bin)
|
install (TARGETS pdf2htmlEX DESTINATION bin)
|
||||||
file (GLOB libfiles lib/*)
|
file (GLOB datafiles share/*)
|
||||||
install (FILES ${libfiles} DESTINATION lib/pdf2htmlEX)
|
install (FILES ${datafiles} DESTINATION share/pdf2htmlEX)
|
||||||
|
@ -112,19 +112,19 @@ void HTMLRenderer::pre_process()
|
|||||||
html_fout.open(dest_dir / param->output_filename, ofstream::binary);
|
html_fout.open(dest_dir / param->output_filename, ofstream::binary);
|
||||||
allcss_fout.open(dest_dir / CSS_FILENAME, ofstream::binary);
|
allcss_fout.open(dest_dir / CSS_FILENAME, ofstream::binary);
|
||||||
|
|
||||||
html_fout << ifstream(PDF2HTMLEX_LIB_PATH / HEAD_HTML_FILENAME, ifstream::binary).rdbuf();
|
html_fout << ifstream(PDF2HTMLEX_DATA_PATH / HEAD_HTML_FILENAME, ifstream::binary).rdbuf();
|
||||||
html_fout << "<link rel=\"stylesheet\" type=\"text/css\" href=\"" << CSS_FILENAME << "\"/>" << endl;
|
html_fout << "<link rel=\"stylesheet\" type=\"text/css\" href=\"" << CSS_FILENAME << "\"/>" << endl;
|
||||||
html_fout << ifstream(PDF2HTMLEX_LIB_PATH / NECK_HTML_FILENAME, ifstream::binary).rdbuf();
|
html_fout << ifstream(PDF2HTMLEX_DATA_PATH / NECK_HTML_FILENAME, ifstream::binary).rdbuf();
|
||||||
}
|
}
|
||||||
|
|
||||||
allcss_fout << ifstream(PDF2HTMLEX_LIB_PATH / CSS_FILENAME, ifstream::binary).rdbuf();
|
allcss_fout << ifstream(PDF2HTMLEX_DATA_PATH / CSS_FILENAME, ifstream::binary).rdbuf();
|
||||||
}
|
}
|
||||||
|
|
||||||
void HTMLRenderer::post_process()
|
void HTMLRenderer::post_process()
|
||||||
{
|
{
|
||||||
if(!param->single_html)
|
if(!param->single_html)
|
||||||
{
|
{
|
||||||
html_fout << ifstream(PDF2HTMLEX_LIB_PATH / TAIL_HTML_FILENAME, ifstream::binary).rdbuf();
|
html_fout << ifstream(PDF2HTMLEX_DATA_PATH / TAIL_HTML_FILENAME, ifstream::binary).rdbuf();
|
||||||
}
|
}
|
||||||
|
|
||||||
html_fout.close();
|
html_fout.close();
|
||||||
@ -195,17 +195,17 @@ void HTMLRenderer::process_single_html()
|
|||||||
{
|
{
|
||||||
ofstream out (dest_dir / param->output_filename, ofstream::binary);
|
ofstream out (dest_dir / param->output_filename, ofstream::binary);
|
||||||
|
|
||||||
out << ifstream(PDF2HTMLEX_LIB_PATH / HEAD_HTML_FILENAME , ifstream::binary).rdbuf();
|
out << ifstream(PDF2HTMLEX_DATA_PATH / HEAD_HTML_FILENAME , ifstream::binary).rdbuf();
|
||||||
|
|
||||||
out << "<style type=\"text/css\">" << endl;
|
out << "<style type=\"text/css\">" << endl;
|
||||||
out << ifstream(tmp_dir / CSS_FILENAME, ifstream::binary).rdbuf();
|
out << ifstream(tmp_dir / CSS_FILENAME, ifstream::binary).rdbuf();
|
||||||
out << "</style>" << endl;
|
out << "</style>" << endl;
|
||||||
|
|
||||||
out << ifstream(PDF2HTMLEX_LIB_PATH / NECK_HTML_FILENAME, ifstream::binary).rdbuf();
|
out << ifstream(PDF2HTMLEX_DATA_PATH / NECK_HTML_FILENAME, ifstream::binary).rdbuf();
|
||||||
|
|
||||||
out << ifstream(tmp_dir / (param->output_filename + ".part"), ifstream::binary).rdbuf();
|
out << ifstream(tmp_dir / (param->output_filename + ".part"), ifstream::binary).rdbuf();
|
||||||
|
|
||||||
out << ifstream(PDF2HTMLEX_LIB_PATH / TAIL_HTML_FILENAME, ifstream::binary).rdbuf();
|
out << ifstream(PDF2HTMLEX_DATA_PATH / TAIL_HTML_FILENAME, ifstream::binary).rdbuf();
|
||||||
}
|
}
|
||||||
|
|
||||||
void HTMLRenderer::add_tmp_file(const string & fn)
|
void HTMLRenderer::add_tmp_file(const string & fn)
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
static const std::string PDF2HTMLEX_VERSION = "@PDF2HTMLEX_VERSION@";
|
static const std::string PDF2HTMLEX_VERSION = "@PDF2HTMLEX_VERSION@";
|
||||||
static const std::string PDF2HTMLEX_PREFIX = "@CMAKE_INSTALL_PREFIX@";
|
static const std::string PDF2HTMLEX_PREFIX = "@CMAKE_INSTALL_PREFIX@";
|
||||||
static const boost::filesystem::path PDF2HTMLEX_LIB_PATH = boost::filesystem::path(PDF2HTMLEX_PREFIX) / "lib" / "pdf2htmlEX";
|
static const boost::filesystem::path PDF2HTMLEX_DATA_PATH = boost::filesystem::path(PDF2HTMLEX_PREFIX) / "share" / "pdf2htmlEX";
|
||||||
|
|
||||||
|
|
||||||
#endif //CONFIG_H__
|
#endif //CONFIG_H__
|
||||||
|
@ -172,7 +172,7 @@ int main(int argc, char **argv)
|
|||||||
//prepare the directories
|
//prepare the directories
|
||||||
for(const auto & p : {param.dest_dir, param.tmp_dir})
|
for(const auto & p : {param.dest_dir, param.tmp_dir})
|
||||||
{
|
{
|
||||||
if(equivalent(PDF2HTMLEX_LIB_PATH, p))
|
if(equivalent(PDF2HTMLEX_DATA_PATH, p))
|
||||||
{
|
{
|
||||||
cerr << "The specified directory \"" << p << "\" is the library path for pdf2htmlEX. Please use another one." << endl;
|
cerr << "The specified directory \"" << p << "\" is the library path for pdf2htmlEX. Please use another one." << endl;
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user