mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-12-22 13:00:08 +00:00
add the 'debug' option
This commit is contained in:
parent
265a7785bc
commit
bc48fdefd8
@ -389,6 +389,11 @@ long long HTMLRenderer::install_font(GfxFont * font)
|
||||
return new_fn_id;
|
||||
}
|
||||
|
||||
if(param->debug)
|
||||
{
|
||||
std::cerr << "Install font: (" << (font->getID()->num) << ' ' << (font->getID()->gen) << ") -> " << boost::format("f%|1$x|")%new_fn_id << std::endl;
|
||||
}
|
||||
|
||||
if(font->getType() == fontType3) {
|
||||
std::cerr << "Type 3 fonts are unsupported and will be rendered as Image" << std::endl;
|
||||
export_remote_default_font(new_fn_id);
|
||||
@ -589,6 +594,7 @@ void HTMLRenderer::install_embedded_font(GfxFont * font, const std::string & suf
|
||||
if(maxcode > 0)
|
||||
{
|
||||
ofstream map_fout((boost::format("%1%/%2%.encoding") % TMP_DIR % fn).str().c_str());
|
||||
int cnt = 0;
|
||||
for(int i = 0; i <= maxcode; ++i)
|
||||
{
|
||||
Unicode * u;
|
||||
@ -596,6 +602,7 @@ void HTMLRenderer::install_embedded_font(GfxFont * font, const std::string & suf
|
||||
// not sure what to do when n > 1
|
||||
if(n > 0)
|
||||
{
|
||||
++cnt;
|
||||
map_fout << boost::format("0x%|1$X|") % (code2GID ? code2GID[i] : i);
|
||||
for(int j = 0; j < n; ++j)
|
||||
map_fout << boost::format(" 0x%|1$X|") % u[j];
|
||||
@ -603,9 +610,12 @@ void HTMLRenderer::install_embedded_font(GfxFont * font, const std::string & suf
|
||||
}
|
||||
}
|
||||
|
||||
if(cnt > 0)
|
||||
{
|
||||
fontscript_fout << boost::format("LoadEncodingFile(\"%1%/%2%.encoding\", \"%2%\")") % TMP_DIR % fn << endl;
|
||||
fontscript_fout << boost::format("Reencode(\"%1%\", 1)") % fn << endl;
|
||||
}
|
||||
}
|
||||
|
||||
ctu->decRefCnt();
|
||||
}
|
||||
|
@ -21,6 +21,8 @@ struct Param
|
||||
double h_eps, v_eps;
|
||||
|
||||
int process_nontext;
|
||||
|
||||
int debug;
|
||||
};
|
||||
|
||||
|
||||
|
@ -126,6 +126,7 @@ po::variables_map parse_options (int argc, char **argv)
|
||||
("heps", po::value<double>(¶m.h_eps)->default_value(1.0), "max tolerated horizontal offset (in pixels)")
|
||||
("veps", po::value<double>(¶m.v_eps)->default_value(1.0), "max tolerated vertical offset (in pixels)")
|
||||
("process-nontext", po::value<int>(¶m.process_nontext)->default_value(1), "process nontext objects")
|
||||
("debug", po::value<int>(¶m.debug)->default_value(0), "output debug information")
|
||||
;
|
||||
|
||||
opt_hidden.add_options()
|
||||
|
Loading…
Reference in New Issue
Block a user