Files
2026-04-28 21:15:09 +03:00

54 lines
1.8 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<link rel="stylesheet" href="../../style.css" />
<script src="../../../lib/webviewer.min.js"></script>
<script src="../../old-browser-checker.js"></script>
<script src="../../global.js"></script>
<title>Find Text Position in JavaScript PDF Viewer</title>
<script src="../../modernizr.custom.min.js"></script>
</head>
<body>
<header>
<div class="title sample">Text Position Demo for PDF Viewer</div>
</header>
<aside>
<h1>Controls</h1>
<h2>Text:</h2>
<input id="text" type="text" value="this" style="width: 100%; padding: 2px" />
<br />
<h2>Applied pages:</h2>
<div id="pages"></div>
<hr />
<h1>Instructions</h1>
<p>Use input field to set the text (case sensitive) and the buttons to locate them in pages. This sample creates highlight annotation on top of them to visually show.</p>
</aside>
<div id="viewer"></div>
<script src="../../menu-button.js"></script>
<!--ga-tag-->
<script>
Modernizr.addTest('async', function() {
try {
var result;
eval('let a = () => {result = "success"}; let b = async () => {await a()}; b()');
return result === 'success';
} catch (e) {
return false;
}
});
// test for async and fall back to code compiled to ES5 if they are not supported
['debounce.js', 'text-position.js'].forEach(function(js) {
var script = Modernizr.async ? js : js.replace('.js', '.ES5.js');
var scriptTag = document.createElement('script');
scriptTag.src = script;
scriptTag.type = 'text/javascript';
document.getElementsByTagName('head')[0].appendChild(scriptTag);
});
</script>
</body>
</html>