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.