是否有可以将网页转换为PDF文档的客户端库?我使用过jspdf,但生成的pdf不保留格式化的html(类似标签应该是PDF格式的粗体).
我有一个大约有5000行的大桌子.我使用以下jquery片段在此表中搜索特定文本.
function searchTable(inputVal) {
var table = $('.table');
table.find('tr').each(function(index, row) {
var allCells = $(row).find('td');
if(allCells.length > 0) {
var found = false;
allCells.each(function(index, td) {
var regExp = new RegExp(inputVal, 'i');
if(regExp.test($(td).text())) {
found = true;
return false;
}
});
if(found == true) {
$(row).show();
} else {
$(row).hide();
}
}
});
}
Run Code Online (Sandbox Code Playgroud)
现在这个脚本需要一些时间来执行,因为它遍历每行的每个单元格.考虑到表中连续有6个单元格,迭代总数几乎是6*5000 = 30000!
是否有任何建议来优化此代码段?
Timestamp tsmp = Timestamp.valueOf("0302-02-20 00:00:00");
final DateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
System.out.println(df.format(tsmp));
Run Code Online (Sandbox Code Playgroud)
此代码段打印:0302-02-20 12:00:00 为什么会这样?有人可以解释一下吗?
我已经下载了vaadin面包店应用程序的源代码。它使用商业组件。但是,如果我从代码中删除了这些组件(如果可能的话),我可以使用代码并在不违反任何许可的情况下分发它吗?
谢谢