1
0
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:
Lu Wang 2012-08-15 21:26:13 +08:00
parent 87204a9e9e
commit a8afb70fb8
4 changed files with 9 additions and 8 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -125,10 +125,9 @@ po::variables_map parse_options (int argc, char **argv)
("user-password,u", po::value<string>(&param.user_password)->default_value(""), "user password (for encrypted files)")
("dest-dir", po::value<string>(&param.dest_dir)->default_value("."), "destination directory")
("tmp-dir", po::value<string>(&param.tmp_dir)->default_value("/tmp/pdf2htmlEX"), "temporary directory")
("hdpi", po::value<double>(&param.h_dpi)->default_value(72.0), "horizontal DPI for text")
("vdpi", po::value<double>(&param.v_dpi)->default_value(72.0), "vertical DPI for text")
("hdpi2", po::value<double>(&param.h_dpi2)->default_value(144.0), "horizontal DPI for non-text")
("vdpi2", po::value<double>(&param.v_dpi2)->default_value(144.0), "vertical DPI for non-text")
("zoom", po::value<double>(&param.zoom)->default_value(1.0), "zoom ratio")
("hdpi", po::value<double>(&param.h_dpi)->default_value(144.0), "horizontal DPI for non-text")
("vdpi", po::value<double>(&param.v_dpi)->default_value(144.0), "vertical DPI for non-text")
("heps", po::value<double>(&param.h_eps)->default_value(1.0), "max tolerated horizontal offset (in pixels)")
("veps", po::value<double>(&param.v_eps)->default_value(1.0), "max tolerated vertical offset (in pixels)")
("single-html", po::value<int>(&param.single_html)->default_value(1), "combine everything into one single HTML file")