How to extract field value from PDF form in PHP

2019-02-06 15:17发布

We are developing PHP & MySQL based application. We distribute a registration form in PDF format. After filling form, user will upload PDF form to our application to register. We want to extract registration data in PDF form from PHP and save these data to database.

Can someone point me PHP classes for extracting field value from PDF form?

1条回答
淡お忘
2楼-- · 2019-02-06 15:57

An alternative could be using an external program like http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/ and so something like:

$ pdftk file.pdf dump_data_fields

and then process the output. However, this would involve a lot of parsing logic and output processing. Plus, if you cannot install binaries on your server, never mind. :)

It might be just simpler to do as hoppa mentioned.

Edit: This question might be a duplicate of The best pratice to parse PDF forms fields with PHP5 that question has an interesting comment!

查看更多
登录 后发表回答