A professional, automated resume generator that converts HTML templates into high-quality PDF documents using Handlebars templating, SCSS styling, and Puppeteer.
- Template-Based: Use Handlebars templates for easy content management
- Automated PDF Generation: Convert HTML to PDF with a single command
- Professional Styling: SCSS support for modern, customizable designs
- Data-Driven: Separate data from presentation for easy updates
- Print-Optimized: Generated PDFs are print-ready with proper formatting
- Node.js (v14 or higher)
- npm or yarn
- Clone the repository:
git clone https://github.com/ToheedAsghar/html-resume-generator.git
cd html-resume-generator- Install dependencies:
npm install- Install Chrome for Puppeteer:
npx puppeteer browsers install chrome-
Edit Your Resume Data: Update
src/data.jswith your personal information, experience, education, projects, and skills. -
Customize the Template: Modify
src/index.hbsto change the HTML structure and layout. -
Style Your Resume: Edit
src/styles.scssto customize colors, fonts, and spacing. -
Generate PDF:
npm startOr run directly:
node index.jsYour resume will be generated as output/resume.pdf.
html-resume-generator/
├── index.js # Main script - orchestrates PDF generation
├── package.json # Project dependencies
├── src/
│ ├── data.js # Your resume data (JSON format)
│ ├── index.hbs # Handlebars HTML template
│ └── styles.scss # SCSS stylesheet
└── output/
└── resume.pdf # Generated PDF (auto-created)
Edit src/data.js:
module.exports = {
personalInfo: {
name: "Your Name",
email: "your.email@example.com",
github: "github.com/yourusername",
linkedin: "linkedin.com/in/yourusername",
},
professionalSummary: {
summary: "Your professional summary...",
},
// ... add more sections
};In index.js, modify the PDF options:
await page.pdf({
path: outputPath,
format: "A4", // Paper size
printBackground: true, // Include background colors
margin: {
top: "10mm",
bottom: "10mm",
left: "10mm",
right: "10mm",
},
});- Puppeteer: Headless Chrome for PDF generation
- Handlebars: Templating engine
- Sass: CSS preprocessor
- Fonts: Add Google Fonts or custom fonts in
styles.scss - Colors: Define color variables in SCSS for consistent theming
- Layout: Modify the Handlebars template for different section arrangements
- Page Breaks: Use CSS
page-break-afterorpage-break-insidefor multi-page resumes
- Run:
npx puppeteer browsers install chrome - This installs the Chrome binary needed by Puppeteer
Error: "Failed to deserialize params.printBackground"
- Ensure
printBackgroundis set totrue(boolean), not'true'(string) or1(number)
Missing closing parenthesis error
- Check all strings in
data.jsare properly closed with quotes
PDF not generating
- Ensure the
output/directory exists (created automatically) - Check that all dependencies are installed
- Verify Chrome is installed:
npx puppeteer browsers list
ISC
Toheed Asghar
- GitHub: @ToheedAsghar
- LinkedIn: Toheed Asghar
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
Give a ⭐️ if this project helped you!
Made with ❤️ by Toheed Asghar