Yes this is possible, and will not be fun to do in php.
But here are the concepts of this:
Eventually, you can reduce your solution to be more efficient. But for now to understand the process, do this:
userUploadFile => uncompress pdf and output to temporary folder(in .txt) (also validate the file) => parse the file => output in the form you want AND delete temporary file