diff --git a/share/pdf2htmlEX.js.in b/share/pdf2htmlEX.js.in index 1d43555..283dd99 100644 --- a/share/pdf2htmlEX.js.in +++ b/share/pdf2htmlEX.js.in @@ -15,7 +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@', - link : '@CSS_LINE_CN@', + link : '@CSS_LINK_CN@', __dummy__ : 'no comma' }; @@ -146,7 +146,7 @@ var pdf2htmlEX = (function(){ //this.zoom_fixer(); // used by outline/annot_link etc - $([this.container, this.outline]).on('click', '.'+CSS_CLASS_NAMES['link'], this, this.link_handler); + this.container.add(this.outline).on('click', '.'+CSS_CLASS_NAMES['link'], this, this.link_handler); this.render(); }, @@ -248,6 +248,7 @@ var pdf2htmlEX = (function(){ }, link_handler : function (e) { + console.log('here'); var _ = e.data; var t = $(e.currentTarget); diff --git a/src/HTMLRenderer/font.cc b/src/HTMLRenderer/font.cc index b128626..62fd9d1 100644 --- a/src/HTMLRenderer/font.cc +++ b/src/HTMLRenderer/font.cc @@ -26,6 +26,7 @@ #include "util/ffw.h" #include "util/path.h" #include "util/unicode.h" +#include "util/css_const.h" namespace pdf2htmlEX { @@ -726,7 +727,7 @@ void HTMLRenderer::export_remote_font(const FontInfo & info, const string & suff } f_css.fs << "@font-face{" - << "font-family:f" << info.id << ";" + << "font-family:" << CSS::FONT_NAME_CN << info.id << ";" << "src:url("; { @@ -748,13 +749,13 @@ void HTMLRenderer::export_remote_font(const FontInfo & info, const string & suff f_css.fs << ")" << "format(\"" << format << "\");" << "}" // end of @font-face - << ".f" << info.id << "{" - << "font-family:f" << info.id << ";" + << "." << CSS::FONT_NAME_CN << info.id << "{" + << "font-family:" << CSS::FONT_NAME_CN << info.id << ";" << "line-height:" << round(info.ascent - info.descent) << ";" << "font-style:normal;" << "font-weight:normal;" << "visibility:visible;" - << "}" // end of .f + << "}" << endl; } @@ -771,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 << ".f" << fn_id << "{font-family:sans-serif;visibility:hidden;}" << endl; + f_css.fs << "." << CSS::FONT_NAME_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 << ".f" << info.id << "{"; + f_css.fs << "." << CSS::FONT_NAME_CN << info.id << "{"; f_css.fs << "font-family:" << ((cssfont == "") ? (original_font_name + "," + general_font_family(font)) : cssfont) << ";"; string fn = original_font_name; @@ -802,4 +803,4 @@ void HTMLRenderer::export_local_font(const FontInfo & info, GfxFont * font, cons f_css.fs << "}" << endl; } -} //namespace pdf2hmlEX +} //namespace pdf2htmlEX diff --git a/src/HTMLRenderer/general.cc b/src/HTMLRenderer/general.cc index 4da7f4a..cda2d5d 100644 --- a/src/HTMLRenderer/general.cc +++ b/src/HTMLRenderer/general.cc @@ -170,7 +170,8 @@ void HTMLRenderer::startPage(int pageNum, GfxState *state, XRef * xref) << " " << CSS::HEIGHT_CN << height_manager.get_id() << "\">" << "