Importing PDF Data in PHP


It might be a silly question, but I still need to ask:

Is it possible to import data from a pdf file in php and save it in mysql database?


A very cool and interesting way is to use this Git project:

include ('../pdf.php');
if ($argc<2)
    echo "\n\tphp -f pdf2text.php filename.pdf\n\n";
$pdf = new Pdf($argv[1]);
foreach ($pdf->getStreams() as $obj)
    echo $obj->getValue()->toString();

then you use foreach to perform the appropriate inserts in the bank 🙂

Scroll to Top