pdf-official
SolidGenerating PDFs with pdfkit or puppeteer in Node.js. Use when generating PDF reports, invoices, certificates, or any printable document from data or HTML templates.
Data & Documents 30 stars
9 forks Updated 5 days ago MIT
Install
Quality Score: 82/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# PDF Generation
## Option A — PDFKit (Programmatic)
Best for: invoices, receipts, structured data documents with precise control.
```bash
npm install pdfkit
npm install -D @types/pdfkit
```
```typescript
// lib/pdf/invoice-pdf.ts
import PDFDocument from 'pdfkit'
import { PassThrough } from 'stream'
export async function generateInvoicePdf(invoice: Invoice): Promise<Buffer> {
return new Promise((resolve, reject) => {
const doc = new PDFDocument({ margin: 50, size: 'A4' })
const chunks: Buffer[] = []
doc.on('data', chunk => chunks.push(chunk))
doc.on('end', () => resolve(Buffer.concat(chunks)))
doc.on('error', reject)
// ─── Header ──────────────────────────────────────────────
doc
.fillColor('#2563EB')
.fontSize(28)
.font('Helvetica-Bold')
.text('INVOICE', 50, 50)
doc
.fillColor('#6B7280')
.fontSize(10)
.font('Helvetica')
.text(`Invoice #${invoice.number}`, 50, 90)
.text(`Date: ${invoice.date.toLocaleDateString('en-US')}`, 50, 105)
.text(`Due: ${invoice.dueDate.toLocaleDateString('en-US')}`, 50, 120)
// Company info on the right
doc
.fillColor('#111827')
.fontSize(10)
.text('Full Stack HQ', 400, 50, { align: 'right' })
.text('123 Tech Street', 400, 65, { align: 'right' })
.text('contact@antigravity.dev', 400, 80, { align: 'right' })
// ─── Divider ─────────────────────────────────────────────
doc
.strokeColor('#E5...
Details
- Author
- sabahattink
- Repository
- sabahattink/antigravity-fullstack-hq
- Created
- 8 months ago
- Last Updated
- 5 days ago
- Language
- PowerShell
- License
- MIT
Integrates with
Similar Skills
Semantically similar based on skill content — not just same category
Data & Documents Listed
dev-document
Document generation (PDF, DOCX, XLSX, PPTX). Trigger when the user wants to create a document, generate a report, export to PDF/Word/Excel/PowerPoint, or produce an office file.
5 Updated today
christopherlouet Data & Documents Solid
xlsx-official
Generating Excel files with xlsx/exceljs in Node.js. Use when generating .xlsx reports, data exports, dashboards, or spreadsheets from database data.
30 Updated 5 days ago
sabahattink Data & Documents Solid
docx-official
Generating Word documents programmatically with docx library in Node.js. Use when generating .docx reports, contracts, invoices, or any structured Word document from data.
30 Updated 5 days ago
sabahattink