Yes, it is possible, I have published a detailed video tutorial on how to extract details from pdf attachments in Gmail and how to arrange the data in a Google sheet. The simplistic source code is here on GitHub:
https://gist.github.com/moayadhani/9bc8e4f59b2f09c574cf061127d72800