nisaacson / pdf-extract

Node PDF Extract
MIT License
383 stars 76 forks source link

an error occurred while splitting pdf into single pages with the pdftk burst command #36

Open Amor-Fairouz opened 4 years ago

Amor-Fairouz commented 4 years ago

static extractTextFromPdf(pdf, options) {
    console.log('entred to exctract');
    pdf = pathe.resolve(pdf)

    return new Promise((resolve, reject) => {
      const processor = pdfExtract(pdf, { ...options, clean: true }, (err) => {
        if (err) {
          reject(err);
        }
      });
      processor.on('complete', (data) => {
        resolve(data.text_pages);
        console.log('good');
      });
      processor.on('error', (err) => {
        console.log(' error extractTextFromPdf ');
        reject(err);
      });
    });
  }
vogelino commented 4 years ago

It seems the pdfk link on their website isn't providing the latest installation package. See this issue on StackOverflow.

After installing the latest version of pdfk provided in the StackOverflow issue the problem should be solved!