[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EFSVHKKXPN8EK3EXBDEXRW":3,"skill-same:01M6EFSVHKKXPN8EK3EXBDEXRW":51},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":20,"frontMatter":21,"refName":22,"commitSha":23,"skillDirectory":24,"forksCount":25,"repositoryHtmlUrl":26,"repositoryHomepageUrl":27,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M6EFSVHKKXPN8EK3EXBDEXRW","pdfkit",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Fpdfkit\u002FSKILL.md",[],[5],"2026-11-10 10:12:30",false,"# PDFKit\n\nProgrammatic PDF generation for Node.js. Streaming architecture — write to files or HTTP responses.\n\n## Setup\n\n```bash\n# Install PDFKit for PDF generation.\nnpm install pdfkit\nnpm install -D @types\u002Fpdfkit\n```\n\n## Basic Document\n\n```typescript\n\u002F\u002F src\u002Fpdf\u002Fbasic.ts — Create a simple PDF with text and save to file.\nimport PDFDocument from \"pdfkit\";\nimport fs from \"fs\";\n\nconst doc = new PDFDocument({ size: \"A4\", margin: 50 });\ndoc.pipe(fs.createWriteStream(\"output.pdf\"));\n\ndoc.fontSize(24).text(\"Monthly Report\", { align: \"center\" });\ndoc.moveDown();\ndoc.fontSize(12).text(\"Generated on \" + new Date().toLocaleDateString());\ndoc.moveDown(2);\ndoc.fontSize(11).text(\n  \"Lorem ipsum dolor sit amet, consectetur adipiscing elit. \" +\n  \"Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\",\n  { align: \"justify\", lineGap: 4 }\n);\n\ndoc.end();\n```\n\n## Tables\n\n```typescript\n\u002F\u002F src\u002Fpdf\u002Ftable.ts — Draw a table with headers and rows.\n\u002F\u002F PDFKit has no built-in table; draw it with lines and positioned text.\nimport PDFDocument from \"pdfkit\";\n\nexport function drawTable(\n  doc: PDFKit.PDFDocument,\n  headers: string[],\n  rows: string[][],\n  startY: number\n) {\n  const colWidth = (doc.page.width - 100) \u002F headers.length;\n  const rowHeight = 25;\n  let y = startY;\n\n  \u002F\u002F Header row\n  doc.font(\"Helvetica-Bold\").fontSize(10);\n  headers.forEach((header, i) => {\n    doc.text(header, 50 + i * colWidth, y, { width: colWidth, align: \"left\" });\n  });\n\n  y += rowHeight;\n  doc.moveTo(50, y).lineTo(doc.page.width - 50, y).stroke();\n\n  \u002F\u002F Data rows\n  doc.font(\"Helvetica\").fontSize(10);\n  for (const row of rows) {\n    y += 5;\n    row.forEach((cell, i) => {\n      doc.text(cell, 50 + i * colWidth, y, { width: colWidth, align: \"left\" });\n    });\n    y += rowHeight;\n\n    \u002F\u002F Page break if needed\n    if (y > doc.page.height - 100) {\n      doc.addPage();\n      y = 50;\n    }\n  }\n}\n```\n\n## Images and Graphics\n\n```typescript\n\u002F\u002F src\u002Fpdf\u002Fgraphics.ts — Add images, draw shapes, and use vector graphics.\nimport PDFDocument from \"pdfkit\";\nimport fs from \"fs\";\n\nconst doc = new PDFDocument();\ndoc.pipe(fs.createWriteStream(\"report.pdf\"));\n\n\u002F\u002F Embed an image\ndoc.image(\"logo.png\", 50, 50, { width: 150 });\n\n\u002F\u002F Draw a colored rectangle\ndoc.rect(50, 250, 200, 100).fill(\"#3498db\");\n\n\u002F\u002F Draw a circle\ndoc.circle(400, 300, 50).fill(\"#e74c3c\");\n\n\u002F\u002F Draw a line\ndoc.moveTo(50, 400).lineTo(550, 400).dash(5, { space: 5 }).stroke(\"#999\");\n\ndoc.end();\n```\n\n## Headers and Footers\n\n```typescript\n\u002F\u002F src\u002Fpdf\u002Fheaders.ts — Add repeating headers and footers with page numbers.\nimport PDFDocument from \"pdfkit\";\nimport fs from \"fs\";\n\nexport function createDocWithHeaderFooter(title: string, outputPath: string) {\n  const doc = new PDFDocument({ size: \"A4\", margin: 50, bufferPages: true });\n  doc.pipe(fs.createWriteStream(outputPath));\n\n  \u002F\u002F Write content across multiple pages\n  doc.fontSize(20).text(title, { align: \"center\" });\n  doc.moveDown(2);\n  for (let i = 0; i \u003C 200; i++) {\n    doc.fontSize(11).text(`Line ${i + 1}: Sample content for the report.`);\n  }\n\n  \u002F\u002F Add headers and footers to all pages\n  const pageCount = doc.bufferedPageRange().count;\n  for (let i = 0; i \u003C pageCount; i++) {\n    doc.switchToPage(i);\n\n    \u002F\u002F Header\n    doc.fontSize(8).fillColor(\"#999\")\n      .text(title, 50, 20, { align: \"left\" })\n      .text(new Date().toLocaleDateString(), 50, 20, { align: \"right\" });\n\n    \u002F\u002F Footer with page number\n    doc.text(`Page ${i + 1} of ${pageCount}`, 50, doc.page.height - 30, {\n      align: \"center\",\n    });\n  }\n\n  doc.end();\n}\n```\n\n## Custom Fonts\n\n```typescript\n\u002F\u002F src\u002Fpdf\u002Ffonts.ts — Register and use custom fonts for branded documents.\nimport PDFDocument from \"pdfkit\";\nimport fs from \"fs\";\n\nconst doc = new PDFDocument();\ndoc.pipe(fs.createWriteStream(\"branded.pdf\"));\n\n\u002F\u002F Register custom font\ndoc.registerFont(\"Inter\", \".\u002Ffonts\u002FInter-Regular.ttf\");\ndoc.registerFont(\"Inter-Bold\", \".\u002Ffonts\u002FInter-Bold.ttf\");\n\ndoc.font(\"Inter-Bold\").fontSize(24).text(\"Branded Report\");\ndoc.font(\"Inter\").fontSize(12).text(\"Using custom Inter font throughout.\");\n\ndoc.end();\n```\n\n## Streaming to HTTP Response\n\n```typescript\n\u002F\u002F src\u002Fpdf\u002Fstream.ts — Generate PDFs on the fly and stream to Express responses.\nimport PDFDocument from \"pdfkit\";\nimport type { Response } from \"express\";\n\nexport function streamPdf(res: Response, title: string) {\n  const doc = new PDFDocument();\n  res.setHeader(\"Content-Type\", \"application\u002Fpdf\");\n  res.setHeader(\"Content-Disposition\", `attachment; filename=\"${title}.pdf\"`);\n\n  doc.pipe(res);\n  doc.fontSize(20).text(title);\n  doc.end();\n}\n```\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002FTerminalSkills\u002Fskills\u002Fpdfkit",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill pdfkit",{"tool":37,"command":38},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill pdfkit",{"tool":40,"command":41},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill pdfkit","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Fpdfkit\u002FSKILL.md",true,[45],{"path":46,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":50},"customize.toml","OTHER","其他",1738,"https:\u002F\u002Fgithub.com\u002FdevelopAgent\u002Fbmad-start\u002Fblob\u002Fmain\u002F.qwen\u002Fskills\u002Fbmad-cis-agent-creative-problem-solver\u002Fcustomize.toml",[52,61,70,79,85,91],{"skillNo":53,"name":54,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":18},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[58,59,60],"model","model hierarchy","model hierarchy skill",{"skillNo":62,"name":63,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":18},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[67,68,69],"MCP","zoom","zoom mcp",{"skillNo":71,"name":72,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":18},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[76,77,78,68],"sdk","zoom apps sdk","apps",{"skillNo":80,"name":81,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":18},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[81],{"skillNo":86,"name":87,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":18},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[87],{"skillNo":92,"name":93,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":18},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[93]]