I am trying to develop a web page where I want to upload a PDF file to a web page, get the values of its fields then render them into the web page fields using JavaScript. I started with the following code but I can not get the value of the PDF fields. May I ask for a sample code on how to do this
HTML:
<html>
<head>
<script src="jquery-2.1.4.js"></script>
<script src="jspdf.min.js"></script>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<input type="file" id="file-id" name="file_name" onchange="ExtractText();">
<!-- a container for the output -->
<div id="output"></div>
<script>
function ExtractText() {
var input = document.getElementById("file-id");
var doc = new jsPDF(input.files[0]);
alert("1");
//var fReader = new FileReader();
//fReader.readAsDataURL(input.files[0]);
// console.log(input.files[0]);
//fReader.onloadend = function (event) {
//convertDataURIToBinary(event.target.result);
}
</script>
</body>
</html>
Last edited by a moderator: