There are multiple methods of creating a PDF file in Airtable. However, it cannot be done only with a script by itself. You can output data to a table and then use Page Designer or a document service to generate the PDF. Or you can use scripting to generate HTML that you send to a third party API to turn into a PDF. Or you can have your script integrate with Google Docs/Slides to create a PDF. These are three ways that I have used to generate PDF fields from a script, and there are probably others.
Think about your comfort level with scripting and the different technologies for creating PDF files and go with what makes sense to you.
If you're looking for a solution, Typeflow can help you quickly generate PDFs from Airtable data using Google Docs templates. It's straightforward and efficient.
Feel free to give it a try, and I'd love to hear your feedback! I'm also offering a lifetime plan for early users at just $100. Ping me if you're interested or have any questions.