Will you do this from a client session or do you want it to run as a scheduled script or via a perform script on server call?
Assuming that you want to do it from a client session, You can use Save as PDF with a $Path variable that specifies the name and location where the PDF will be created when you save it. You can use Get ( TemporaryPath ) to calculate a value for your $Path variable so that the PDF is saved to the temporary folder so that you do not leave the user with a copy of the PDF where they might need to delete it later.
You can then use the same $Path in the same script to insert the file into a container field using either insert file or insert PDF depending on whether you want to insert the PDF into an interactive container field or not.
There are details that I have not yet spelled out that may keep this from working for you, so if you still can't make this work, feel free to post follow up questions where I or another person can go into more detail in order to answer your questions.