mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-12-22 04:50:09 +00:00
clean
This commit is contained in:
parent
ae7c8e8d9c
commit
1cd9f00955
1
TODO
1
TODO
@ -1,6 +1,5 @@
|
|||||||
save width in Textline, create new <div> in the middle
|
save width in Textline, create new <div> in the middle
|
||||||
|
|
||||||
add async to <script>
|
|
||||||
link in outline: dest-detail vs hashtag
|
link in outline: dest-detail vs hashtag
|
||||||
|
|
||||||
split js files
|
split js files
|
||||||
|
@ -82,13 +82,6 @@ This switch is useful if you want pages to be loaded separately & dynamically --
|
|||||||
|
|
||||||
Also see --page-filename.
|
Also see --page-filename.
|
||||||
|
|
||||||
.TP
|
|
||||||
.B --tmp-file-size-limit <limit> (Default: -1)
|
|
||||||
This limits the total size of the temporary files which will also limit the total size of the output file.
|
|
||||||
This is an estimate and it will stop after a page, once the total temporary files size is greater than this number.
|
|
||||||
|
|
||||||
-1 means no limit and is the default.
|
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B --dest-dir <dir> (Default: .)
|
.B --dest-dir <dir> (Default: .)
|
||||||
Specify destination folder.
|
Specify destination folder.
|
||||||
@ -149,6 +142,14 @@ Enable printing support. Disabling this option may reduce the size of CSS.
|
|||||||
.B --fallback <0|1> (Deafult: 0)
|
.B --fallback <0|1> (Deafult: 0)
|
||||||
Output in fallback mode, for better accuracy and browser compatibility, but the size becomes larger.
|
Output in fallback mode, for better accuracy and browser compatibility, but the size becomes larger.
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.B --tmp-file-size-limit <limit> (Default: -1)
|
||||||
|
This limits the total size (in KB) of the temporary files which will also limit the total size of the output file.
|
||||||
|
This is an estimate and it will stop after a page, once the total temporary files size is greater than this number.
|
||||||
|
|
||||||
|
-1 means no limit and is the default.
|
||||||
|
|
||||||
|
|
||||||
.SS Fonts
|
.SS Fonts
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
|
@ -31,7 +31,6 @@ struct Param
|
|||||||
int embed_javascript;
|
int embed_javascript;
|
||||||
int embed_outline;
|
int embed_outline;
|
||||||
int split_pages;
|
int split_pages;
|
||||||
int tmp_file_size_limit;
|
|
||||||
std::string dest_dir;
|
std::string dest_dir;
|
||||||
std::string css_filename;
|
std::string css_filename;
|
||||||
std::string page_filename;
|
std::string page_filename;
|
||||||
@ -40,6 +39,7 @@ struct Param
|
|||||||
int process_outline;
|
int process_outline;
|
||||||
int printing;
|
int printing;
|
||||||
int fallback;
|
int fallback;
|
||||||
|
int tmp_file_size_limit;
|
||||||
|
|
||||||
// fonts
|
// fonts
|
||||||
int embed_external_font;
|
int embed_external_font;
|
||||||
|
@ -46,6 +46,20 @@ void TmpFiles::add( const string & fn)
|
|||||||
cerr << "Add new temporary file: " << fn << endl;
|
cerr << "Add new temporary file: " << fn << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Return the total size of the temporary files in bytes
|
||||||
|
double TmpFiles::get_total_size() const
|
||||||
|
{
|
||||||
|
double total_size = 0;
|
||||||
|
struct STAT st;
|
||||||
|
for(auto iter = tmp_files.begin(); iter != tmp_files.end(); ++iter) {
|
||||||
|
STAT(iter->c_str(), &st);
|
||||||
|
total_size += st.st_size;
|
||||||
|
}
|
||||||
|
|
||||||
|
return total_size;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void TmpFiles::clean()
|
void TmpFiles::clean()
|
||||||
{
|
{
|
||||||
if(!param.clean_tmp)
|
if(!param.clean_tmp)
|
||||||
@ -64,18 +78,5 @@ void TmpFiles::clean()
|
|||||||
cerr << "Remove temporary directory: " << param.tmp_dir << endl;
|
cerr << "Remove temporary directory: " << param.tmp_dir << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return the total size of the temporary files in bytes
|
|
||||||
double TmpFiles::get_total_size() const
|
|
||||||
{
|
|
||||||
double total_size = 0;
|
|
||||||
struct STAT st;
|
|
||||||
for(auto iter = tmp_files.begin(); iter != tmp_files.end(); ++iter) {
|
|
||||||
STAT(iter->c_str(), &st);
|
|
||||||
total_size += st.st_size;
|
|
||||||
}
|
|
||||||
|
|
||||||
return total_size;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace pdf2htmlEX
|
} // namespace pdf2htmlEX
|
||||||
|
|
||||||
|
@ -169,7 +169,6 @@ void parse_options (int argc, char **argv)
|
|||||||
.add("embed-image", ¶m.embed_image, 1, "embed image files into output")
|
.add("embed-image", ¶m.embed_image, 1, "embed image files into output")
|
||||||
.add("embed-javascript", ¶m.embed_javascript, 1, "embed JavaScript files into output")
|
.add("embed-javascript", ¶m.embed_javascript, 1, "embed JavaScript files into output")
|
||||||
.add("embed-outline", ¶m.embed_outline, 1, "embed outlines into output")
|
.add("embed-outline", ¶m.embed_outline, 1, "embed outlines into output")
|
||||||
.add("tmp-file-size-limit", ¶m.tmp_file_size_limit, -1, "Limit the temporary file output size, in KB (-1 for no limit). This is only an estimate, the output may be bigger")
|
|
||||||
.add("split-pages", ¶m.split_pages, 0, "split pages into separate files")
|
.add("split-pages", ¶m.split_pages, 0, "split pages into separate files")
|
||||||
.add("dest-dir", ¶m.dest_dir, ".", "specify destination directory")
|
.add("dest-dir", ¶m.dest_dir, ".", "specify destination directory")
|
||||||
.add("css-filename", ¶m.css_filename, "", "filename of the generated css file")
|
.add("css-filename", ¶m.css_filename, "", "filename of the generated css file")
|
||||||
@ -179,6 +178,7 @@ void parse_options (int argc, char **argv)
|
|||||||
.add("process-outline", ¶m.process_outline, 1, "show outline in HTML")
|
.add("process-outline", ¶m.process_outline, 1, "show outline in HTML")
|
||||||
.add("printing", ¶m.printing, 1, "enable printing support")
|
.add("printing", ¶m.printing, 1, "enable printing support")
|
||||||
.add("fallback", ¶m.fallback, 0, "output in fallback mode")
|
.add("fallback", ¶m.fallback, 0, "output in fallback mode")
|
||||||
|
.add("tmp-file-size-limit", ¶m.tmp_file_size_limit, -1, "Maximum size (in KB) used by temporary files, -1 for no limit.")
|
||||||
|
|
||||||
// fonts
|
// fonts
|
||||||
.add("embed-external-font", ¶m.embed_external_font, 1, "embed local match for external fonts")
|
.add("embed-external-font", ¶m.embed_external_font, 1, "embed local match for external fonts")
|
||||||
@ -384,9 +384,8 @@ int main(int argc, char **argv)
|
|||||||
//prepare the directories
|
//prepare the directories
|
||||||
prepare_directories();
|
prepare_directories();
|
||||||
|
|
||||||
if(param.debug) {
|
if(param.debug)
|
||||||
cerr << "temporary dir: " << (param.tmp_dir) << endl;
|
cerr << "temporary dir: " << (param.tmp_dir) << endl;
|
||||||
}
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user