From c32cb95c4588e47554d690a0b4ffd5f645f205b5 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Thu, 28 Feb 2013 15:59:14 +0800 Subject: [PATCH 01/32] change css names --- src/HTMLRenderer/TextLineBuffer.cc | 2 +- src/HTMLRenderer/font.cc | 10 +++++----- src/css_class_names.cmakelists.txt | 8 ++++---- src/util/css_const.h.in | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/HTMLRenderer/TextLineBuffer.cc b/src/HTMLRenderer/TextLineBuffer.cc index 8aab0b9..2a678f8 100644 --- a/src/HTMLRenderer/TextLineBuffer.cc +++ b/src/HTMLRenderer/TextLineBuffer.cc @@ -275,7 +275,7 @@ int HTMLRenderer::TextLineBuffer::State::diff(const State & s) const // the order should be the same as in the enum const char * const HTMLRenderer::TextLineBuffer::State::css_class_names [] = { - CSS::FONT_NAME_CN, + CSS::FONT_FAMILY_CN, CSS::FONT_SIZE_CN, CSS::FILL_COLOR_CN, CSS::STROKE_COLOR_CN, diff --git a/src/HTMLRenderer/font.cc b/src/HTMLRenderer/font.cc index 62fd9d1..ca4eaa0 100644 --- a/src/HTMLRenderer/font.cc +++ b/src/HTMLRenderer/font.cc @@ -727,7 +727,7 @@ void HTMLRenderer::export_remote_font(const FontInfo & info, const string & suff } f_css.fs << "@font-face{" - << "font-family:" << CSS::FONT_NAME_CN << info.id << ";" + << "font-family:" << CSS::FONT_FAMILY_CN << info.id << ";" << "src:url("; { @@ -749,8 +749,8 @@ void HTMLRenderer::export_remote_font(const FontInfo & info, const string & suff f_css.fs << ")" << "format(\"" << format << "\");" << "}" // end of @font-face - << "." << CSS::FONT_NAME_CN << info.id << "{" - << "font-family:" << CSS::FONT_NAME_CN << info.id << ";" + << "." << CSS::FONT_FAMILY_CN << info.id << "{" + << "font-family:" << CSS::FONT_FAMILY_CN << info.id << ";" << "line-height:" << round(info.ascent - info.descent) << ";" << "font-style:normal;" << "font-weight:normal;" @@ -772,12 +772,12 @@ static string general_font_family(GfxFont * font) // TODO: this function is called when some font is unable to process, may use the name there as a hint void HTMLRenderer::export_remote_default_font(long long fn_id) { - f_css.fs << "." << CSS::FONT_NAME_CN << fn_id << "{font-family:sans-serif;visibility:hidden;}" << endl; + f_css.fs << "." << CSS::FONT_FAMILY_CN << fn_id << "{font-family:sans-serif;visibility:hidden;}" << endl; } void HTMLRenderer::export_local_font(const FontInfo & info, GfxFont * font, const string & original_font_name, const string & cssfont) { - f_css.fs << "." << CSS::FONT_NAME_CN << info.id << "{"; + f_css.fs << "." << CSS::FONT_FAMILY_CN << info.id << "{"; f_css.fs << "font-family:" << ((cssfont == "") ? (original_font_name + "," + general_font_family(font)) : cssfont) << ";"; string fn = original_font_name; diff --git a/src/css_class_names.cmakelists.txt b/src/css_class_names.cmakelists.txt index c48dbd7..8fdaf09 100644 --- a/src/css_class_names.cmakelists.txt +++ b/src/css_class_names.cmakelists.txt @@ -2,19 +2,19 @@ # Note # don't use: (otherwise conflicted with others when there is an ID suffix) -# p f +# p f s set(CSS_INVALID_ID "_") -set(CSS_LINE_CN "tl") # text line -set(CSS_TRANSFORM_MATRIX_CN "tm") # transform matrix +set(CSS_LINE_CN "t") # text +set(CSS_TRANSFORM_MATRIX_CN "m") # matrix set(CSS_PAGE_DECORATION_CN "pd") # page decoration set(CSS_PAGE_FRAME_CN "pf") # page frame set(CSS_PAGE_CONTENT_BOX_CN "pc") # page content set(CSS_PAGE_DATA_CN "pi") # page info -set(CSS_FONT_NAME_CN "fn") # font name +set(CSS_FONT_FAMILY_CN "ff") # font family set(CSS_FONT_SIZE_CN "fs") # font size set(CSS_FILL_COLOR_CN "fc") # fill color diff --git a/src/util/css_const.h.in b/src/util/css_const.h.in index ff585e1..be9c4d5 100644 --- a/src/util/css_const.h.in +++ b/src/util/css_const.h.in @@ -35,7 +35,7 @@ const char * const PAGE_FRAME_CN = "@CSS_PAGE_FRAME_CN@"; const char * const PAGE_CONTENT_BOX_CN = "@CSS_PAGE_CONTENT_BOX_CN@"; const char * const PAGE_DATA_CN = "@CSS_PAGE_DATA_CN@"; -const char * const FONT_NAME_CN = "@CSS_FONT_NAME_CN@"; +const char * const FONT_FAMILY_CN = "@CSS_FONT_FAMILY_CN@"; const char * const FONT_SIZE_CN = "@CSS_FONT_SIZE_CN@"; const char * const FILL_COLOR_CN = "@CSS_FILL_COLOR_CN@"; const char * const STROKE_COLOR_CN = "@CSS_STROKE_COLOR_CN@"; From f982a6964c75948bb7c8ffc8e893c7674ed223d1 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Thu, 28 Feb 2013 22:37:15 +0800 Subject: [PATCH 02/32] background image css for print --- share/base.css.in | 2 ++ src/HTMLRenderer/HTMLRenderer.h | 4 ++++ src/HTMLRenderer/general.cc | 40 ++++++++++++++++----------------- src/util/StateManager.h | 37 ++++++++++++++++++++++++++++++ 4 files changed, 63 insertions(+), 20 deletions(-) diff --git a/share/base.css.in b/share/base.css.in index 986caea..f8104b4 100644 --- a/share/base.css.in +++ b/share/base.css.in @@ -109,6 +109,8 @@ -moz-transform-origin:0% 0%; -webkit-transform-origin:0% 0%; -o-transform-origin:0% 0%; + background-position:0 0; + background-repeat:no-repeat; } .@CSS_PAGE_CONTENT_BOX_CN@.opened { /* used by pdf2htmlEX.js, to show/hide pages */ display:block; diff --git a/src/HTMLRenderer/HTMLRenderer.h b/src/HTMLRenderer/HTMLRenderer.h index e2f497b..b079800 100644 --- a/src/HTMLRenderer/HTMLRenderer.h +++ b/src/HTMLRenderer/HTMLRenderer.h @@ -241,6 +241,9 @@ protected: double text_scale_factor1; double text_scale_factor2; + // 1px on screen should be printed as print_scale()pt + double print_scale (void) const { return 96.0 / DEFAULT_DPI / text_zoom_factor(); } + //////////////////////////////////////////////////// // states @@ -294,6 +297,7 @@ protected: RiseManager rise_manager; LeftManager left_manager; //////////////////////////////////////////////// + BGImageSizeManager bgimage_size_manager; // optimize for web // we try to render the final font size directly diff --git a/src/HTMLRenderer/general.cc b/src/HTMLRenderer/general.cc index cda2d5d..23cbc92 100644 --- a/src/HTMLRenderer/general.cc +++ b/src/HTMLRenderer/general.cc @@ -172,12 +172,13 @@ void HTMLRenderer::startPage(int pageNum, GfxState *state, XRef * xref) << "
" - << "
process_nontext) { f_pages.fs << "background-image:url("; - { if(param->single_html) { @@ -192,11 +193,8 @@ void HTMLRenderer::startPage(int pageNum, GfxState *state, XRef * xref) f_pages.fs << str_fmt("p%x.png", pageNum); } } - - // TODO print css - f_pages.fs << ");background-position:0 0;background-size:" - << state->getPageWidth() << "px " - << state->getPageHeight() << "px;background-repeat:no-repeat;"; + f_pages.fs << ");"; + bgimage_size_manager.install(pageNum, state->getPageWidth(), state->getPageHeight()); } f_pages.fs << "\">"; @@ -461,22 +459,24 @@ void HTMLRenderer::dump_css (void) width_manager .dump_css(f_css.fs); rise_manager .dump_css(f_css.fs); left_manager .dump_css(f_css.fs); + bgimage_size_manager.dump_css(f_css.fs); // print css - double print_scale = 96.0 / DEFAULT_DPI / text_zoom_factor(); + double ps = print_scale(); f_css.fs << CSS::PRINT_ONLY << "{" << endl; - transform_matrix_manager.dump_print_css(f_css.fs, print_scale); - letter_space_manager .dump_print_css(f_css.fs, print_scale); - stroke_color_manager .dump_print_css(f_css.fs, print_scale); - word_space_manager .dump_print_css(f_css.fs, print_scale); - whitespace_manager .dump_print_css(f_css.fs, print_scale); - fill_color_manager .dump_print_css(f_css.fs, print_scale); - font_size_manager .dump_print_css(f_css.fs, print_scale); - bottom_manager .dump_print_css(f_css.fs, print_scale); - height_manager .dump_print_css(f_css.fs, print_scale); - width_manager .dump_print_css(f_css.fs, print_scale); - rise_manager .dump_print_css(f_css.fs, print_scale); - left_manager .dump_print_css(f_css.fs, print_scale); + transform_matrix_manager.dump_print_css(f_css.fs, ps); + letter_space_manager .dump_print_css(f_css.fs, ps); + stroke_color_manager .dump_print_css(f_css.fs, ps); + word_space_manager .dump_print_css(f_css.fs, ps); + whitespace_manager .dump_print_css(f_css.fs, ps); + fill_color_manager .dump_print_css(f_css.fs, ps); + font_size_manager .dump_print_css(f_css.fs, ps); + bottom_manager .dump_print_css(f_css.fs, ps); + height_manager .dump_print_css(f_css.fs, ps); + width_manager .dump_print_css(f_css.fs, ps); + rise_manager .dump_print_css(f_css.fs, ps); + left_manager .dump_print_css(f_css.fs, ps); + bgimage_size_manager.dump_print_css(f_css.fs, ps); f_css.fs << "}" << endl; } diff --git a/src/util/StateManager.h b/src/util/StateManager.h index e9415ee..5b3ff33 100644 --- a/src/util/StateManager.h +++ b/src/util/StateManager.h @@ -453,6 +453,43 @@ public: } }; +///////////////////////////////////// +/* + * Manage the background image sizes + * Kind of similar with StateManager, but not exactly the same + * anyway temporarly leave it here + */ +class BGImageSizeManager +{ +public: + void install(int page_no, double width, double height){ + value_map.insert(std::make_pair(page_no, std::make_pair(width, height))); + } + + void dump_css(std::ostream & out) { + for(auto iter = value_map.begin(); iter != value_map.end(); ++iter) + { + const auto & s = iter->second; + out << "." << CSS::PAGE_CONTENT_BOX_CN << iter->first << "{"; + out << "background-size:" << round(s.first) << "px " << round(s.second) << "px;"; + out << "}" << std::endl; + } + } + + void dump_print_css(std::ostream & out, double scale) { + for(auto iter = value_map.begin(); iter != value_map.end(); ++iter) + { + const auto & s = iter->second; + out << "." << CSS::PAGE_CONTENT_BOX_CN << iter->first << "{"; + out << "background-size:" << round(s.first * scale) << "pt " << round(s.second * scale) << "pt;"; + out << "}" << std::endl; + } + } + +private: + std::unordered_map> value_map; +}; + } // namespace pdf2htmlEX #endif //STATEMANAGER_H__ From 171405bef534b19e897152a7fcc27070cb946c0d Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Thu, 28 Feb 2013 22:40:31 +0800 Subject: [PATCH 03/32] .. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a0383ab..c711761 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ The generated HTML file is static, Javascript is not required. * More PDF stuffs that you love - Links - Outline + - Printing [Full list](https://github.com/coolwanglu/pdf2htmlEX/wiki/Feature-List) [Compare with others](https://github.com/coolwanglu/pdf2htmlEX/wiki/Comparison) From 80e33572597bc37aa10b0b7fb5a80c7c2a28d655 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Thu, 28 Feb 2013 22:40:52 +0800 Subject: [PATCH 04/32] .. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c711761..cdfe3b8 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ The generated HTML file is static, Javascript is not required. * More PDF stuffs that you love - Links - Outline - - Printing + - Printing (experimental) [Full list](https://github.com/coolwanglu/pdf2htmlEX/wiki/Feature-List) [Compare with others](https://github.com/coolwanglu/pdf2htmlEX/wiki/Comparison) From 7ca3cea0c53ff3c4d0a29008b3b4b3ce823da2a8 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Thu, 28 Feb 2013 23:11:01 +0800 Subject: [PATCH 05/32] .. --- TODO | 3 +-- debian/changelog | 6 ++++++ debian/control | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/TODO b/TODO index bb0012d..416eafe 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,4 @@ -clean css class names -print css for draw/link/image... +print css for draw/link == Future: == diff --git a/debian/changelog b/debian/changelog index 152bc88..7397052 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +pdf2htmlex (0.7-1~git201302282259r3bc73-0ubuntu1) quantal; urgency=low + + * suggests ttfautohint + + -- WANG Lu Thu, 28 Feb 2013 22:59:45 +0800 + pdf2htmlex (0.7-1~git201302271054r3bc73-0ubuntu1) precise; urgency=low * Packaging for 12.04 diff --git a/debian/control b/debian/control index a35777c..3ae086d 100644 --- a/debian/control +++ b/debian/control @@ -9,5 +9,6 @@ Homepage: http://github.com/coolwanglu/pdf2htmlEX Package: pdf2htmlex Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, libpoppler27 (>= 0.20.3) | libpoppler28, libpng12-0, libfontforge1 +Suggests: ttfautohint Description: Converts PDF to HTML without losing format pdf2htmlEX converts PDF to HTML while retaining text, format & style as much as possible From 4cf8ffb95b046ab68e6987244b2d8756816da692 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Fri, 1 Mar 2013 00:00:06 +0800 Subject: [PATCH 06/32] hide annotations for print --- TODO | 3 +-- share/base.css.in | 3 +++ src/pdf2htmlEX.cc | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/TODO b/TODO index 416eafe..d50578d 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,3 @@ -print css for draw/link == Future: == @@ -7,7 +6,6 @@ Too difficult/complicated to implement: - naive support for image/drawing (SVG?) - type 3 fonts (convert to SVG fonts?) - reflowable text/combine lines/unwrapping - - Printing Not enough motivated/Lazy - argument auto-completion @@ -25,3 +23,4 @@ Not enough motivated/Lazy - don't dump image when there is nothing - minimum line width of css drawing - ajax in pdf2htmlEX for separated pages + - separate classes for annotations (such that we don't have to hide all css drawings for printing) diff --git a/share/base.css.in b/share/base.css.in index f8104b4..432c878 100644 --- a/share/base.css.in +++ b/share/base.css.in @@ -72,6 +72,9 @@ overflow:visible; background-color:transparent; } + .@CSS_CSS_DRAW_CN@ { + display:none; + } } /* Part 2: Page Elements: Modify with caution * The followings are base classes, which are meant to be override by PDF specific classes diff --git a/src/pdf2htmlEX.cc b/src/pdf2htmlEX.cc index 806e91c..3eff7cf 100644 --- a/src/pdf2htmlEX.cc +++ b/src/pdf2htmlEX.cc @@ -103,7 +103,8 @@ void parse_options (int argc, char **argv) // misc. .add("clean-tmp", ¶m.clean_tmp, 1, "remove temporary files after conversion") .add("data-dir", ¶m.data_dir, PDF2HTMLEX_DATA_PATH, "specify data directory") - .add("css-draw", ¶m.css_draw, 0, "[experimental and unsupported] CSS drawing") + // TODO: css drawings are hidden on print, for annot links, need to fix it for other drawings +// .add("css-draw", ¶m.css_draw, 0, "[experimental and unsupported] CSS drawing") .add("debug", ¶m.debug, 0, "print debugging information") // meta From 65f28b1b08d8d366e57a43dee9d8c5730165b394 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Fri, 1 Mar 2013 01:32:14 +0800 Subject: [PATCH 07/32] .. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cdfe3b8..6787ab4 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ The generated HTML file is static, Javascript is not required. ### Install -Thanks to all packagers! +Thanks to all the packagers! * [Ubuntu PPA](https://launchpad.net/~coolwanglu/+archive/pdf2htmlex) by Lu Wang , not always up-to-date. * [ArchLinux AUR](https://aur.archlinux.org/packages.php?ID=62426) by Arthur Titeica From 7ed22c66dd660e7bf23564d66accb788235d4720 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Fri, 1 Mar 2013 01:41:42 +0800 Subject: [PATCH 08/32] .. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6787ab4..cdfe3b8 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ The generated HTML file is static, Javascript is not required. ### Install -Thanks to all the packagers! +Thanks to all packagers! * [Ubuntu PPA](https://launchpad.net/~coolwanglu/+archive/pdf2htmlex) by Lu Wang , not always up-to-date. * [ArchLinux AUR](https://aur.archlinux.org/packages.php?ID=62426) by Arthur Titeica From 0bafee4a03292c59b4513872d8b06fbb37e4fac5 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Fri, 1 Mar 2013 11:57:48 +0800 Subject: [PATCH 09/32] .. --- TODO | 1 + 1 file changed, 1 insertion(+) diff --git a/TODO b/TODO index d50578d..4f74a9b 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,4 @@ +use img instead of background-image == Future: == From 34a53f9d14a6291c5905db331c9fdee1f1186221 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Fri, 1 Mar 2013 13:24:29 +0800 Subject: [PATCH 10/32] use img instead of background-image for better printing --- share/base.css.in | 9 ++++++-- src/HTMLRenderer/general.cc | 34 +++++++++++++----------------- src/css_class_names.cmakelists.txt | 2 ++ src/util/css_const.h.in | 2 ++ 4 files changed, 26 insertions(+), 21 deletions(-) diff --git a/share/base.css.in b/share/base.css.in index 432c878..ff64b02 100644 --- a/share/base.css.in +++ b/share/base.css.in @@ -112,12 +112,17 @@ -moz-transform-origin:0% 0%; -webkit-transform-origin:0% 0%; -o-transform-origin:0% 0%; - background-position:0 0; - background-repeat:no-repeat; } .@CSS_PAGE_CONTENT_BOX_CN@.opened { /* used by pdf2htmlEX.js, to show/hide pages */ display:block; } +.@CSS_BACKGROUND_IMAGE_CN@ { + position:absolute; + left:0; + top:0; + width:100%; + height:100%; +} @media print { .@CSS_PAGE_DECORATION_CN@ { margin:0; diff --git a/src/HTMLRenderer/general.cc b/src/HTMLRenderer/general.cc index 23cbc92..ae3a056 100644 --- a/src/HTMLRenderer/general.cc +++ b/src/HTMLRenderer/general.cc @@ -110,7 +110,7 @@ void HTMLRenderer::process(PDFDoc *doc) if(param->process_nontext) { - auto fn = str_fmt("%s/p%x.png", (param->single_html ? param->tmp_dir : param->dest_dir).c_str(), i); + auto fn = str_fmt("%s/bg%x.png", (param->single_html ? param->tmp_dir : param->dest_dir).c_str(), i); if(param->single_html) tmp_files.add((char*)fn); @@ -174,31 +174,27 @@ void HTMLRenderer::startPage(int pageNum, GfxState *state, XRef * xref) << "\" data-page-no=\"" << pageNum << "\">" << "
"; if(param->process_nontext) { - f_pages.fs << "background-image:url("; + f_pages.fs << "\"\"single_html) { - if(param->single_html) - { - auto path = str_fmt("%s/p%x.png", param->tmp_dir.c_str(), pageNum); - ifstream fin((char*)path, ifstream::binary); - if(!fin) - throw string("Cannot read background image ") + (char*)path; - f_pages.fs << "'data:image/png;base64," << base64stream(fin) << "'"; - } - else - { - f_pages.fs << str_fmt("p%x.png", pageNum); - } + auto path = str_fmt("%s/bg%x.png", param->tmp_dir.c_str(), pageNum); + ifstream fin((char*)path, ifstream::binary); + if(!fin) + throw string("Cannot read background image ") + (char*)path; + f_pages.fs << "data:image/png;base64," << base64stream(fin); } - f_pages.fs << ");"; - bgimage_size_manager.install(pageNum, state->getPageWidth(), state->getPageHeight()); + else + { + f_pages.fs << str_fmt("bg%x.png", pageNum); + } + f_pages.fs << "\"/>"; } - f_pages.fs << "\">"; - reset_state(); } diff --git a/src/css_class_names.cmakelists.txt b/src/css_class_names.cmakelists.txt index 8fdaf09..0eb0ec7 100644 --- a/src/css_class_names.cmakelists.txt +++ b/src/css_class_names.cmakelists.txt @@ -14,6 +14,8 @@ set(CSS_PAGE_FRAME_CN "pf") # page frame set(CSS_PAGE_CONTENT_BOX_CN "pc") # page content set(CSS_PAGE_DATA_CN "pi") # page info +set(CSS_BACKGROUND_IMAGE_CN "bi") # background image + set(CSS_FONT_FAMILY_CN "ff") # font family set(CSS_FONT_SIZE_CN "fs") # font size diff --git a/src/util/css_const.h.in b/src/util/css_const.h.in index be9c4d5..ed3221d 100644 --- a/src/util/css_const.h.in +++ b/src/util/css_const.h.in @@ -35,6 +35,8 @@ const char * const PAGE_FRAME_CN = "@CSS_PAGE_FRAME_CN@"; const char * const PAGE_CONTENT_BOX_CN = "@CSS_PAGE_CONTENT_BOX_CN@"; const char * const PAGE_DATA_CN = "@CSS_PAGE_DATA_CN@"; +const char * const BACKGROUND_IMAGE_CN = "@CSS_BACKGROUND_IMAGE_CN@"; + const char * const FONT_FAMILY_CN = "@CSS_FONT_FAMILY_CN@"; const char * const FONT_SIZE_CN = "@CSS_FONT_SIZE_CN@"; const char * const FILL_COLOR_CN = "@CSS_FILL_COLOR_CN@"; From 3ed576b5c8dbcad72ed7ba71d122a30add2e400e Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Fri, 1 Mar 2013 14:02:11 +0800 Subject: [PATCH 11/32] disable backgruond image selection and dragging --- share/base.css.in | 4 ++++ share/pdf2htmlEX.js.in | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/share/base.css.in b/share/base.css.in index ff64b02..d7ad8c4 100644 --- a/share/base.css.in +++ b/share/base.css.in @@ -122,6 +122,10 @@ top:0; width:100%; height:100%; + -ms-user-select:none; + -moz-user-select:none; + -webkit-user-select:none; + user-select:none; } @media print { .@CSS_PAGE_DECORATION_CN@ { diff --git a/share/pdf2htmlEX.js.in b/share/pdf2htmlEX.js.in index 283dd99..900a080 100644 --- a/share/pdf2htmlEX.js.in +++ b/share/pdf2htmlEX.js.in @@ -15,6 +15,7 @@ var pdf2htmlEX = (function(){ page_decoration : '@CSS_PAGE_DECORATION_CN@', page_content_box : '@CSS_PAGE_CONTENT_BOX_CN@', page_data : '@CSS_PAGE_DATA_CN@', + background_image : '@CSS_BACKGROUND_IMAGE_CN@', link : '@CSS_LINK_CN@', __dummy__ : 'no comma' }; @@ -126,11 +127,12 @@ var pdf2htmlEX = (function(){ this.outline = $('#'+this.outline_id); this.container = $('#'+this.container_id); - // need a better design + // Open the outline if nonempty if(this.outline.children().length > 0) { this.outline.addClass('opened'); } + // collect pages var new_pages = new Array(); var pl= $('.'+CSS_CLASS_NAMES['page_frame'], this.container); /* don't use for(..in..) */ @@ -140,14 +142,18 @@ var pdf2htmlEX = (function(){ } this.pages = new_pages; + // register schedule rendering var _ = this; this.container.scroll(function(){ _.schedule_render(); }); //this.zoom_fixer(); - // used by outline/annot_link etc + // handle links this.container.add(this.outline).on('click', '.'+CSS_CLASS_NAMES['link'], this, this.link_handler); + // disable background image draging + $('.'+CSS_CLASS_NAMES['background_image'], this.container).on('dragstart', function(e){return false;}); + this.render(); }, pre_hide_pages : function() { From f9dbb61e080d20cba5c50034166efe8da13be794 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Fri, 1 Mar 2013 14:05:52 +0800 Subject: [PATCH 12/32] bump version --- CMakeLists.txt | 2 +- ChangeLog | 7 ++++++- TODO | 2 -- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a7b70e0..027989e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR) include_directories(${CMAKE_SOURCE_DIR}/src) -set(PDF2HTMLEX_VERSION "0.7") +set(PDF2HTMLEX_VERSION "0.8") set(ARCHIVE_NAME pdf2htmlex-${PDF2HTMLEX_VERSION}) add_custom_target(dist COMMAND git archive --prefix=${ARCHIVE_NAME}/ HEAD diff --git a/ChangeLog b/ChangeLog index 3a89c38..995f5b0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,13 @@ -Latest v0.7 +Latest v0.8 + +v0.7 +2013.03.01 * Process outline * Fix build with poppler * Many code cleaning jobs [John Hewson] +* Experimental printing support +* Lots of code refinements v0.6 2013.01.26 diff --git a/TODO b/TODO index 4f74a9b..39e2d10 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,3 @@ -use img instead of background-image - == Future: == Too difficult/complicated to implement: From 4eceb1960985c3b9d14b254247527b31ec9bbb09 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Fri, 1 Mar 2013 14:46:38 +0800 Subject: [PATCH 13/32] .. --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index 7397052..ff10638 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +pdf2htmlex (0.8-1~git201303011406r3bc73-0ubuntu1) quantal; urgency=low + + * Experimental printing support + * New version + + -- WANG Lu Fri, 01 Mar 2013 14:06:42 +0800 + pdf2htmlex (0.7-1~git201302282259r3bc73-0ubuntu1) quantal; urgency=low * suggests ttfautohint From db6f0a64cd93b276bcd5b00d5313322148868798 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Sun, 3 Mar 2013 16:20:12 +0800 Subject: [PATCH 14/32] .. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cdfe3b8..d3f097e 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ pdf2htmlEX is maintained by one person in spare time, and it needs your help! * Lu Wang * For personal enquiries only - * Accepting messages in **Chinese**, **English** or **Japanese**. + * Accepting messages in **中文**, **English** or **日本語**. ## Acknowledge From 56f0b464f0431597d7a79118cc663af9dd4ff3f1 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Mon, 4 Mar 2013 13:34:06 +0800 Subject: [PATCH 15/32] cmake for old versions of fontforge --- CMakeLists.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 027989e..a5c3095 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,7 +43,7 @@ if(FONTFORGE_FOUND) link_directories(${FONTFORGE_LIBRARY_DIRS}) set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} ${FONTFORGE_LIBRARIES}) else() - message("Trying to locate fontforge...") + message("Trying to locate old versions of fontforge...") find_path(FF_INCLUDE_PATH fontforge/fontforge.h) if(FF_INCLUDE_PATH) message("Found fontforge.h: ${FF_INCLUDE_PATH}/fontforge/fontforge.h") @@ -61,6 +61,14 @@ else() else() message(FATAL_ERROR "Error: cannot locate fontforge.h") endif() + find_path(FF_CONFIG_INCLUDE_PATH config.h PATHS + ${FONTFORGE_INCLUDE_DIRS} NO_DEFAULT_PATH) + if(FF_CONFIG_INCLUDE_PATH) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -include ${FF_CONFIG_INCLUDE_PATH}/config.h") + message("Found config.h: ${FF_CONFIG_INCLUDE_PATH}/config.h") + else() + message("Cannot locate config.h for fontforge") + endif() macro(wl_find_library LIB_NAME RESULT) unset(${RESULT}) @@ -98,14 +106,6 @@ else() set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} ${PYTHON_LIBRARIES}) endif() -find_path(FF_CONFIG_INCLUDE_PATH config.h PATHS - ${FONTFORGE_INCLUDE_DIRS} NO_DEFAULT_PATH) -if(FF_CONFIG_INCLUDE_PATH) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -include ${FF_CONFIG_INCLUDE_PATH}/config.h") -message("Found config.h: ${FF_CONFIG_INCLUDE_PATH}/config.h") -else() -message("Cannot locate config.h for fontforge") -endif() # debug build flags (overwrite default cmake debug flags) set(CMAKE_C_FLAGS_DEBUG "-ggdb") From d1ea7c529cb48a8252dbb92416a881c11bedf9ca Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Tue, 5 Mar 2013 00:19:09 +0800 Subject: [PATCH 16/32] todo --- TODO | 2 ++ 1 file changed, 2 insertions(+) diff --git a/TODO b/TODO index 39e2d10..47ccbc3 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,5 @@ +cheat.html on IE + == Future: == Too difficult/complicated to implement: From 72e010acf23ad9e1db17adf5f99ec3b08b3b61d1 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Thu, 7 Mar 2013 09:37:27 +0800 Subject: [PATCH 17/32] use cropbox by default --- src/pdf2htmlEX.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pdf2htmlEX.cc b/src/pdf2htmlEX.cc index 3eff7cf..471c0e9 100644 --- a/src/pdf2htmlEX.cc +++ b/src/pdf2htmlEX.cc @@ -63,7 +63,7 @@ void parse_options (int argc, char **argv) .add("zoom", ¶m.zoom, 0, "zoom ratio", nullptr, true) .add("fit-width", ¶m.fit_width, 0, "fit width to pixels", nullptr, true) .add("fit-height", ¶m.fit_height, 0, "fit height to pixels", nullptr, true) - .add("use-cropbox", ¶m.use_cropbox, 0, "use CropBox instead of MediaBox") + .add("use-cropbox", ¶m.use_cropbox, 1, "use CropBox instead of MediaBox") .add("hdpi", ¶m.h_dpi, 144.0, "horizontal resolution for graphics in DPI") .add("vdpi", ¶m.v_dpi, 144.0, "vertical resolution for graphics in DPI") From bd1c9c138fd037623a12711c87f7c5c23ea616da Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Sat, 9 Mar 2013 01:45:13 +0800 Subject: [PATCH 18/32] fallback mode --- pdf2htmlEX.1.in | 4 ++++ share/base.css.in | 5 +++-- .../SplashBackgroundRenderer.cc | 18 ++++++++++-------- src/HTMLRenderer/general.cc | 2 +- src/HTMLRenderer/state.cc | 4 ++-- src/Param.h | 1 + src/pdf2htmlEX.cc | 1 + 7 files changed, 22 insertions(+), 13 deletions(-) diff --git a/pdf2htmlEX.1.in b/pdf2htmlEX.1.in index 645c0aa..14d8917 100644 --- a/pdf2htmlEX.1.in +++ b/pdf2htmlEX.1.in @@ -87,6 +87,10 @@ 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) diff --git a/share/base.css.in b/share/base.css.in index d7ad8c4..59ac4ed 100644 --- a/share/base.css.in +++ b/share/base.css.in @@ -164,11 +164,12 @@ span { /* text blocks within a line */ color:transparent; z-index:-1; } +/* selection background should not be opaque, for fallback mode */ ::selection{ - background: rgba(127,255,255,1); + background: rgba(127,255,255,0.4); } ::-moz-selection{ - background: rgba(127,255,255,1); + background: rgba(127,255,255,0.4); } .@CSS_PAGE_DATA_CN@ { /* info for Javascript */ display:none; diff --git a/src/BackgroundRenderer/SplashBackgroundRenderer.cc b/src/BackgroundRenderer/SplashBackgroundRenderer.cc index ea5281a..28e5900 100644 --- a/src/BackgroundRenderer/SplashBackgroundRenderer.cc +++ b/src/BackgroundRenderer/SplashBackgroundRenderer.cc @@ -20,17 +20,19 @@ void SplashBackgroundRenderer::drawChar(GfxState *state, double x, double y, CharCode code, int nBytes, Unicode *u, int uLen) { // draw characters as image when - // - there is special filling method + // - in fallback mode + // - OR there is special filling method // - OR using a writing mode font // - OR using a Type 3 font - if(( (state->getFont()) - && ( (state->getFont()->getWMode()) - || (state->getFont()->getType() == fontType3) - ) - ) + if((param->fallback) + || ( (state->getFont()) + && ( (state->getFont()->getWMode()) + || (state->getFont()->getType() == fontType3) + ) + ) ) { - SplashOutputDev::drawChar(state,x,y,dx,dy,originX,originY,code, nBytes, u, uLen); + SplashOutputDev::drawChar(state,x,y,dx,dy,originX,originY,code,nBytes,u,uLen); } } @@ -42,7 +44,7 @@ void SplashBackgroundRenderer::render_page(PDFDoc * doc, int pageno, const strin { doc->displayPage(this, pageno, param->h_dpi, param->v_dpi, 0, - (param->use_cropbox == 0), + (!(param->use_cropbox)), false, false, nullptr, nullptr, &annot_cb, nullptr); diff --git a/src/HTMLRenderer/general.cc b/src/HTMLRenderer/general.cc index ae3a056..2875adf 100644 --- a/src/HTMLRenderer/general.cc +++ b/src/HTMLRenderer/general.cc @@ -120,7 +120,7 @@ void HTMLRenderer::process(PDFDoc *doc) doc->displayPage(this, i, text_zoom_factor() * DEFAULT_DPI, text_zoom_factor() * DEFAULT_DPI, 0, - (param->use_cropbox == 0), + (!(param->use_cropbox)), false, false, nullptr, nullptr, nullptr, nullptr); diff --git a/src/HTMLRenderer/state.cc b/src/HTMLRenderer/state.cc index 92ceabb..aea5113 100644 --- a/src/HTMLRenderer/state.cc +++ b/src/HTMLRenderer/state.cc @@ -346,7 +346,7 @@ void HTMLRenderer::check_state_change(GfxState * state) } // fill color - if(all_changed || fill_color_changed) + if((!(param->fallback)) && (all_changed || fill_color_changed)) { // * PDF Spec. Table 106 – Text rendering modes static const char FILL[8] = { true, false, true, false, true, false, true, false }; @@ -369,7 +369,7 @@ void HTMLRenderer::check_state_change(GfxState * state) } // stroke color - if(all_changed || stroke_color_changed) + if((!(param->fallback)) && (all_changed || stroke_color_changed)) { // * PDF Spec. Table 106 – Text rendering modes static const char STROKE[8] = { false, true, true, false, false, true, true, false }; diff --git a/src/Param.h b/src/Param.h index 2155f8a..c6e9964 100644 --- a/src/Param.h +++ b/src/Param.h @@ -32,6 +32,7 @@ struct Param std::string outline_filename; int process_nontext; int process_outline; + int fallback; // fonts int embed_base_font; diff --git a/src/pdf2htmlEX.cc b/src/pdf2htmlEX.cc index 471c0e9..bae0100 100644 --- a/src/pdf2htmlEX.cc +++ b/src/pdf2htmlEX.cc @@ -75,6 +75,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("fallback", ¶m.fallback, 0, "output in fallback mode") // fonts .add("embed-base-font", ¶m.embed_base_font, 0, "embed local match for standard 14 fonts") From cfeadd4f63c60f03e787e6f2a6e3c2147470047f Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Sat, 9 Mar 2013 01:49:05 +0800 Subject: [PATCH 19/32] .. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d3f097e..93d31bb 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ The generated HTML file is static, Javascript is not required. - Normal HTML - All-in-one HTML - portable & easy to share - One HTML per page - best for dynamic pages + - Fallback - better accuracy and compatibility * More PDF stuffs that you love - Links - Outline From 9332603559586b44dc0dd114a5b3b48fd2183f84 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Sat, 9 Mar 2013 01:54:30 +0800 Subject: [PATCH 20/32] .. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 93d31bb..9c56772 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ The generated HTML file is static, Javascript is not required. - Normal HTML - All-in-one HTML - portable & easy to share - One HTML per page - best for dynamic pages - - Fallback - better accuracy and compatibility + - Fallback (image + hidden text) - better accuracy and compatibility * More PDF stuffs that you love - Links - Outline From 7208df83cfdbda493702ffb70d6a95cc4d7d748f Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Sat, 9 Mar 2013 01:56:27 +0800 Subject: [PATCH 21/32] todo --- TODO | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/TODO b/TODO index 47ccbc3..7af0e14 100644 --- a/TODO +++ b/TODO @@ -11,7 +11,6 @@ Too difficult/complicated to implement: Not enough motivated/Lazy - argument auto-completion - use absolute positioning for long whitespace - - color invert - detect duplicate base fonts when embedding - disable selection if we know unicode is wrong - check if we can add information to the font, and let browsers show ligatures automatically @@ -21,7 +20,7 @@ Not enough motivated/Lazy - merge sub/sup into one line - precise link dest: zoom - multiple charcode mapped to a same glyph - - don't dump image when there is nothing + - don't dump image when it is empty - minimum line width of css drawing - ajax in pdf2htmlEX for separated pages - separate classes for annotations (such that we don't have to hide all css drawings for printing) From 01a6baac97c578c197561777fce90e5952e18dca Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Sat, 9 Mar 2013 01:58:11 +0800 Subject: [PATCH 22/32] .. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9c56772..72f4612 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ Thanks to all packagers! * [Troubleshooting compilation errors](https://github.com/coolwanglu/pdf2htmlEX/wiki/FAQ#wiki-compile) * [How can I help](https://github.com/coolwanglu/pdf2htmlEX/wiki/FAQ#wiki-help) * [I want more features](https://github.com/coolwanglu/pdf2htmlEX/wiki/FAQ#wiki-feature_commission) -* [More about pdf2htmlEX](https://github.com/coolwanglu/pdf2htmlEX/wiki/) +* [More...](https://github.com/coolwanglu/pdf2htmlEX/wiki/FAQ) ## LICENSE From f5fae48131deb755f5b2fea49c6215bed2034842 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Sat, 9 Mar 2013 02:08:24 +0800 Subject: [PATCH 23/32] .. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 72f4612..17c8501 100644 --- a/README.md +++ b/README.md @@ -29,11 +29,11 @@ The generated HTML file is static, Javascript is not required. - Correct font & position & styles - Proper reencoding - Generated HTML file is of similar size as the original (uncompressed) PDF file + - Fallback (image + hidden text) - better accuracy and compatibility * Output modes - Normal HTML - All-in-one HTML - portable & easy to share - One HTML per page - best for dynamic pages - - Fallback (image + hidden text) - better accuracy and compatibility * More PDF stuffs that you love - Links - Outline From 42f47d57c0ac2300b179345027f05c1703dd7165 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Sat, 9 Mar 2013 23:57:26 +0800 Subject: [PATCH 24/32] .. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 17c8501..44c17f7 100644 --- a/README.md +++ b/README.md @@ -85,8 +85,8 @@ Thanks to all packagers! ## Usage pdf2htmlEX /path/to/foobar.pdf - pdf2htmlEX --help - man pdf2htmlEX + +[Quick Start](https://github.com/coolwanglu/pdf2htmlEX/wiki/QuickStart) ## FAQ From 942b11633de3a475892567160140e6f7c465d198 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Sun, 10 Mar 2013 13:23:52 +0800 Subject: [PATCH 25/32] .. --- src/util/ffw.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/util/ffw.c b/src/util/ffw.c index 1e6dbb8..d10a85e 100644 --- a/src/util/ffw.c +++ b/src/util/ffw.c @@ -319,6 +319,13 @@ void ffw_metric(double * ascent, double * descent) sf->descent = em - bb.maxy; */ + /* + * The embedded fonts are likely to have inconsistent values for the 3 sets of ascent/descent + * PDF viewers don't care, since they don't even use these values + * But have to unify them, for different browsers on different platforms + * Things may become easier when there are CSS rules for baseline-based positioning. + */ + info->os2_winascent = a; info->os2_typoascent = a; info->hhead_ascent = a; From 4fabd5abf0d3fba825de143b44e06ddcdb3ac361 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Sun, 10 Mar 2013 18:17:28 +0800 Subject: [PATCH 26/32] fix #100 --- src/util/ffw.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/util/ffw.c b/src/util/ffw.c index d10a85e..706cbd1 100644 --- a/src/util/ffw.c +++ b/src/util/ffw.c @@ -260,12 +260,14 @@ void ffw_cidflatten(void) SFFlatten(cur_fv->sf->cidmaster); } +/* + * There is no check if a glyph with the same unicode exists! + */ void ffw_add_empty_char(int32_t unicode, int width) { - // append the new char to Enc SplineChar * sc = SFMakeChar(cur_fv->sf, cur_fv->map, cur_fv->map->enccount); - sc->unicodeenc = unicode; - sc->width = width; + SCSetMetaData(sc, sc->name, unicode, sc->comment); + SCSynchronizeWidth(sc, width, sc->width, cur_fv); } int ffw_get_em_size(void) From 20bad6e0eb08e4d6b861390e275998a43b79fd17 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Tue, 12 Mar 2013 20:50:53 +0800 Subject: [PATCH 27/32] Update README.md --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 44c17f7..9b95c09 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,11 @@ A beautiful demo is worth a thousand words: - **Scientific Paper**: [Default](http://coolwanglu.github.com/pdf2htmlEX/demo/demo.html) / [MediaFire](http://www.mediafire.com/view/?6po429kz9czcga2) / [Original](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.148.349&rep=rep1&type=pdf) - **Full Circle Magazine**: [Default](http://coolwanglu.github.com/pdf2htmlEX/demo/issue65_en.html) / [MediaFire](http://www.mediafire.com/view/?6hxmt94k2vppnpb) / [Original](http://dl.fullcirclemagazine.org/issue65_en.pdf) The 1st link might be slow - **Chinese**: [Default](http://coolwanglu.github.com/pdf2htmlEX/demo/chn.html) / [MediaFire](http://www.mediafire.com/view/?6550ldag9w0uuq3) / [Original](http://files.cnblogs.com/phphuaibei/git%E6%90%AD%E5%BB%BA.pdf) -- Try your own files on [MediaFire](http://www.mediafire.com), which uses pdf2htmlEX for its PDF preview feature. +- **More**(http://www.mediafire.com/?clnnit9kn3vf9) + - You can [upload your own files](http://www.mediafire.com/filedrop/filedrop_hosted.php?drop=b9da314994a5e9af384dfd020fe8280e0d2e425d0870dc5edcca272e9fdc7d43) to this public folder + - Do not upload inpropriate materials (include but not limited to: private, copyrighted, illegal, threatening etc). + - The folder may be cleaned periodically, but you cannot removed any file once uploaded. + - Hosted on [MediaFire](http://www.mediafire.com) ## Introduction From b7e0ae6a54dbcab21f917df9cb8fca36323c077f Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Tue, 12 Mar 2013 20:51:09 +0800 Subject: [PATCH 28/32] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9b95c09..4901e94 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ A beautiful demo is worth a thousand words: - **Scientific Paper**: [Default](http://coolwanglu.github.com/pdf2htmlEX/demo/demo.html) / [MediaFire](http://www.mediafire.com/view/?6po429kz9czcga2) / [Original](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.148.349&rep=rep1&type=pdf) - **Full Circle Magazine**: [Default](http://coolwanglu.github.com/pdf2htmlEX/demo/issue65_en.html) / [MediaFire](http://www.mediafire.com/view/?6hxmt94k2vppnpb) / [Original](http://dl.fullcirclemagazine.org/issue65_en.pdf) The 1st link might be slow - **Chinese**: [Default](http://coolwanglu.github.com/pdf2htmlEX/demo/chn.html) / [MediaFire](http://www.mediafire.com/view/?6550ldag9w0uuq3) / [Original](http://files.cnblogs.com/phphuaibei/git%E6%90%AD%E5%BB%BA.pdf) -- **More**(http://www.mediafire.com/?clnnit9kn3vf9) +- [**More**](http://www.mediafire.com/?clnnit9kn3vf9) - You can [upload your own files](http://www.mediafire.com/filedrop/filedrop_hosted.php?drop=b9da314994a5e9af384dfd020fe8280e0d2e425d0870dc5edcca272e9fdc7d43) to this public folder - Do not upload inpropriate materials (include but not limited to: private, copyrighted, illegal, threatening etc). - The folder may be cleaned periodically, but you cannot removed any file once uploaded. From 928f19e7eb2c2236de6226bce584ccae72a27742 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Tue, 12 Mar 2013 21:04:32 +0800 Subject: [PATCH 29/32] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4901e94..85cc04c 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,8 @@ A beautiful demo is worth a thousand words: - **Full Circle Magazine**: [Default](http://coolwanglu.github.com/pdf2htmlEX/demo/issue65_en.html) / [MediaFire](http://www.mediafire.com/view/?6hxmt94k2vppnpb) / [Original](http://dl.fullcirclemagazine.org/issue65_en.pdf) The 1st link might be slow - **Chinese**: [Default](http://coolwanglu.github.com/pdf2htmlEX/demo/chn.html) / [MediaFire](http://www.mediafire.com/view/?6550ldag9w0uuq3) / [Original](http://files.cnblogs.com/phphuaibei/git%E6%90%AD%E5%BB%BA.pdf) - [**More**](http://www.mediafire.com/?clnnit9kn3vf9) - - You can [upload your own files](http://www.mediafire.com/filedrop/filedrop_hosted.php?drop=b9da314994a5e9af384dfd020fe8280e0d2e425d0870dc5edcca272e9fdc7d43) to this public folder + - You can [upload your own files](http://www.mediafire.com/filedrop/iledrop_hosted.php?drop=b9da314994a5e9af384dfd020fe8280e0d2e425d0870dc5edcca272e9fdc7d43) to this public folder + - Everyone will be able to view your file! - Do not upload inpropriate materials (include but not limited to: private, copyrighted, illegal, threatening etc). - The folder may be cleaned periodically, but you cannot removed any file once uploaded. - Hosted on [MediaFire](http://www.mediafire.com) From 5e674d71bada97063c50efeb6bd3213275eb7f3a Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Tue, 12 Mar 2013 21:18:44 +0800 Subject: [PATCH 30/32] Update README.md --- README.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 85cc04c..3611640 100644 --- a/README.md +++ b/README.md @@ -10,12 +10,8 @@ A beautiful demo is worth a thousand words: - **Full Circle Magazine**: [Default](http://coolwanglu.github.com/pdf2htmlEX/demo/issue65_en.html) / [MediaFire](http://www.mediafire.com/view/?6hxmt94k2vppnpb) / [Original](http://dl.fullcirclemagazine.org/issue65_en.pdf) The 1st link might be slow - **Chinese**: [Default](http://coolwanglu.github.com/pdf2htmlEX/demo/chn.html) / [MediaFire](http://www.mediafire.com/view/?6550ldag9w0uuq3) / [Original](http://files.cnblogs.com/phphuaibei/git%E6%90%AD%E5%BB%BA.pdf) - [**More**](http://www.mediafire.com/?clnnit9kn3vf9) - - You can [upload your own files](http://www.mediafire.com/filedrop/iledrop_hosted.php?drop=b9da314994a5e9af384dfd020fe8280e0d2e425d0870dc5edcca272e9fdc7d43) to this public folder - - Everyone will be able to view your file! - - Do not upload inpropriate materials (include but not limited to: private, copyrighted, illegal, threatening etc). - - The folder may be cleaned periodically, but you cannot removed any file once uploaded. - - Hosted on [MediaFire](http://www.mediafire.com) - + - [Try your own files](https://github.com/coolwanglu/pdf2htmlEX/wiki/UploadDemo) + ## Introduction pdf2htmlEX renders PDF files in HTML, utilizing modern Web technologies. From c215b78f1b43f7f41ecb503d1bc4365a7161e870 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Tue, 12 Mar 2013 21:26:31 +0800 Subject: [PATCH 31/32] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 3611640..1c57807 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,7 @@ A beautiful demo is worth a thousand words: - **Scientific Paper**: [Default](http://coolwanglu.github.com/pdf2htmlEX/demo/demo.html) / [MediaFire](http://www.mediafire.com/view/?6po429kz9czcga2) / [Original](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.148.349&rep=rep1&type=pdf) - **Full Circle Magazine**: [Default](http://coolwanglu.github.com/pdf2htmlEX/demo/issue65_en.html) / [MediaFire](http://www.mediafire.com/view/?6hxmt94k2vppnpb) / [Original](http://dl.fullcirclemagazine.org/issue65_en.pdf) The 1st link might be slow - **Chinese**: [Default](http://coolwanglu.github.com/pdf2htmlEX/demo/chn.html) / [MediaFire](http://www.mediafire.com/view/?6550ldag9w0uuq3) / [Original](http://files.cnblogs.com/phphuaibei/git%E6%90%AD%E5%BB%BA.pdf) -- [**More**](http://www.mediafire.com/?clnnit9kn3vf9) - - [Try your own files](https://github.com/coolwanglu/pdf2htmlEX/wiki/UploadDemo) +- [Try your own files](https://github.com/coolwanglu/pdf2htmlEX/wiki/UploadDemo) ## Introduction From b6ba80a026aa27a17a2e2efcda930a0d9eda856d Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Fri, 15 Mar 2013 14:45:01 +0800 Subject: [PATCH 32/32] todo --- TODO | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/TODO b/TODO index 7af0e14..d279edb 100644 --- a/TODO +++ b/TODO @@ -1,12 +1,11 @@ -cheat.html on IE - == Future: == Too difficult/complicated to implement: - integrate splash/cairo - - naive support for image/drawing (SVG?) + - naive image/drawing (SVG?) - type 3 fonts (convert to SVG fonts?) - reflowable text/combine lines/unwrapping + - multi-thread Not enough motivated/Lazy - argument auto-completion