1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-07-03 00:35:40 +00:00

generate 'none' for id_matrix

This commit is contained in:
Lu Wang 2012-09-22 20:56:53 +08:00
parent d1a5f8a3fe
commit ead9f06281
2 changed files with 22 additions and 10 deletions

View File

@ -1,5 +1,8 @@
/* Base CSS */
/* by Wang Lu */
body {
position:relative;
}
#pdf-main {
position:absolute;
top:0;

View File

@ -97,18 +97,27 @@ void HTMLRenderer::export_transform_matrix (long long tm_id, const double * tm)
// we have already shifted the origin
// TODO: recognize common matices
auto prefixes = {"", "-ms-", "-moz-", "-webkit-", "-o-"};
for(auto iter = prefixes.begin(); iter != prefixes.end(); ++iter)
if(_tm_euqal(tm, id_matrix, 4))
{
const auto & prefix = *iter;
// PDF use a different coordinate system from Web
css_fout << prefix << "transform:matrix("
<< _round(tm[0]) << ','
<< _round(-tm[1]) << ','
<< _round(-tm[2]) << ','
<< _round(tm[3]) << ',';
auto prefixes = {"", "-ms-", "-moz-", "-webkit-", "-o-"};
for(auto iter = prefixes.begin(); iter != prefixes.end(); ++iter)
css_fout << prefix << "transform:none;";
}
else
{
auto prefixes = {"", "-ms-", "-moz-", "-webkit-", "-o-"};
for(auto iter = prefixes.begin(); iter != prefixes.end(); ++iter)
{
const auto & prefix = *iter;
// PDF use a different coordinate system from Web
css_fout << prefix << "transform:matrix("
<< _round(tm[0]) << ','
<< _round(-tm[1]) << ','
<< _round(-tm[2]) << ','
<< _round(tm[3]) << ',';
css_fout << "0,0);";
css_fout << "0,0);";
}
}
css_fout << "}" << endl;
}