From 65c56c4ec1ca41d9fab84202af02ba32dde5e6df Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Sun, 5 Aug 2012 23:26:40 +0800 Subject: [PATCH] working on pixel accuracy --- src/HTMLRenderer.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/HTMLRenderer.cc b/src/HTMLRenderer.cc index 3cabd94..0e4aa18 100644 --- a/src/HTMLRenderer.cc +++ b/src/HTMLRenderer.cc @@ -107,9 +107,11 @@ function show_pages()\ var idx = 0;\ var f = function(){\ if (idx < pages.length) {\ + try{\ pages[idx].style.display='block';\ - ++idx;\ - setTimeout(f,100);\ + }catch(e){}\ + ++idx;\ + setTimeout(f,100);\ }\ };\ f();\ @@ -396,7 +398,7 @@ void HTMLRenderer::endString(GfxState *state) { html_fout << boost::format("
getY() << "px;" << "left:" << cur_string->getX() << "px;" - << "line-height:" << (cur_state->getFont()->getAscent() * cur_state->getFontSize()) << "px;" + << "top:" << (pageHeight - cur_string->getY() - cur_state->getFont()->getAscent() * cur_state->getFontSize()) << "px;" ; // letter & word spacing