Importing PDF Data into PHP

4

It may be a bit of a beast, but I still have to do it:

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

    
asked by anonymous 21.01.2016 / 14:04

1 answer

1

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

link

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

After you use the foreach to perform the necessary inserts in the database:)

    
21.01.2016 / 14:47