{"_id":"pptx-to-pdf","_rev":"4-501eae683b313209798cc11beb0f0b54","name":"pptx-to-pdf","dist-tags":{"latest":"0.1.3"},"versions":{"0.1.0":{"name":"pptx-to-pdf","version":"0.1.0","keywords":["pptx","pdf","powerpoint","converter","pptx-to-pdf","pure-js","no-libreoffice","typescript","presentation","office"],"license":"MIT","_id":"pptx-to-pdf@0.1.0","maintainers":[{"name":"ahmedessam05","email":"domysalem10@gmail.com"}],"homepage":"https://github.com/AhmedEssam/pptx-to-pdf#readme","bugs":{"url":"https://github.com/AhmedEssam/pptx-to-pdf/issues"},"dist":{"shasum":"c7930c19076468cdc7c2853ce6a3d3603b495dbb","tarball":"https://registry.npmjs.org/pptx-to-pdf/-/pptx-to-pdf-0.1.0.tgz","fileCount":183,"integrity":"sha512-Bktus/vg8rAkpcFfuy51l/sMVtYf1PKBvyjmkmBaZ3lY8hdbm2lCDRwv/mcNkL6xE1n1kIpWe15XuitRHIcCrw==","signatures":[{"sig":"MEQCIA+u7tQ/0/iT/ir9djkUSnqmKxDEH+uCuihnpCQjagqlAiAq0R+Qhx4qDDcuGCRrIDZXse/XH5nX0y67yNyyvR25sw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4710021},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=16"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"2a1f7611dae94351895b201713f64c19937db35a","scripts":{"test":"vitest run","build":"tsc","test:watch":"vitest","generate-fixtures":"tsx scripts/generate-fixtures.ts"},"_npmUser":{"name":"ahmedessam05","email":"domysalem10@gmail.com"},"repository":{"url":"git+https://github.com/AhmedEssam/pptx-to-pdf.git","type":"git"},"_npmVersion":"10.9.2","description":"Pure TypeScript PPTX-to-PDF converter — no LibreOffice, no native binaries","directories":{},"_nodeVersion":"22.16.0","dependencies":{"jszip":"^3.10.0","pdfkit":"^0.15.0","opentype.js":"^1.3.4","fast-xml-parser":"^4.5.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.0.0","vitest":"^2.0.0","pptxgenjs":"^3.12.0","typescript":"^5.5.0","@types/node":"^20.0.0","@types/pdfkit":"^0.13.0"},"_npmOperationalInternal":{"tmp":"tmp/pptx-to-pdf_0.1.0_1771977111592_0.41737125412219056","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"pptx-to-pdf","version":"0.1.1","keywords":["pptx","pdf","powerpoint","converter","pptx-to-pdf","pure-js","no-libreoffice","typescript","presentation","office"],"license":"MIT","_id":"pptx-to-pdf@0.1.1","maintainers":[{"name":"ahmedessam05","email":"domysalem10@gmail.com"}],"homepage":"https://github.com/ahmedcoder01/pptx-to-pdf#readme","bugs":{"url":"https://github.com/ahmedcoder01/pptx-to-pdf/issues"},"dist":{"shasum":"baa5b31be51250b16a374137121f77ef8a0fc0e3","tarball":"https://registry.npmjs.org/pptx-to-pdf/-/pptx-to-pdf-0.1.1.tgz","fileCount":183,"integrity":"sha512-eKE4GagcM4ftjNsCiw7ugsQFOehKgIL3sV9h7aWC84Phqwtj6cnnPCrx+7ukGcWUklldJye9ScDknMKWmLhf9g==","signatures":[{"sig":"MEYCIQDGnYkpxI87WBOSTbQ5WNRphT1TtsQjzoMUQvlyuGlh/QIhAJcJdE+6o8nRWeBUJ5aUK6uarTJvSICqpd61YgpNSjYo","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4710023},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=16"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"6b86353c2a46a3be19d1bc30bcea53a60e96be6a","scripts":{"test":"vitest run","build":"tsc","test:watch":"vitest","generate-fixtures":"tsx scripts/generate-fixtures.ts"},"_npmUser":{"name":"ahmedessam05","email":"domysalem10@gmail.com"},"repository":{"url":"git+https://github.com/ahmedcoder01/pptx-to-pdf.git","type":"git"},"_npmVersion":"10.9.2","description":"Pure TypeScript PPTX-to-PDF converter — no LibreOffice, no native binaries","directories":{},"_nodeVersion":"22.16.0","dependencies":{"jszip":"^3.10.0","pdfkit":"^0.15.0","opentype.js":"^1.3.4","fast-xml-parser":"^4.5.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.0.0","vitest":"^2.0.0","pptxgenjs":"^3.12.0","typescript":"^5.5.0","@types/node":"^20.0.0","@types/pdfkit":"^0.13.0"},"_npmOperationalInternal":{"tmp":"tmp/pptx-to-pdf_0.1.1_1771977317560_0.021314666533884363","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"pptx-to-pdf","version":"0.1.2","keywords":["pptx","pdf","powerpoint","converter","pptx-to-pdf","pure-js","no-libreoffice","typescript","presentation","office"],"license":"MIT","_id":"pptx-to-pdf@0.1.2","maintainers":[{"name":"ahmedessam05","email":"domysalem10@gmail.com"}],"homepage":"https://github.com/ahmedcoder01/pptx-to-pdf#readme","bugs":{"url":"https://github.com/ahmedcoder01/pptx-to-pdf/issues"},"dist":{"shasum":"1e39ddcf91bdbb95c0ff04b8cd1794dfdcce0bfb","tarball":"https://registry.npmjs.org/pptx-to-pdf/-/pptx-to-pdf-0.1.2.tgz","fileCount":183,"integrity":"sha512-ge8oCzECHdJqGPwFwEIpo2NeuQdjH4dSCIniNw5BFt3yj25evGUbWNkSZHQzBgMbMMK2lb3z/Mo2NeOOFI+4Ig==","signatures":[{"sig":"MEUCIQC06CVFbnKL1M7BPkBMAfQUn7ND8wZopwj6mEHcYELfbwIgXgzv6XikNqFy6M+miTLz+RoH4iMKm78fet/3qtBRe2w=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4710516},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=16"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"2b61f9ece1b87ef337b38ec9460f8713993d1cb6","scripts":{"test":"vitest run","build":"tsc","test:watch":"vitest","generate-fixtures":"tsx scripts/generate-fixtures.ts"},"_npmUser":{"name":"ahmedessam05","email":"domysalem10@gmail.com"},"repository":{"url":"git+https://github.com/ahmedcoder01/pptx-to-pdf.git","type":"git"},"_npmVersion":"10.9.2","description":"Pure TypeScript PPTX-to-PDF converter — no LibreOffice, no native binaries","directories":{},"_nodeVersion":"22.16.0","dependencies":{"jszip":"^3.10.0","pdfkit":"^0.15.0","opentype.js":"^1.3.4","fast-xml-parser":"^4.5.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.0.0","vitest":"^2.0.0","pptxgenjs":"^3.12.0","typescript":"^5.5.0","@types/node":"^20.0.0","@types/pdfkit":"^0.13.0"},"_npmOperationalInternal":{"tmp":"tmp/pptx-to-pdf_0.1.2_1772089567172_0.4291417738277996","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"pptx-to-pdf","version":"0.1.3","description":"Pure TypeScript PPTX-to-PDF converter — no LibreOffice, no native binaries","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","require":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"build":"tsc","test":"vitest run","test:watch":"vitest","generate-fixtures":"tsx scripts/generate-fixtures.ts"},"keywords":["pptx","pdf","powerpoint","converter","pptx-to-pdf","pure-js","no-libreoffice","typescript","presentation","office"],"license":"MIT","engines":{"node":">=16"},"repository":{"type":"git","url":"git+https://github.com/ahmedcoder01/pptx-to-pdf.git"},"dependencies":{"fast-xml-parser":"^4.5.0","jszip":"^3.10.0","opentype.js":"^1.3.4","pdfkit":"^0.15.0"},"devDependencies":{"@types/node":"^20.0.0","@types/pdfkit":"^0.13.0","pptxgenjs":"^3.12.0","tsx":"^4.0.0","typescript":"^5.5.0","vitest":"^2.0.0"},"_id":"pptx-to-pdf@0.1.3","gitHead":"78617f175eb05d7d453f8e948954ed79e6700329","bugs":{"url":"https://github.com/ahmedcoder01/pptx-to-pdf/issues"},"homepage":"https://github.com/ahmedcoder01/pptx-to-pdf#readme","_nodeVersion":"22.16.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-fImOLz2cCxUAzeLJaZWRu4ci1GLNPkeyvwSeLEdhngK7MyxlmF582sTQnTWusJmJSOIyLvS/t0sivHBvSifUzA==","shasum":"e07d9312fdcd414433629086dbf5bfbf1ee2b1d3","tarball":"https://registry.npmjs.org/pptx-to-pdf/-/pptx-to-pdf-0.1.3.tgz","fileCount":187,"unpackedSize":5259668,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDyTqBhwSymFu2HkaZMVkLes6o/nNJOoubGMuHPBf9hpQIge04BwlkZHAkLIUSbnAAoBCEPk3cIFT+33c7f4uLAu28="}]},"_npmUser":{"name":"ahmedessam05","email":"domysalem10@gmail.com"},"directories":{},"maintainers":[{"name":"ahmedessam05","email":"domysalem10@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pptx-to-pdf_0.1.3_1772091341825_0.29934016217101767"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-24T23:51:51.591Z","modified":"2026-02-26T07:35:42.208Z","0.1.0":"2026-02-24T23:51:51.891Z","0.1.1":"2026-02-24T23:55:17.836Z","0.1.2":"2026-02-26T07:06:07.416Z","0.1.3":"2026-02-26T07:35:42.093Z"},"bugs":{"url":"https://github.com/ahmedcoder01/pptx-to-pdf/issues"},"license":"MIT","homepage":"https://github.com/ahmedcoder01/pptx-to-pdf#readme","keywords":["pptx","pdf","powerpoint","converter","pptx-to-pdf","pure-js","no-libreoffice","typescript","presentation","office"],"repository":{"type":"git","url":"git+https://github.com/ahmedcoder01/pptx-to-pdf.git"},"description":"Pure TypeScript PPTX-to-PDF converter — no LibreOffice, no native binaries","maintainers":[{"name":"ahmedessam05","email":"domysalem10@gmail.com"}],"readme":"# pptx-to-pdf\n\nPure TypeScript PPTX-to-PDF converter. No LibreOffice. No native dependencies. Just buffer in, PDF out.\n\n```\nnpm install pptx-to-pdf\n```\n\n## Usage\n\n```typescript\nimport { convert } from 'pptx-to-pdf';\nimport fs from 'fs';\n\nconst pptx = fs.readFileSync('presentation.pptx');\nconst pdf = await convert(pptx);\nfs.writeFileSync('output.pdf', pdf);\n```\n\n## API\n\n### `convert(pptxBuffer, options?): Promise<Buffer>`\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `slides` | `number[]` | all | Slide indices to include (0-based) |\n| `fontDirs` | `string[]` | `[]` | Additional directories to search for fonts |\n| `fontMap` | `Record<string, string \\| Buffer>` | `{}` | Map font names to file paths or buffers |\n| `dpi` | `number` | `96` | Output resolution |\n| `onWarning` | `(msg: string) => void` | no-op | Callback for non-fatal warnings |\n\n## Examples\n\n### Specific slides only\n\n```typescript\nconst pdf = await convert(pptx, {\n  slides: [0, 2, 4], // first, third, and fifth slides\n});\n```\n\n### Custom fonts\n\n```typescript\nconst pdf = await convert(pptx, {\n  fontDirs: ['/usr/share/fonts/truetype'],\n  fontMap: {\n    'Calibri': '/path/to/calibri.ttf',\n    'Custom Font': fs.readFileSync('/path/to/custom.ttf'),\n  },\n});\n```\n\n### Express endpoint\n\n```typescript\napp.post('/convert', async (req, res) => {\n  const pdf = await convert(req.body);\n  res.type('application/pdf').send(pdf);\n});\n```\n\n### AWS Lambda\n\n```typescript\nexport const handler = async (event) => {\n  const pptx = Buffer.from(event.body, 'base64');\n  const pdf = await convert(pptx);\n  return {\n    statusCode: 200,\n    headers: { 'Content-Type': 'application/pdf' },\n    body: pdf.toString('base64'),\n    isBase64Encoded: true,\n  };\n};\n```\n\n## What it handles\n\n- Text with fonts, sizes, colors, bold/italic/underline\n- Shapes (rectangles, ellipses, arrows, rounded rects, and more)\n- Images (JPEG, PNG) including cropped images\n- Tables with cell backgrounds, borders, and text\n- Slide backgrounds (solid, gradient, image)\n- Theme colors and font schemes\n- Placeholder inheritance (slide -> layout -> master)\n- Group shapes with nested children\n- Connectors\n\n## What it doesn't handle (yet)\n\n- Charts\n- SmartArt\n- Animations and transitions\n- Audio/video\n- EMF/WMF vector graphics\n- 3D effects and complex text transforms\n- Pattern fills\n\n## How it works\n\nThe library parses the PPTX file (a ZIP archive of Office Open XML) and renders directly to PDF:\n\n1. **Extract** ZIP archive with `jszip`\n2. **Parse** all XML parts with `fast-xml-parser` (presentation, themes, masters, layouts, slides)\n3. **Resolve** the full inheritance chain (slide -> layout -> master -> theme) for transforms, fills, and text styles\n4. **Measure** text with `opentype.js` for accurate line breaking and layout\n5. **Render** to PDF with `pdfkit` (vector paths, embedded images, positioned text)\n\nNo intermediate HTML. No headless browser. No subprocess.\n\n## Fonts\n\nThe library bundles Liberation Sans, Liberation Serif, and Liberation Mono (~2.5MB) as metric-compatible fallbacks for Arial, Times New Roman, and Courier New. For better fidelity, provide the actual fonts via `fontDirs` or `fontMap`.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}