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

don't write double in scientific notation

This commit is contained in:
Lu Wang 2012-08-21 22:22:56 +02:00
parent 62d29db121
commit e9f48e7480
2 changed files with 18 additions and 21 deletions

View File

@ -102,29 +102,22 @@ void HTMLRenderer::export_transform_matrix (long long tm_id, const double * tm)
// we have already shifted the origin
// TODO: recognize common matices
if(_tm_equal(tm, id_matrix, 4))
for(const string & prefix : {"", "-ms-", "-moz-", "-webkit-", "-o-"})
{
// no need to output anything
}
else
{
for(const string & prefix : {"", "-ms-", "-moz-", "-webkit-", "-o-"})
{
// PDF use a different coordinate system from Web
allcss_fout << prefix << "transform:matrix("
<< tm[0] << ','
<< -tm[1] << ','
<< -tm[2] << ','
<< tm[3] << ',';
// PDF use a different coordinate system from Web
allcss_fout << prefix << "transform:matrix("
<< tm[0] << ','
<< -tm[1] << ','
<< -tm[2] << ','
<< tm[3] << ',';
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 << "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

@ -14,6 +14,7 @@
#include "config.h"
#include "namespace.h"
using std::fixed;
using std::flush;
using boost::filesystem::remove;
using boost::filesystem::filesystem_error;
@ -105,6 +106,9 @@ void HTMLRenderer::pre_process()
html_fout << ifstream(PDF2HTMLEX_DATA_PATH / NECK_HTML_FILENAME, ifstream::binary).rdbuf();
}
html_fout << fixed;
allcss_fout << fixed;
allcss_fout << ifstream(PDF2HTMLEX_DATA_PATH / CSS_FILENAME, ifstream::binary).rdbuf();
}