1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-07-07 18:30:34 +00:00

merging code

This commit is contained in:
Lu Wang 2012-09-11 22:08:55 +08:00
parent 6579b54309
commit 3a5e776fa9
5 changed files with 7 additions and 10 deletions

View File

@ -11,7 +11,7 @@
/* for Chrome & Safari */ /* for Chrome & Safari */
-webkit-text-stroke-width:0.13px; -webkit-text-stroke-width:0.13px;
} }
.pw { .b {
border: 1px solid black; border: 1px solid black;
margin: 13px auto; margin: 13px auto;
overflow: hidden; overflow: hidden;

View File

@ -21,7 +21,7 @@ void HTMLRenderer::export_remote_font(const FontInfo & info, const string & suff
auto fn = str_fmt("f%llx%s", info.id, suffix.c_str()); auto fn = str_fmt("f%llx%s", info.id, suffix.c_str());
if(param->single_html) if(param->single_html)
{ {
allcss_fout << "'data:font/opentype;base64," << base64stream(ifstream(tmp_dir + "/" + (char*)fn, ifstream::binary)) << "'"; allcss_fout << "'data:font/" << fontfileformat << ";base64," << base64stream(ifstream(tmp_dir + "/" + (char*)fn, ifstream::binary)) << "'";
} }
else else
{ {

View File

@ -174,11 +174,8 @@ void HTMLRenderer::startPage(int pageNum, GfxState *state)
assert((!line_opened) && "Open line in startPage detected!"); assert((!line_opened) && "Open line in startPage detected!");
// Add by Hongliang Tian html_fout << "<div class=\"b\" style=\"width:" << pageWidth << "px;height:" << pageHeight << "px;\">"
// wrapper for page << "<div id=\"p" << pageNum << "\" class=\"p\" style=\"width:" << pageWidth << "px;height:" << pageHeight << "px;";
html_fout << "<div class=\"pw\" style=\"width:" << pageWidth << "px;height:" << pageHeight << "px;\">" << endl;
html_fout << "<div id=\"p" << pageNum << "\" class=\"p\" style=\"width:" << pageWidth << "px;height:" << pageHeight << "px;";
html_fout << "background-image:url("; html_fout << "background-image:url(";
@ -225,8 +222,7 @@ void HTMLRenderer::startPage(int pageNum, GfxState *state)
void HTMLRenderer::endPage() { void HTMLRenderer::endPage() {
close_line(); close_line();
// close page // close page
// Modified by Hongliang Tian html_fout << "</div>" << "</div>" << endl;
html_fout << "</div>" << endl << "</div>" << endl;
} }
void HTMLRenderer::process_single_html() void HTMLRenderer::process_single_html()

View File

@ -35,6 +35,7 @@
* *
* CSS classes * CSS classes
* *
* b - page Box
* p - Page * p - Page
* l - Line * l - Line
* _ - white space * _ - white space

View File

@ -76,7 +76,7 @@ void parse_options (int argc, char **argv)
.add("space-as-offset", &param.space_as_offset, 0, "treat space characters as offsets") .add("space-as-offset", &param.space_as_offset, 0, "treat space characters as offsets")
.add("font-suffix", &param.font_suffix, ".ttf", "suffix for extracted font files") .add("font-suffix", &param.font_suffix, ".ttf", "suffix for extracted font files")
.add("font-format", &param.font_format, "truetype", "format for extracted font files") .add("font-format", &param.font_format, "opentype", "format for extracted font files")
.add("debug", &param.debug, 0, "output debug information") .add("debug", &param.debug, 0, "output debug information")
.add("clean-tmp", &param.clean_tmp, 1, "clean temporary files after processing") .add("clean-tmp", &param.clean_tmp, 1, "clean temporary files after processing")