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