mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-12-22 13:00:08 +00:00
new option --printing
This commit is contained in:
parent
e65791e5ae
commit
4d3f4655e5
@ -43,7 +43,7 @@ If multiple values are specified, the minimum one will be used.
|
||||
If none is specified, pages will be rendered as 72DPI.
|
||||
|
||||
.TP
|
||||
.B --use-cropbox <0|1> (Default: 0)
|
||||
.B --use-cropbox <0|1> (Default: 1)
|
||||
Use CropBox instead of MediaBox for output.
|
||||
|
||||
.TP
|
||||
@ -95,7 +95,7 @@ This switch is useful if you want pages to be loaded separately & dynamically --
|
||||
|
||||
.TP
|
||||
.B --dest-dir <dir> (Default: .)
|
||||
Specify destination folder
|
||||
Specify destination folder.
|
||||
|
||||
.TP
|
||||
.B --css-filename <filename> (Default: <none>)
|
||||
@ -109,10 +109,6 @@ Specify the filename of the generated outline file, if not embedded.
|
||||
|
||||
If it's empty, the file name will be determined automatically.
|
||||
|
||||
.TP
|
||||
.B --fallback <0|1> (Deafult: 0)
|
||||
Output in fallback mode, for better accuracy and browser compatibility, but the size becomes larger.
|
||||
|
||||
.TP
|
||||
.B --process-nontext <0|1> (Default: 1)
|
||||
Whether to process non-text objects (as images)
|
||||
@ -121,6 +117,14 @@ Whether to process non-text objects (as images)
|
||||
.B --process-outline <0|1> (Default: 1)
|
||||
Whether to show outline in the generated HTML
|
||||
|
||||
.TP
|
||||
.B --printing <0|1> (Default: 1)
|
||||
Enable printing support. Disabling this option may reduce the size of CSS.
|
||||
|
||||
.TP
|
||||
.B --fallback <0|1> (Deafult: 0)
|
||||
Output in fallback mode, for better accuracy and browser compatibility, but the size becomes larger.
|
||||
|
||||
.SS Fonts
|
||||
|
||||
.TP
|
||||
@ -148,6 +152,8 @@ Decompose ligatures. For example 'fi' -> 'f''i'.
|
||||
.B --remove-unused-glyph <0|1> (Default: 1)
|
||||
If set to 1, remove unused glyphs in embedded fonts in order to reduce the file size.
|
||||
|
||||
Try turning it off if you encounter segmentation fault or debris-like fonts.
|
||||
|
||||
.TP
|
||||
.B --auto-hint <0|1> (Default: 0)
|
||||
If set to 1, hints will be generated for the fonts using fontforge.
|
||||
|
@ -460,22 +460,25 @@ void HTMLRenderer::dump_css (void)
|
||||
all_manager.bgimage_size .dump_css(f_css.fs);
|
||||
|
||||
// print css
|
||||
double ps = print_scale();
|
||||
f_css.fs << CSS::PRINT_ONLY << "{" << endl;
|
||||
all_manager.transform_matrix.dump_print_css(f_css.fs, ps);
|
||||
all_manager.vertical_align .dump_print_css(f_css.fs, ps);
|
||||
all_manager.letter_space .dump_print_css(f_css.fs, ps);
|
||||
all_manager.stroke_color .dump_print_css(f_css.fs, ps);
|
||||
all_manager.word_space .dump_print_css(f_css.fs, ps);
|
||||
all_manager.whitespace .dump_print_css(f_css.fs, ps);
|
||||
all_manager.fill_color .dump_print_css(f_css.fs, ps);
|
||||
all_manager.font_size .dump_print_css(f_css.fs, ps);
|
||||
all_manager.bottom .dump_print_css(f_css.fs, ps);
|
||||
all_manager.height .dump_print_css(f_css.fs, ps);
|
||||
all_manager.width .dump_print_css(f_css.fs, ps);
|
||||
all_manager.left .dump_print_css(f_css.fs, ps);
|
||||
all_manager.bgimage_size .dump_print_css(f_css.fs, ps);
|
||||
f_css.fs << "}" << endl;
|
||||
if(param.printing)
|
||||
{
|
||||
double ps = print_scale();
|
||||
f_css.fs << CSS::PRINT_ONLY << "{" << endl;
|
||||
all_manager.transform_matrix.dump_print_css(f_css.fs, ps);
|
||||
all_manager.vertical_align .dump_print_css(f_css.fs, ps);
|
||||
all_manager.letter_space .dump_print_css(f_css.fs, ps);
|
||||
all_manager.stroke_color .dump_print_css(f_css.fs, ps);
|
||||
all_manager.word_space .dump_print_css(f_css.fs, ps);
|
||||
all_manager.whitespace .dump_print_css(f_css.fs, ps);
|
||||
all_manager.fill_color .dump_print_css(f_css.fs, ps);
|
||||
all_manager.font_size .dump_print_css(f_css.fs, ps);
|
||||
all_manager.bottom .dump_print_css(f_css.fs, ps);
|
||||
all_manager.height .dump_print_css(f_css.fs, ps);
|
||||
all_manager.width .dump_print_css(f_css.fs, ps);
|
||||
all_manager.left .dump_print_css(f_css.fs, ps);
|
||||
all_manager.bgimage_size .dump_print_css(f_css.fs, ps);
|
||||
f_css.fs << "}" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
void HTMLRenderer::embed_file(ostream & out, const string & path, const string & type, bool copy)
|
||||
|
@ -32,6 +32,7 @@ struct Param
|
||||
std::string outline_filename;
|
||||
int process_nontext;
|
||||
int process_outline;
|
||||
int printing;
|
||||
int fallback;
|
||||
|
||||
// fonts
|
||||
|
@ -77,6 +77,7 @@ void parse_options (int argc, char **argv)
|
||||
.add("outline-filename", ¶m.outline_filename, "", "filename of the generated outline file")
|
||||
.add("process-nontext", ¶m.process_nontext, 1, "render graphics in addition to text")
|
||||
.add("process-outline", ¶m.process_outline, 1, "show outline in HTML")
|
||||
.add("printing", ¶m.printing, 1, "enable printing support")
|
||||
.add("fallback", ¶m.fallback, 0, "output in fallback mode")
|
||||
|
||||
// fonts
|
||||
|
Loading…
Reference in New Issue
Block a user