mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-12-22 04:50:09 +00:00
install default values after css file is opened; don't ignore default values, as it could be nested span
This commit is contained in:
parent
fb449223dd
commit
a17cb3c0e9
@ -25,18 +25,6 @@ HTMLRenderer::HTMLRenderer(const Param * param)
|
||||
,dest_dir(param->dest_dir)
|
||||
,tmp_dir(param->tmp_dir)
|
||||
{
|
||||
// install default font & size
|
||||
install_font(nullptr);
|
||||
install_font_size(0);
|
||||
|
||||
install_transform_matrix(id_matrix);
|
||||
|
||||
install_letter_space(0);
|
||||
install_word_space(0);
|
||||
|
||||
GfxRGB black;
|
||||
black.r = black.g = black.b = 0;
|
||||
install_color(&black);
|
||||
}
|
||||
|
||||
HTMLRenderer::~HTMLRenderer()
|
||||
@ -118,6 +106,19 @@ void HTMLRenderer::pre_process()
|
||||
}
|
||||
|
||||
allcss_fout << ifstream(PDF2HTMLEX_DATA_PATH / CSS_FILENAME, ifstream::binary).rdbuf();
|
||||
|
||||
// install default values
|
||||
install_font(nullptr);
|
||||
install_font_size(0);
|
||||
|
||||
install_transform_matrix(id_matrix);
|
||||
|
||||
install_letter_space(0);
|
||||
install_word_space(0);
|
||||
|
||||
GfxRGB black;
|
||||
black.r = black.g = black.b = 0;
|
||||
install_color(&black);
|
||||
}
|
||||
|
||||
void HTMLRenderer::post_process()
|
||||
|
@ -363,24 +363,14 @@ void HTMLRenderer::prepare_line(GfxState * state)
|
||||
% (pageHeight - y - state->getFont()->getAscent() * draw_font_size)
|
||||
% x;
|
||||
|
||||
// "t0" is the id_matrix
|
||||
if(cur_tm_id != 0)
|
||||
html_fout << format("t%|1$x| ") % cur_tm_id;
|
||||
|
||||
html_fout << format("f%|1$x| s%|2$x| ") % cur_fn_id % cur_fs_id;
|
||||
html_fout << format("t%|1$x| f%|2$x| s%|3$x| ") % cur_tm_id % cur_fn_id % cur_fs_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(false && "Bad value of new_line_status");
|
||||
}
|
||||
|
||||
html_fout << format("c%|1$x|") % cur_color_id;
|
||||
|
||||
if(cur_ls_id != 0)
|
||||
html_fout << format(" l%|1$x|") % cur_ls_id;
|
||||
|
||||
if(cur_ws_id != 0)
|
||||
html_fout << format(" w%|1$x|") % cur_ws_id;
|
||||
html_fout << format("c%|1$x| l%|2$x| w%|3$x|") % cur_color_id % cur_ls_id % cur_ws_id;
|
||||
|
||||
html_fout << "\">";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user