0
試圖與pdfjs自動搜索,(且很難與文檔..)如何在運行pdfjs時運行javascript?
這個工程:
<input type="button" value="click-me" onclick="searchPDF('cpu');" />
這不(jQuery的OK運行)
$(document).ready(function() {
searchPDF('cpu');
});
如何在執行PDF文件之前暫停執行? (OR爲什麼不是它的工作)
改進viewer.html(感謝PDF.js - Using search function on embedded PDF)
// search with PDF.js
function searchPDF(td_text) {
//PDFView.findBar.open();
$('#findInput').val(td_text);
$("#tableDiv").focus();
PDFView.findBar.findNextButton.click();
var event = document.createEvent('CustomEvent');
event.initCustomEvent('find', true, true, {
query: td_text,
caseSensitive: $("#findMatchCase").prop('checked'),
highlightAll: $("#findHighlightAll").prop('checked'),
findPrevious: undefined
});
return event;
看看這個:[Mozilla](https://github.com/mozilla/pdf.js/issues/5601)或者這個[Stack](http://stackoverflow.com/questions/12693207/how-to-know - 如果-PDF-JS-有-完成渲染) – prizm1