pdf-official

Solid

Generating 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

View on GitHub

Quality Score: 82/100

Stars 20%
50
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

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