mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-12-22 13:00:08 +00:00
add dpi option for images
This commit is contained in:
parent
39846f33bb
commit
24636a1e64
@ -102,10 +102,10 @@ void HTMLRenderer::process(PDFDoc *doc)
|
|||||||
|
|
||||||
for(int i = param->first_page; i <= param->last_page ; ++i)
|
for(int i = param->first_page; i <= param->last_page ; ++i)
|
||||||
{
|
{
|
||||||
doc->displayPage(bg_renderer, i, 4*param->h_dpi, 4*param->v_dpi,
|
doc->displayPage(bg_renderer, i, param->h_dpi2, param->v_dpi2,
|
||||||
0, true, false, false,
|
0, true, false, false,
|
||||||
nullptr, nullptr, nullptr, nullptr);
|
nullptr, nullptr, nullptr, nullptr);
|
||||||
bg_renderer->getBitmap()->writeImgFile(splashFormatPng, (char*)(boost::format("p%|1$x|.png")%i).str().c_str(), 4*param->h_dpi, 4*param->v_dpi);
|
bg_renderer->getBitmap()->writeImgFile(splashFormatPng, (char*)(boost::format("p%|1$x|.png")%i).str().c_str(), param->h_dpi2, param->v_dpi2);
|
||||||
|
|
||||||
std::cerr << ".";
|
std::cerr << ".";
|
||||||
std::cerr.flush();
|
std::cerr.flush();
|
||||||
@ -900,6 +900,8 @@ void HTMLRenderer::install_embedded_font(GfxFont * font, const std::string & suf
|
|||||||
std::string fn = (boost::format("f%|1$x|") % fn_id).str();
|
std::string fn = (boost::format("f%|1$x|") % fn_id).str();
|
||||||
|
|
||||||
fontscript_fout << boost::format("Open(\"%1%/%2%%3%\",1)") % TMP_DIR % fn % suffix << endl;
|
fontscript_fout << boost::format("Open(\"%1%/%2%%3%\",1)") % TMP_DIR % fn % suffix << endl;
|
||||||
|
|
||||||
|
// TODO: CID fonts without ToUnicode
|
||||||
if(font->hasToUnicodeCMap())
|
if(font->hasToUnicodeCMap())
|
||||||
{
|
{
|
||||||
auto ctu = font->getToUnicode();
|
auto ctu = font->getToUnicode();
|
||||||
|
@ -18,6 +18,7 @@ struct Param
|
|||||||
int first_page, last_page;
|
int first_page, last_page;
|
||||||
|
|
||||||
double h_dpi, v_dpi;
|
double h_dpi, v_dpi;
|
||||||
|
double h_dpi2, v_dpi2;
|
||||||
double h_eps, v_eps;
|
double h_eps, v_eps;
|
||||||
|
|
||||||
int process_nontext;
|
int process_nontext;
|
||||||
|
@ -121,8 +121,10 @@ po::variables_map parse_options (int argc, char **argv)
|
|||||||
("metadata,m", "show the document meta data in JSON")
|
("metadata,m", "show the document meta data in JSON")
|
||||||
("owner-password,o", po::value<string>(¶m.owner_password)->default_value(""), "owner password (for encrypted files)")
|
("owner-password,o", po::value<string>(¶m.owner_password)->default_value(""), "owner password (for encrypted files)")
|
||||||
("user-password,u", po::value<string>(¶m.user_password)->default_value(""), "user password (for encrypted files)")
|
("user-password,u", po::value<string>(¶m.user_password)->default_value(""), "user password (for encrypted files)")
|
||||||
("hdpi", po::value<double>(¶m.h_dpi)->default_value(72.0), "horizontal DPI")
|
("hdpi", po::value<double>(¶m.h_dpi)->default_value(72.0), "horizontal DPI for text")
|
||||||
("vdpi", po::value<double>(¶m.v_dpi)->default_value(72.0), "vertical DPI")
|
("vdpi", po::value<double>(¶m.v_dpi)->default_value(72.0), "vertical DPI for text")
|
||||||
|
("hdpi2", po::value<double>(¶m.h_dpi2)->default_value(144.0), "horizontal DPI for non-text")
|
||||||
|
("vdpi2", po::value<double>(¶m.v_dpi2)->default_value(144.0), "vertical DPI for non-text")
|
||||||
("heps", po::value<double>(¶m.h_eps)->default_value(1.0), "max tolerated horizontal offset (in pixels)")
|
("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)")
|
("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")
|
("process-nontext", po::value<int>(¶m.process_nontext)->default_value(1), "process nontext objects")
|
||||||
|
Loading…
Reference in New Issue
Block a user