$120 tested Claude codes · real before/after data · Full tier $15 one-timebuy --sheet=15 →
$Free 40-page Claude guide — setup, 120 prompt codes, MCP servers, AI agents. download --free →
clskills.sh — terminal v2.4 — 2,347 skills indexed● online
[CL]Skills_
PDF GenerationintermediateNew

Invoice PDF

Share

Generate professional invoice PDFs with line items

Works with OpenClaude

You are a PDF generation specialist. The user wants to generate professional invoice PDFs with line items, company details, and itemized pricing.

What to check first

  • Install pdfkit and bwip.js (barcode support): npm install pdfkit bwip.js
  • Verify Node.js version supports Buffer operations: node --version (v14+)
  • Check that your invoice data structure includes: invoiceNumber, date, client details, line items with quantity/rate, and totals

Steps

  1. Import PDFKit and create a document stream writing to a file path
  2. Set up page dimensions (8.5×11 inches at 72 DPI for US Letter)
  3. Add header section with company logo/name, address, and contact info
  4. Insert invoice metadata (invoice number, date, due date) in top-right corner
  5. Create bill-to and ship-to sections with client details
  6. Build a table structure for line items with columns: description, quantity, unit price, amount
  7. Calculate and display subtotal, tax, and total amounts
  8. Add footer with payment terms, notes, and optional barcode
  9. Finalize and close the PDF stream

Code

const PDFDocument = require('pdfkit');
const fs = require('fs');
const bwip = require('bwip.js');

async function generateInvoicePDF(invoiceData, outputPath) {
  const doc = new PDFDocument({ size: 'Letter', margin: 50 });
  const stream = fs.createWriteStream(outputPath);
  doc.pipe(stream);

  // Header
  doc.fontSize(24).font('Helvetica-Bold').text('INVOICE', 50, 50);
  doc.fontSize(10).font('Helvetica').text('Acme Corp', 50, 90);
  doc.text('123 Business St, Suite 100');
  doc.text('New York, NY 10001');
  doc.text('contact@acme.com | (555) 123-4567');

  // Invoice metadata (right-aligned)
  const metaX = 400;
  doc.fontSize(10).font('Helvetica-Bold').text('Invoice #:', metaX, 50);
  doc.font('Helvetica').text(invoiceData.invoiceNumber, metaX + 80, 50);
  doc.font('Helvetica-Bold').text('Date:', metaX, 70);
  doc.font('Helvetica').text(new Date(invoiceData.date).toLocaleDateString(), metaX + 80, 70);
  doc.font('Helvetica-Bold').text('Due Date:', metaX, 90);
  doc.font('Helvetica').text(new Date(invoiceData.dueDate).toLocaleDateString(), metaX + 80, 90);

  // Bill To
  doc.fontSize(11).

Note: this example was truncated in the source. See the GitHub repo for the latest full version.

Common Pitfalls

  • Treating this skill as a one-shot solution — most workflows need iteration and verification
  • Skipping the verification steps — you don't know it worked until you measure
  • Applying this skill without understanding the underlying problem — read the related docs first

When NOT to Use This Skill

  • When a simpler manual approach would take less than 10 minutes
  • On critical production systems without testing in staging first
  • When you don't have permission or authorization to make these changes

How to Verify It Worked

  • Run the verification steps documented above
  • Compare the output against your expected baseline
  • Check logs for any warnings or errors — silent failures are the worst kind

Production Considerations

  • Test in staging before deploying to production
  • Have a rollback plan — every change should be reversible
  • Monitor the affected systems for at least 24 hours after the change

Quick Info

Difficultyintermediate
Version1.0.0
AuthorClaude Skills Hub
pdfinvoicesbusiness

Install command:

curl -o ~/.claude/skills/invoice-pdf.md https://claude-skills-hub.vercel.app/skills/pdf/invoice-pdf.md

Related PDF Generation Skills

Other Claude Code skills in the same category — free to download.

Want a PDF Generation skill personalized to YOUR project?

This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.