Skip to main content
Known Participant
March 17, 2022
Question

How to upload a PDF file from a webpage, get its fields values and render them into the same webpage

  • March 17, 2022
  • 3 replies
  • 695 views

I am trying to develop a web page where I want to upload a PDF file from 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>
<head>
<script src="jquery-2.1.4.js"></script>
<script src="jspdf.min.js"></script>
</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");
// Insert get doc field code here
var doc = new jsPDF(input.files[0]);
}
</script>
</body>
</html>

This topic has been closed for replies.

3 replies

try67
Community Expert
Community Expert
March 18, 2022

This has nothing to do with Acrobat, or any other Adobe software.

Bernd Alheit
Community Expert
Community Expert
March 17, 2022

Try a forum for jspdf.

Legend
March 17, 2022

This wouldn't a question of a little code to copy/paste. You need to install a PDF parsing library on the web site and write SERVER SIDE code to run it, as a web script. Then finally some simple HTML to call the web script.

SamKhaMAuthor
Known Participant
March 17, 2022

I do not need the whole code I just need to know which function and class I can use to get the PDF document. With the above script, I can upload the file but which class I can use to get this PDF so I can use the  getElementByName() function or a similar one.

Legend
March 17, 2022

I realise you want this to be something simple, but it isn't. This is a serious programming task which could take an experienced programmer several days. You need to do all of the steps I outlined.