PDF Data Import in PHP

Asked

Viewed 1,369 times

4

It may be a stupid question, but I still have to ask:

You can import data from a file in pdf in the php and save in bank mysql?

  • 1

    Yes it is possible! do not say exactly without details whether it is with too much or too little work.

  • If it comes to it, it’s hard work...

  • Good morning, Can anyone tell me how ? Att,

  • As you want to know, it seems that the resolution is too wide and complex, which escapes the scope of the site (would become another tutorial).

  • 1

    It doesn’t have to be a Goal, but a start or even a link,.

  • I believe it doesn’t need to be a tutorial. I think a very complete answer from anyone who can help would be enough. It’s a good question and can help who also wants to know how to do it.

  • Already answering the second and easiest part of the question, if you import the data from the pdf file, you will be able to save in the database. Now the hard part of your question I don’t know how. I believe there will be someone here who can help.

  • 1
  • Check out this library http://www.pdfparser.org

Show 4 more comments

1 answer

1


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

https://github.com/angeloskath/Pdf-to-text-via-PHP

<?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();
}
?>

then vc use the foreach to realize the proper Inserts in the bank :)

  • This is done via the right command line?

  • 1

    Okay, thank you very much.

  • @Otaciobarbosa, managed to solve the problem?

  • 1

    This is an example already in the documentation

  • 1

    Deivison Francisco, giving yes, was exactly what he was looking for, after the ready show the documentation. Thank you for the information.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.