mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-12-22 13:00:08 +00:00
progress indicator
This commit is contained in:
parent
90fcf4ed08
commit
76df0f4e97
@ -69,7 +69,6 @@ void HTMLRenderer::process(PDFDoc *doc)
|
||||
|
||||
pre_process(doc);
|
||||
|
||||
cerr << "Working: ";
|
||||
BackgroundRenderer * bg_renderer = nullptr;
|
||||
if(param->process_nontext)
|
||||
{
|
||||
@ -77,8 +76,11 @@ void HTMLRenderer::process(PDFDoc *doc)
|
||||
bg_renderer->startDoc(doc);
|
||||
}
|
||||
|
||||
int page_count = (param->last_page - param->first_page);
|
||||
for(int i = param->first_page; i <= param->last_page ; ++i)
|
||||
{
|
||||
cerr << "Working: " << (i-param->first_page) << "/" << page_count << '\r' << flush;
|
||||
|
||||
if(param->split_pages)
|
||||
{
|
||||
auto page_fn = str_fmt("%s/%s%d.page", param->dest_dir.c_str(), param->output_filename.c_str(), i);
|
||||
@ -106,9 +108,10 @@ void HTMLRenderer::process(PDFDoc *doc)
|
||||
{
|
||||
html_fout.close();
|
||||
}
|
||||
|
||||
cerr << "." << flush;
|
||||
}
|
||||
if(page_count >= 0)
|
||||
cerr << "Working: " << page_count << "/" << page_count;
|
||||
cerr << endl;
|
||||
|
||||
post_process();
|
||||
|
||||
@ -219,7 +222,6 @@ void HTMLRenderer::endPage() {
|
||||
|
||||
void HTMLRenderer::pre_process(PDFDoc * doc)
|
||||
{
|
||||
cerr << "Preprocessing: ";
|
||||
preprocessor.process(doc);
|
||||
|
||||
/*
|
||||
|
@ -41,14 +41,17 @@ Preprocessor::~Preprocessor(void)
|
||||
|
||||
void Preprocessor::process(PDFDoc * doc)
|
||||
{
|
||||
int page_count = (param->last_page - param->first_page);
|
||||
for(int i = param->first_page; i <= param->last_page ; ++i)
|
||||
{
|
||||
cerr << "Preprocessing: " << (i-param->first_page) << "/" << page_count << '\r' << flush;
|
||||
|
||||
doc->displayPage(this, i, DEFAULT_DPI, DEFAULT_DPI,
|
||||
0, true, false, false,
|
||||
nullptr, nullptr, nullptr, nullptr);
|
||||
|
||||
cerr << "." << flush;
|
||||
}
|
||||
if(page_count >= 0)
|
||||
cerr << "Preprocessing: " << page_count << "/" << page_count;
|
||||
cerr << endl;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user