I wrote a simple automation that will use msfvenom to create a malicious payload and then use metasploit to embed that into a pdf file. The code works as mentioned below:
Input Collection: Asks for Local Host IP Address Asks for final PDF name
Payload Generation: Using msfvenom, it creates an encrypted reverse TCP payload
Resource File Creation: Then it writes a metasploitable resource file (typically embed.rc) that tells metasploit to embed yourfilename.exe into a pdf.
PDF Embedding: The script launches msfconsole by itself with the resource file and generate the final pdf.
Output Location: For convenience, it shows the saved file location, which can also be customized.