Skip to main content
Known Participant
Mar 17, 2022 5:38 PM UTC
Question

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

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 is closed to new replies. Start a new post to keep the conversation going.

5 replies

try67
Community Expert
Community Expert
Mar 18, 2022 10:12 AM UTC

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

Translate
Bernd Alheit
Community Expert
Community Expert
Mar 17, 2022 7:45 PM UTC

Try a forum for jspdf.

Translate
Legend
Mar 17, 2022 6:30 PM UTC

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.

Translate
SamKhaMAuthor
Known Participant
Mar 17, 2022 7:04 PM UTC

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.

Translate
Legend
Mar 17, 2022 7:12 PM UTC

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. 

Translate