1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 13:00:08 +00:00

+ quiet parameter

This commit is contained in:
Marc Sanfacon 2013-12-27 13:52:07 -05:00
parent 42fea5b1ad
commit defc1738be
6 changed files with 56 additions and 42 deletions

View File

@ -158,7 +158,7 @@ endif()
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("${CMAKE_CXX_FLAGS}" CXX0X_SUPPORT)
if(NOT CXX0X_SUPPORT)
message(FATAL_ERROR "Error: you compiler does not support C++0x, please update it.")
message(FATAL_ERROR "Error: your compiler does not support C++0x, please update it.")
endif()

View File

@ -168,7 +168,7 @@ string HTMLRenderer::dump_embedded_font (GfxFont * font, FontInfo & info)
}
catch(int)
{
cerr << "Someting wrong when trying to dump font " << hex << fn_id << dec << endl;
cerr << "Something wrong when trying to dump font " << hex << fn_id << dec << endl;
}
obj2.free();
@ -895,7 +895,7 @@ const FontInfo * HTMLRenderer::install_font(GfxFont * font)
install_embedded_font(font, new_font_info);
break;
case gfxFontLocResident:
std::cerr << "Warning: Base 14 fonts should not be specially handled now. Please report a bug!" << std::endl;
cerr << "Warning: Base 14 fonts should not be specially handled now. Please report a bug!" << std::endl;
/* fall through */
case gfxFontLocExternal:
install_external_font(font, new_font_info);

View File

@ -110,11 +110,15 @@ void HTMLRenderer::process(PDFDoc *doc)
for(int i = param.first_page; i <= param.last_page ; ++i)
{
if (param.max_size != -1 && tmp_files.get_total_size() > param.max_size * 1024) {
if (!param.quiet) {
cerr << "Stop processing, reach max size\n";
}
break;
}
if (!param.quiet) {
cerr << "Working: " << (i-param.first_page) << "/" << page_count << '\r' << flush;
}
if(param.split_pages)
{
@ -147,9 +151,11 @@ void HTMLRenderer::process(PDFDoc *doc)
f_curpage = nullptr;
}
}
if (!param.quiet) {
if (page_count >= 0)
cerr << "Working: " << page_count << "/" << page_count;
cerr << endl;
}
////////////////////////
// Process Outline
@ -164,8 +170,10 @@ void HTMLRenderer::process(PDFDoc *doc)
bg_renderer = nullptr;
}
if (!param.quiet) {
cerr << endl;
}
}
void HTMLRenderer::setDefaultCTM(double *ctm)
{

View File

@ -72,6 +72,7 @@ struct Param
std::string data_dir;
std::string basetmp_dir;
int css_draw;
int quiet;
int debug;
std::string input_filename, output_filename;

View File

@ -45,7 +45,9 @@ void Preprocessor::process(PDFDoc * doc)
int page_count = (param.last_page - param.first_page + 1);
for(int i = param.first_page; i <= param.last_page ; ++i)
{
if (!param.quiet) {
cerr << "Preprocessing: " << (i-param.first_page) << "/" << page_count << '\r' << flush;
}
doc->displayPage(this, i, DEFAULT_DPI, DEFAULT_DPI,
0,
@ -54,10 +56,12 @@ void Preprocessor::process(PDFDoc * doc)
false, // printing
nullptr, nullptr, nullptr, nullptr);
}
if (!param.quiet) {
if(page_count >= 0)
cerr << "Preprocessing: " << page_count << "/" << page_count;
cerr << endl;
}
}
void Preprocessor::drawChar(GfxState *state, double x, double y,
double dx, double dy,

View File

@ -214,6 +214,7 @@ void parse_options (int argc, char **argv)
.add("data-dir", &param.data_dir, param.data_dir, "specify data directory")
// TODO: css drawings are hidden on print, for annot links, need to fix it for other drawings
// .add("css-draw", &param.css_draw, 0, "[experimental and unsupported] CSS drawing")
.add("quiet", &param.quiet, 0, "do not output information")
.add("debug", &param.debug, 0, "print debugging information")
// meta