I found some code from google.A tesseract
ocr working fine. But The problem is when i put url, frist time working good but second time run not working.After reload page then working. I wish to result without page reloading manually.
Demo Image:
Here Some Html:
<head>
<script src='https://cdn.rawgit.com/naptha/tesseract.js/1.0.10/dist/tesseract.js'></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
</head>
<body>
<input type="text" id="url" placeholder="Image URL" />
<input type="button" id="go_button" value="Run" />
<!--<div id="ocr_results"> </div>-->
<div id="ocr_status"> </div>
<div>
<label>Filed1
<label>
<textarea id="text"></textarea>
</div>
</body>
Here JavaScript:
function runOCR(url) {
Tesseract.recognize(url)
.then(function(result) {
document.getElementById("text").innerHTML = result.text;
}).progress(function(result) {
document.getElementById("ocr_status").innerText = result["status"] + " (" +
(result["progress"] * 100) + "%)";
});
}
document.getElementById("go_button").addEventListener("click", function(e) {
var url = document.getElementById("url").value;
runOCR(url);
});