1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-06-26 06:09:21 +00:00

effect is too bad with muliplier=1, change it back to 4 and use old scale behavior in order to bypass the firefox bug

This commit is contained in:
Lu Wang 2012-09-25 00:55:41 +08:00
parent 26a23e856d
commit 49a527759b
5 changed files with 8 additions and 4 deletions

2
TODO
View File

@ -1,3 +1,5 @@
merge sub/sup into one line
bug found in baidu(ubuntu...)
precise link dest

View File

@ -87,7 +87,7 @@ pdf2htmlEX would try to optimize the generated HTML file moving Text within this
.B --space-threshold <ratio> (Default: 1.0/6)
pdf2htmlEX would insert a whitespace character ' ' if the distance between two consecutive letters in the same line is wider than ratio * font_size.
.TP
.B --font-size-multiplier <ratio> (Default: 1.0)
.B --font-size-multiplier <ratio> (Default: 4.0)
Many web browsers limit the minimum font size, and many would round the given font size, which results in incorrect rendering.
Specify a ratio greater than 1 would resolve this issue, however it might freeze some browsers.

View File

@ -121,7 +121,7 @@ void HTMLRenderer::process(PDFDoc *doc)
}
}
doc->displayPage(this, i, scale_factor1 * DEFAULT_DPI, scale_factor1 * DEFAULT_DPI,
doc->displayPage(this, i, (param->zoom) * DEFAULT_DPI, (param->zoom) * DEFAULT_DPI,
0, true, false, false,
nullptr, nullptr, nullptr, nullptr);
@ -162,11 +162,13 @@ void HTMLRenderer::startPage(int pageNum, GfxState *state)
<< pageWidth << "px;height:"
<< pageHeight << "px;";
/*
{
auto prefixes = {"", "-ms-", "-moz-", "-webkit-", "-o-"};
for(auto iter = prefixes.begin(); iter != prefixes.end(); ++iter)
html_fout << *iter << "transform:scale(" << scale_factor2 << ");";
}
*/
if(param->process_nontext)
{

View File

@ -146,7 +146,7 @@ void HTMLRenderer::check_state_change(GfxState * state)
double new_draw_ctm[6];
memcpy(new_draw_ctm, cur_ctm, sizeof(new_draw_ctm));
double new_draw_scale = sqrt(new_draw_ctm[2] * new_draw_ctm[2] + new_draw_ctm[3] * new_draw_ctm[3]);
double new_draw_scale = scale_factor2 * 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;
if(_is_positive(new_draw_scale))

View File

@ -73,7 +73,7 @@ void parse_options (int argc, char **argv)
.add("heps", &param.h_eps, 1.0, "max tolerated horizontal offset (in pixels)")
.add("veps", &param.v_eps, 1.0, "max tolerated vertical offset (in pixels)")
.add("space-threshold", &param.space_threshold, (1.0/8), "distance no thiner than (threshold * em) will be considered as a space character")
.add("font-size-multiplier", &param.font_size_multiplier, 1.0, "setting a value greater than 1 would increase the rendering accuracy")
.add("font-size-multiplier", &param.font_size_multiplier, 4.0, "setting a value greater than 1 would increase the rendering accuracy")
.add("auto-hint", &param.auto_hint, 0, "Whether to generate hints for fonts")
.add("tounicode", &param.tounicode, 0, "Specify how to deal with ToUnicode map, 0 for auto, 1 for forced, -1 for disabled")
.add("space-as-offset", &param.space_as_offset, 0, "treat space characters as offsets")