Skip to content

pdfbolt/playwright-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎭 Playwright PDF Examples

Practical, runnable examples of generating PDFs with Playwright.


Invoice Generator

Playwright Badge Node.js Badge EJS Badge HTML5 Badge

This example generates an invoice PDF using Playwright, Node.js, and EJS templates. EJS templates are HTML files with placeholders for dynamic content, so you can render the same layout with different data on each run.

Example Output

Invoice example generated using Playwright

Repository Structure

invoice-generator/
├── data/                     // Data files
│   └── invoice-data.json     // Invoice data
├── templates/                // HTML templates
│   └── invoice.ejs           // EJS template for the invoice
├── generate-invoice.js       // Script that generates the PDF
└── package.json              // Project configuration

How to Run

1. Clone the repository

git clone https://github.com/pdfbolt/playwright-examples.git

2. Open the invoice generator directory

cd invoice-generator

3. Install dependencies

Make sure Node.js is installed, then run:

npm install

4. Run the script

node generate-invoice.js

5. View the output

The PDF is saved in the invoice-generator directory as:

invoice-<timestamp>.pdf

Full Tutorial

For a detailed walkthrough, see the accompanying article: How to Generate PDFs in 2025

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors