1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 04:50:09 +00:00

fix matrix

This commit is contained in:
Lu Wang 2013-02-05 20:37:05 +08:00
parent 8e24776124
commit 9d88b7be1d
5 changed files with 14 additions and 12 deletions

1
TODO
View File

@ -1,3 +1,4 @@
optimize font_size & transform matrix tracking
c++ classes for different states c++ classes for different states
== Future: == == Future: ==

View File

@ -277,7 +277,6 @@ class HTMLRenderer : public OutputDev
double cur_font_size; double cur_font_size;
// transform matrix // transform matrix
long long cur_ttm_id;
bool ctm_changed; bool ctm_changed;
bool text_mat_changed; bool text_mat_changed;
// horizontal scaling // horizontal scaling

View File

@ -27,7 +27,7 @@ using std::endl;
void HTMLRenderer::TextLineBuffer::reset(GfxState * state) void HTMLRenderer::TextLineBuffer::reset(GfxState * state)
{ {
state->transform(state->getCurX(), state->getCurY(), &x, &y); state->transform(state->getCurX(), state->getCurY(), &x, &y);
tm_id = renderer->cur_ttm_id; tm_id = renderer->transform_matrix_manager.get_id();
} }
void HTMLRenderer::TextLineBuffer::append_unicodes(const Unicode * u, int l) void HTMLRenderer::TextLineBuffer::append_unicodes(const Unicode * u, int l)

View File

@ -341,13 +341,14 @@ void HTMLRenderer::pre_process(PDFDoc * doc)
void HTMLRenderer::post_process() void HTMLRenderer::post_process()
{ {
// dump css // dump css
font_size_manager .dump_css(f_css.fs); font_size_manager .dump_css(f_css.fs);
letter_space_manager.dump_css(f_css.fs); letter_space_manager .dump_css(f_css.fs);
word_space_manager .dump_css(f_css.fs); word_space_manager .dump_css(f_css.fs);
rise_manager .dump_css(f_css.fs); rise_manager .dump_css(f_css.fs);
whitespace_manager .dump_css(f_css.fs); whitespace_manager .dump_css(f_css.fs);
height_manager .dump_css(f_css.fs); height_manager .dump_css(f_css.fs);
left_manager .dump_css(f_css.fs); left_manager .dump_css(f_css.fs);
transform_matrix_manager.dump_css(f_css.fs);
// close files // close files
f_outline.fs.close(); f_outline.fs.close();

View File

@ -115,12 +115,13 @@ void HTMLRenderer::reset_state()
cur_stroke_color_id = install_stroke_color(&cur_stroke_color); cur_stroke_color_id = install_stroke_color(&cur_stroke_color);
cur_has_stroke = false; cur_has_stroke = false;
rise_manager .reset(); rise_manager .reset();
height_manager.reset(); height_manager .reset();
transform_matrix_manager.reset();
// no need to reset whitespace or left // no need to reset whitespace or left
cur_tx = cur_ty = 0; cur_tx = cur_ty = 0;
draw_tx = draw_ty = 0; draw_tx = draw_ty = 0;
reset_state_change(); reset_state_change();