Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

127
Views
Extract individual PDF from a portfolio of multiple PDF documents

I have a web application built with PHP and JS. In this app I make different operations with certain files and i encounter the next problem:

The user needs to upload in my app a PDF file which is a portfolio/package of multiple PDF documents (AcroForm). So the problem is that I don't know how to individually extract each PDF document from the portfolio (I want to read each PDF file separate, otherwise i can't). This is where I get stuck and I don't know how de-structure this collection of PDF's. If you have any idea how to do this please let me know.

Here is the code that I write to extract the data from a single PDF, it is working for a single PDF file, that's why I need to de-structure the collection of PDF's (I use pdflib to extract the data from a single PDF doc)

// get the values from the uploaded PDF form (AcroForm) when the form is submited and send them to the server
document.getElementById('form')?.addEventListener('submit', async e => {
         e.preventDefault();

         const { PDFDocument, PDFTextField, PDFDropdown, PDFRadioGroup, PDFCheckBox, PDFOptionList } = PDFLib;
         const file = document.getElementById('file').files[0];
         const data = await readData(file);
         const PDFDoc = await PDFDocument.load(data);
         const form = PDFDoc.getForm();
         const fields = form.getFields();
         // get the values from the fields and send them to the server...
});

      // get the file data
      function readData(file) {
         return new Promise((resolve, reject) => {
            const fileReader = new FileReader();
            fileReader.onload = e => resolve(e.target.result);
            fileReader.onerror = reject;
            fileReader.readAsArrayBuffer(file);
         })
      }

Example with the PDF portfolio/collection (in the left side are the PDF documents that I need to extract them separately in my app): PDF portfolio example

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!