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

enable shift-left again, bug fixed

This commit is contained in:
Lu Wang 2012-08-16 14:00:30 +08:00
parent b68b421578
commit 820c37607e
3 changed files with 11 additions and 9 deletions

View File

@ -98,6 +98,7 @@ void HTMLRenderer::export_transform_matrix (long long tm_id, const double * tm)
{
allcss_fout << format(".t%|1$x|{") % tm_id;
// TODO: recognize common matices
if(_tm_equal(tm, id_matrix))
{
@ -114,10 +115,14 @@ void HTMLRenderer::export_transform_matrix (long long tm_id, const double * tm)
<< -tm[2] << ','
<< tm[3] << ',';
// we have already shifted the origin
allcss_fout << "0,0);";
/*
if(prefix == "-moz-")
allcss_fout << format("%1%px,%2%px);") % tm[4] % -tm[5];
else
allcss_fout << format("%1%,%2%);") % tm[4] % -tm[5];
*/
}
}
allcss_fout << "}" << endl;

View File

@ -133,7 +133,9 @@ void HTMLRenderer::check_state_change(GfxState * state)
new_ctm[1] = (m1[1] * m2[0] + m1[3] * m2[1]) * hori_scale;
new_ctm[2] = m1[0] * m2[2] + m1[2] * m2[3];
new_ctm[3] = m1[1] * m2[2] + m1[3] * m2[3];
new_ctm[4] = new_ctm[5] = 0;
new_ctm[4] = m1[0] * m2[4] + m1[2] * m2[5] + m1[4];
new_ctm[5] = m1[1] * m2[4] + m1[3] * m2[5] + m1[5];
//new_ctm[4] = new_ctm[5] = 0;
if(!_tm_equal(new_ctm, cur_ctm))
{

View File

@ -172,14 +172,10 @@ void HTMLRenderer::drawString(GfxState * state, GooString * s)
}
else
{
close_cur_line();
/*
// TODO bug
// shift left
// TODO, create a class for this
html_fout << format("<span style=\"margin-left:%1%px\"></span>") % target;
draw_tx += target / draw_scale;
*/
}
}
@ -214,14 +210,13 @@ void HTMLRenderer::drawString(GfxState * state, GooString * s)
}
//debug
if(0)
{
#if 0
#if 1
html_fout << "\"";
double x,y;
state->transform(state->getCurX(), state->getCurY(), &x, &y);
html_fout << format("data-lx=\"%5%\" data-ly=\"%6%\" data-drawscale=\"%4%\" data-x=\"%1%\" data-y=\"%2%\" data-hs=\"%3%")
%x%y%(state->getHorizScaling())%draw_scale%state->getLineX()%state->getLineY();
html_fout << format("data-lx=\"%5%\" data-ly=\"%6%\" data-draw-x=\"%7%\" data-draw-y=\"%8%\" data-drawscale=\"%4%\" data-x=\"%1%\" data-y=\"%2%\" data-hs=\"%3%")
%x%y%(state->getHorizScaling())%draw_scale%state->getLineX()%state->getLineY()%draw_tx%draw_ty;
#endif
}