mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-12-22 04:50:09 +00:00
change dpi options, add 'zoom' option
This commit is contained in:
parent
87204a9e9e
commit
a8afb70fb8
@ -14,6 +14,8 @@
|
||||
static constexpr double EPS = 1e-6;
|
||||
extern const double id_matrix[6];
|
||||
|
||||
static constexpr double DEFAULT_DPI = 72.0;
|
||||
|
||||
extern const std::map<std::string, std::string> BASE_14_FONT_CSS_FONT_MAP;
|
||||
extern const std::map<std::string, std::string> GB_ENCODED_FONT_NAME_MAP;
|
||||
|
||||
|
@ -68,17 +68,17 @@ void HTMLRenderer::process(PDFDoc *doc)
|
||||
{
|
||||
if(param->process_nontext)
|
||||
{
|
||||
doc->displayPage(bg_renderer, i, param->h_dpi2, param->v_dpi2,
|
||||
doc->displayPage(bg_renderer, i, param->h_dpi, param->v_dpi,
|
||||
0, true, false, false,
|
||||
nullptr, nullptr, nullptr, nullptr);
|
||||
|
||||
string fn = (format("p%|1$x|.png")%i).str();
|
||||
bg_renderer->getBitmap()->writeImgFile(splashFormatPng, (char*)((param->single_html ? tmp_dir : dest_dir) / fn) .c_str(), param->h_dpi2, param->v_dpi2);
|
||||
bg_renderer->getBitmap()->writeImgFile(splashFormatPng, (char*)((param->single_html ? tmp_dir : dest_dir) / fn) .c_str(), param->h_dpi, param->v_dpi);
|
||||
if(param->single_html)
|
||||
add_tmp_file(fn);
|
||||
}
|
||||
|
||||
doc->displayPage(this, i, param->h_dpi, param->v_dpi,
|
||||
doc->displayPage(this, i, param->zoom * DEFAULT_DPI, param->zoom * DEFAULT_DPI,
|
||||
0, true, false, false,
|
||||
nullptr, nullptr, nullptr, nullptr);
|
||||
|
||||
|
@ -20,8 +20,8 @@ struct Param
|
||||
|
||||
int first_page, last_page;
|
||||
|
||||
double zoom;
|
||||
double h_dpi, v_dpi;
|
||||
double h_dpi2, v_dpi2;
|
||||
double h_eps, v_eps;
|
||||
|
||||
int process_nontext;
|
||||
|
@ -125,10 +125,9 @@ po::variables_map parse_options (int argc, char **argv)
|
||||
("user-password,u", po::value<string>(¶m.user_password)->default_value(""), "user password (for encrypted files)")
|
||||
("dest-dir", po::value<string>(¶m.dest_dir)->default_value("."), "destination directory")
|
||||
("tmp-dir", po::value<string>(¶m.tmp_dir)->default_value("/tmp/pdf2htmlEX"), "temporary directory")
|
||||
("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 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")
|
||||
("zoom", po::value<double>(¶m.zoom)->default_value(1.0), "zoom ratio")
|
||||
("hdpi", po::value<double>(¶m.h_dpi)->default_value(144.0), "horizontal DPI for non-text")
|
||||
("vdpi", po::value<double>(¶m.v_dpi)->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)")
|
||||
("veps", po::value<double>(¶m.v_eps)->default_value(1.0), "max tolerated vertical offset (in pixels)")
|
||||
("single-html", po::value<int>(¶m.single_html)->default_value(1), "combine everything into one single HTML file")
|
||||
|
Loading…
Reference in New Issue
Block a user