ChatGPT Incorrect PDF Output via Railway - need help

We are using Railway to create a program where ChatGPT API outputs information from our prompt through Railway. We want the information to output to a PDF. However, when using ChatGPT to write the code, it is giving us errors with the PDF output. Specifically when trying to update the PDF layout. Has anyone had this issue? Can anyone help with this problem we are having? Thank you.