1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 13:00:08 +00:00

Merge branch 'devv' of github.com:coolwanglu/pdf2htmlEX into devv

This commit is contained in:
Lu Wang 2012-08-13 22:25:07 +08:00
commit 1a304c72c3
2 changed files with 20 additions and 17 deletions

View File

@ -36,7 +36,7 @@ const std::string HTML_HEAD = "<!DOCTYPE html>\n\
}\ }\
.l > .w {\ .l > .w {\
display:inline-block;\ display:inline-block;\
visibility:hidden;\ font-family: monospace;\
}\ }\
::selection{\ ::selection{\
background: rgba(168,209,255,0.5);\ background: rgba(168,209,255,0.5);\
@ -51,18 +51,18 @@ const std::string HTML_HEAD = "<!DOCTYPE html>\n\
<script type=\"text/javascript\">\ <script type=\"text/javascript\">\
function show_pages()\ function show_pages()\
{\ {\
var pages = document.getElementById('pdf-main').childNodes;\ var pages = document.getElementById('pdf-main').childNodes;\
var idx = 0;\ var idx = 0;\
var f = function(){\ var f = function(){\
if (idx < pages.length) {\ if (idx < pages.length) {\
try{\ try{\
pages[idx].style.display='block';\ pages[idx].style.display='block';\
}catch(e){}\ }catch(e){}\
++idx;\ ++idx;\
setTimeout(f,100);\ setTimeout(f,100);\
}\ }\
};\ };\
f();\ f();\
};\ };\
</script>\ </script>\
</head><body onload=\"show_pages();\"><div id=\"pdf-main\">"; </head><body onload=\"show_pages();\"><div id=\"pdf-main\">";

View File

@ -957,14 +957,17 @@ void HTMLRenderer::check_state_change(GfxState * state)
if(need_rescale_font) if(need_rescale_font)
{ {
draw_scale = std::sqrt(cur_ctm[2] * cur_ctm[2] + cur_ctm[3] * cur_ctm[3]); double new_draw_ctm[6];
memcpy(new_draw_ctm, cur_ctm, sizeof(new_draw_ctm));
draw_scale = std::sqrt(new_draw_ctm[2] * new_draw_ctm[2] + new_draw_ctm[3] * new_draw_ctm[3]);
double new_draw_font_size = cur_font_size; double new_draw_font_size = cur_font_size;
if(_is_positive(draw_scale)) if(_is_positive(draw_scale))
{ {
new_draw_font_size *= draw_scale; new_draw_font_size *= draw_scale;
for(int i = 0; i < 4; ++i) for(int i = 0; i < 4; ++i)
cur_ctm[i] /= draw_scale; new_draw_ctm[i] /= draw_scale;
} }
else else
{ {
@ -977,9 +980,9 @@ void HTMLRenderer::check_state_change(GfxState * state)
cur_fs_id = install_font_size(draw_font_size); cur_fs_id = install_font_size(draw_font_size);
close_line = true; close_line = true;
} }
if(!(_tm_equal(cur_ctm, draw_ctm))) if(!(_tm_equal(new_draw_ctm, draw_ctm)))
{ {
memcpy(draw_ctm, cur_ctm, sizeof(draw_ctm)); memcpy(draw_ctm, new_draw_ctm, sizeof(draw_ctm));
cur_tm_id = install_transform_matrix(draw_ctm); cur_tm_id = install_transform_matrix(draw_ctm);
close_line = true; close_line = true;
} }