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

new param use-cropbox

This commit is contained in:
Lu Wang 2012-12-07 20:31:09 +08:00
parent c886e22292
commit 59a571ac8a
5 changed files with 12 additions and 3 deletions

View File

@ -54,9 +54,12 @@ If multiple values are specified, the minimum one will be used.
If none is specified, pages will be rendered as 72DPI.
.TP
.B --hpdi <dpi>, --vpdi <dpi> (Default: 144)
.B --hdpi <dpi>, --vdpi <dpi> (Default: 144)
Specify the horizontal and vertical DPI for images
.TP
.B --use-cropbox <0|1> (Default: 0)
Use CropBox instead of MediaBox for output.
.TP
.B --process-nontext <0|1> (Default: 1)
Whether to process non-text objects (as images)
.TP

View File

@ -33,7 +33,9 @@ static GBool annot_cb(Annot *, void *) {
void SplashBackgroundRenderer::render_page(PDFDoc * doc, int pageno, const string & filename)
{
doc->displayPage(this, pageno, param->h_dpi, param->v_dpi,
0, true, false, false,
0,
(param->use_cropbox == 0),
false, false,
nullptr, nullptr, &annot_cb, nullptr);
getBitmap()->writeImgFile(splashFormatPng,

View File

@ -105,7 +105,9 @@ void HTMLRenderer::process(PDFDoc *doc)
doc->displayPage(this, i,
text_zoom_factor() * DEFAULT_DPI, text_zoom_factor() * DEFAULT_DPI,
0, true, false, false,
0,
(param->use_cropbox == 0),
false, false,
nullptr, nullptr, nullptr, nullptr);
if(param->split_pages)

View File

@ -28,6 +28,7 @@ struct Param
double zoom;
double fit_width, fit_height;
double h_dpi, v_dpi;
int use_cropbox;
int process_nontext;
int single_html;

View File

@ -67,6 +67,7 @@ void parse_options (int argc, char **argv)
.add("fit-height", &param.fit_height, 0, "fit height", nullptr, true)
.add("hdpi", &param.h_dpi, 144.0, "horizontal DPI for non-text")
.add("vdpi", &param.v_dpi, 144.0, "vertical DPI for non-text")
.add("use-cropbox", &param.use_cropbox, 0, "use CropBox instead of MediaBox")
.add("process-nontext", &param.process_nontext, 1, "process nontext objects")
.add("single-html", &param.single_html, 1, "combine everything into one single HTML file")