From c2827e22351a668cc050bcc4f370025f9ec3e681 Mon Sep 17 00:00:00 2001 From: Hongliang TIAN Date: Tue, 11 Sep 2012 21:04:55 +0800 Subject: [PATCH 1/2] Smooth scrolling --- share/all.css | 6 +++- share/neck.html | 37 ++------------------ share/tail.html | 68 ++++++++++++++++++++++++++++++++++++- src/HTMLRenderer/general.cc | 7 +++- 4 files changed, 81 insertions(+), 37 deletions(-) diff --git a/share/all.css b/share/all.css index fab7cd8..cc72132 100644 --- a/share/all.css +++ b/share/all.css @@ -11,9 +11,13 @@ /* for Chrome & Safari */ -webkit-text-stroke-width:0.13px; } +.pw { + border: 1px solid black; + margin: 13px auto; + overflow: hidden; +} .p { position:relative; - margin:13px auto; background-color:white; overflow:hidden; display:block; diff --git a/share/neck.html b/share/neck.html index fadb9ea..fb82bfa 100644 --- a/share/neck.html +++ b/share/neck.html @@ -1,38 +1,7 @@ - - +pdf2htmlEX + - - +
diff --git a/share/tail.html b/share/tail.html index 4624e30..5ef9d9c 100644 --- a/share/tail.html +++ b/share/tail.html @@ -1,5 +1,71 @@ - +
+ diff --git a/src/HTMLRenderer/general.cc b/src/HTMLRenderer/general.cc index 29ab895..265ef80 100644 --- a/src/HTMLRenderer/general.cc +++ b/src/HTMLRenderer/general.cc @@ -174,6 +174,10 @@ void HTMLRenderer::startPage(int pageNum, GfxState *state) assert((!line_opened) && "Open line in startPage detected!"); + // Add by Hongliang Tian + // wrapper for page + html_fout << "
" << endl; + html_fout << "
" << endl; + // Modified by Hongliang Tian + html_fout << "
" << endl << "
" << endl; } void HTMLRenderer::process_single_html() From 90d97e4df286ee7d633257590e3e72519116decc Mon Sep 17 00:00:00 2001 From: Hongliang TIAN Date: Tue, 11 Sep 2012 21:21:38 +0800 Subject: [PATCH 2/2] Silent Chrome warning by using MIME type font/opentype --- share/tail.html | 3 --- src/HTMLRenderer/export.cc | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/share/tail.html b/share/tail.html index 5ef9d9c..bb095dd 100644 --- a/share/tail.html +++ b/share/tail.html @@ -25,8 +25,6 @@ $(function() { // Selectively rendering of pages that are visible or will be visible function selectiveRender() { - console.debug('render'); - var first = 0, last = l - 1, H = $main.height(); @@ -36,7 +34,6 @@ $(function() { // Find the last visible page while(last >= 0 && !isPageVisible(last, H)) last--; - console.debug('visible from='+first+", to="+last); // Set invisible setVisibilities(first > 0 ? first-1 : first, last < l -1 ? last + 1 : last, true); diff --git a/src/HTMLRenderer/export.cc b/src/HTMLRenderer/export.cc index ed7af33..3ae631b 100644 --- a/src/HTMLRenderer/export.cc +++ b/src/HTMLRenderer/export.cc @@ -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()); if(param->single_html) { - allcss_fout << "'data:font/" << fontfileformat << ";base64," << base64stream(ifstream(tmp_dir + "/" + (char*)fn, ifstream::binary)) << "'"; + allcss_fout << "'data:font/opentype;base64," << base64stream(ifstream(tmp_dir + "/" + (char*)fn, ifstream::binary)) << "'"; } else {