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

added mention when encountering unsupported field + some stylistic changes

This commit is contained in:
Simon Chenard 2015-01-16 15:23:38 -05:00
parent f284a8aabe
commit db10f6744a
2 changed files with 28 additions and 25 deletions

View File

@ -267,17 +267,15 @@ Viewer.prototype = {
var r = elements[i];
r.addEventListener('click', function() {
if(this.className.search("checked") == -1)
this.className += " checked";
if(!this.classList.contains("checked"))
this.classList.add("checked");
else
this.className = "ir";
this.classList.remove("checked");
});
}
},
init_after_loading_content : function() {
this.initialize_radio_button();
this.sidebar = document.getElementById(this.config['sidebar_id']);
this.outline = document.getElementById(this.config['outline_id']);
this.container = document.getElementById(this.config['container_id']);
@ -329,6 +327,7 @@ Viewer.prototype = {
ele.addEventListener('click', self.link_handler.bind(self), false);
});
this.initialize_radio_button();
this.render();
},

View File

@ -44,30 +44,34 @@ void HTMLRenderer::process_form(ofstream & out)
{
font_size = height / 2;
out
<< "<input id=\"text-" << pageNum << "-"
<< i << "\" type=\"text\" value=\"\""
<< " style=\"position: absolute; left: " << x1
<< "px; bottom: " << y1 << "px;"
<< " width: " << width << "px; height: " << std::to_string(height)
<< "px; line-height: " << std::to_string(height) << "px; font-size: "
<< font_size << "px;\" class=\""
<< CSS::INPUT_TEXT_CN << "\" />" << endl;
}
if(w->getType() == formButton)
out << "<input id=\"text-" << pageNum << "-" << i
<< "\" class=\"" << CSS::INPUT_TEXT_CN
<< "\" type=\"text\" value=\"\""
<< " style=\"position: absolute; left: " << x1
<< "px; bottom: " << y1 << "px;"
<< " width: " << width << "px; height: " << std::to_string(height)
<< "px; line-height: " << std::to_string(height) << "px; font-size: "
<< font_size << "px;\" />" << endl;
}
else if(w->getType() == formButton)
{
//Ideally would check w->getButtonType()
//for more specific rendering
width += 3;
height += 3;
out
<< "<div id=\"cb-" << pageNum << "-" << i << "\""
<< " style=\"position: absolute; left: " << x1
<< "px; bottom: " << y1 << "px;"
<< " width: " << width << "px; height: "
<< std::to_string(height) << "px; background-size: cover;\" class=\""
<< CSS::INPUT_RADIO_CN << "\"></div>" << endl;
out << "<div id=\"cb-" << pageNum << "-" << i
<< "\" class=\"" << CSS::INPUT_RADIO_CN
<< "\" style=\"position: absolute; left: " << x1
<< "px; bottom: " << y1 << "px;"
<< " width: " << width << "px; height: "
<< std::to_string(height) << "px; background-size: cover;\" ></div>" << endl;
}
else if(w->getType() == formChoice ||
w->getType() == formSignature ||
w->getType() == formUndef)
{
cerr << "Unsupported form field detected" << endl;
}
}
}