From 1bd2ff24bc275f504df5134ba040c420bb7802ae Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Mon, 17 Sep 2012 15:28:52 +0800 Subject: [PATCH] respect process-nontext --- src/HTMLRenderer/general.cc | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/src/HTMLRenderer/general.cc b/src/HTMLRenderer/general.cc index c3a6f16..beb7586 100644 --- a/src/HTMLRenderer/general.cc +++ b/src/HTMLRenderer/general.cc @@ -160,24 +160,29 @@ void HTMLRenderer::startPage(int pageNum, GfxState *state) html_fout << "
" << "
process_nontext) { - if(param->single_html) + html_fout << "background-image:url("; + { - auto path = str_fmt("%s/p%x.png", param->tmp_dir.c_str(), pageNum); - ifstream fin((char*)path, ifstream::binary); - if(!fin) - throw string("Cannot read background image ") + (char*)path; - html_fout << "'data:image/png;base64," << base64stream(fin) << "'"; - } - else - { - html_fout << str_fmt("p%x.png", pageNum); + if(param->single_html) + { + auto path = str_fmt("%s/p%x.png", param->tmp_dir.c_str(), pageNum); + ifstream fin((char*)path, ifstream::binary); + if(!fin) + throw string("Cannot read background image ") + (char*)path; + html_fout << "'data:image/png;base64," << base64stream(fin) << "'"; + } + else + { + html_fout << str_fmt("p%x.png", pageNum); + } } + + html_fout << ");background-position:0 0;background-size:" << pageWidth << "px " << pageHeight << "px;background-repeat:no-repeat;"; } - - html_fout << ");background-position:0 0;background-size:" << pageWidth << "px " << pageHeight << "px;background-repeat:no-repeat;\">"; + + html_fout << "\">"; html_fout << "";