php - Parsing multiple PDFs from text input with PDF Parser library -


i'm attempting use pdf parser php library parse text multiple pdfs submitted through form textarea (one pdf url per line).

the code i'm using is:

<?php include 'vendor/autoload.php'; $ids = $_post["textarea"]; foreach(explode("\n", $ids) $line) {     $parser = new \smalot\pdfparser\parser();     $pdf = $parser->parsefile($line);     $text = $pdf->gettext();                 echo $text . '<br />'; ?> 

note: 'vendor/autoload.php' composer file.

this works expected when put 1 url textarea, if put more 1 returns nothing. i'm not sure if there's wrong foreach loop or if library not support parsing multiple pdfs in loop... advice appreciated!


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -