Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$data = $pdf->getDataFields(); is Boolean #99

Closed
TomGranot opened this issue Jan 3, 2018 · 2 comments
Closed

$data = $pdf->getDataFields(); is Boolean #99

TomGranot opened this issue Jan 3, 2018 · 2 comments

Comments

@TomGranot
Copy link

TomGranot commented Jan 3, 2018

Hiya, and thanks for this library! Great help.

As the title suggests - $data = $pdf->getDataFields() gives $data a boolean value, according to php's gettype(). Shouldn't it be an array with the loaded pdf's form fields?

Specifically, if I try to get the data as an array - as per the readme.md file, I get this:

Fatal error: Uncaught Error: Call to a member function __toArray() on boolean

Edit: Got a hint - it's not loading pdftk properly: sh: pdftk: command not found. If it doesn't find the executable, should getDataFields() return a boolean?

2nd Edit: rephrasing question - now i've told the library where the executable is as per this issue, but the script just gets stuck - I can see it's loading, but it never finishes. Thought this might have something to do with this, not sure where this stands right now, and if you rolled back the changes or not. I'll try this tomorrow as well, hope it fixes it.

On a side note - looking through the issues I'm realising how much you guys maintain this thing. Again, thank you, truly - if I'd have to write this from scratch it would be a real pain.

@mikehaertl
Copy link
Owner

Did you try with raw pdftk on the command line? Does it work there with the same PDF file?

@TomGranot
Copy link
Author

TomGranot commented Jan 5, 2018

OK, seems like pdftk itself hangs for eternity when trying to perform any action. This solved it. That is a 2013 version of the software, which I hope is compatible with your library. Thanks, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants