How to upload a PDF file to a web page, get the PDF fields values and render them into the same web page fields using JavaScript

Which product are you using?

Visual Studio Code
PDF.js Express Version

Detailed description of issue
{I am trying to develop a web page where I want to upload a PDF file to this web page, get the values of the PDF fields then insert them into the web page fields using JavaScript. May I ask for a sample code on how to do this

I tried the following code but did not work}

Expected behaviour
{Provide a screenshot or description of the expected behaviour}

Does your issue happen with every document, or just one?
{Answer here}

Link to document
{Provide a link to the document in question if possible}

Code snippet
{

<head>

    <script src="https://cdn.jsdelivr.net/npm/pdfjs-dist@2.13.216/build/pdf.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");    

            //alert(input.files[0].name);

            pdfjsLib.getDocument('./SamplePDF.pdf').then(doc=>{

                console.log("This PDF has "+doc._pdfInfo.numPages+" pages");

            });

        }

    </script>

</body>
}

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

Hi There,

I see that you’re using the PDF.js library.
This forum is specifically for support of our product PDF.js Express, so, unfortunately, we cannot help you with this.

Thanks,

Dandara

Hi, I do not mind using any other SW to get the function delivered. Are the above requirements can be done with PDF.js Express