You can generate PDFs using val functions by using an external library like jsPDF.
Here’s a more comprehensive example that builds an invoice.