{"id":44617154,"url":"https://github.com/hirokisakabe/pptx-glimpse","last_synced_at":"2026-05-30T14:00:40.763Z","repository":{"id":337819873,"uuid":"1153679640","full_name":"hirokisakabe/pptx-glimpse","owner":"hirokisakabe","description":"Render PowerPoint (.pptx) as SVG or PNG in Node.js. No LibreOffice required.","archived":false,"fork":false,"pushed_at":"2026-05-28T14:29:45.000Z","size":18146,"stargazers_count":4,"open_issues_count":14,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-28T16:16:07.791Z","etag":null,"topics":["converter","png","powerpoint","pptx","pptx-viewer","presentation","slides","svg","typescript"],"latest_commit_sha":null,"homepage":"https://glimpse.pptx.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hirokisakabe.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-09T15:18:36.000Z","updated_at":"2026-05-28T14:31:02.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/hirokisakabe/pptx-glimpse","commit_stats":null,"previous_names":["hirokisakabe/pptx-glimpse"],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/hirokisakabe/pptx-glimpse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirokisakabe%2Fpptx-glimpse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirokisakabe%2Fpptx-glimpse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirokisakabe%2Fpptx-glimpse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirokisakabe%2Fpptx-glimpse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hirokisakabe","download_url":"https://codeload.github.com/hirokisakabe/pptx-glimpse/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirokisakabe%2Fpptx-glimpse/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33694714,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-30T02:00:06.278Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["converter","png","powerpoint","pptx","pptx-viewer","presentation","slides","svg","typescript"],"created_at":"2026-02-14T13:10:44.558Z","updated_at":"2026-05-30T14:00:40.756Z","avatar_url":"https://github.com/hirokisakabe.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pptx-glimpse\n\n[![npm](https://img.shields.io/npm/v/pptx-glimpse)](https://www.npmjs.com/package/pptx-glimpse)\n[![CI](https://github.com/hirokisakabe/pptx-glimpse/actions/workflows/ci.yml/badge.svg)](https://github.com/hirokisakabe/pptx-glimpse/actions/workflows/ci.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Node.js](https://img.shields.io/badge/node-%3E%3D22-brightgreen)](https://nodejs.org/)\n\nNo LibreOffice required — just `npm install`.\n\nA lightweight JavaScript library that renders PowerPoint (.pptx) slides as SVG or PNG in Node.js.\n\n**[Try the Demo](https://glimpse.pptx.app/)** | [npm](https://www.npmjs.com/package/pptx-glimpse)\n\n![pptx-glimpse demo](https://raw.githubusercontent.com/hirokisakabe/pptx-glimpse/main/docs/demo.gif)\n\n_Upload a .pptx file → get SVG/PNG output instantly_\n\n|                                                   PowerPoint                                                   |                                                    pptx-glimpse                                                    |\n| :------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------: |\n| ![PowerPoint](https://raw.githubusercontent.com/hirokisakabe/pptx-glimpse/main/docs/comparison-powerpoint.png) | ![pptx-glimpse](https://raw.githubusercontent.com/hirokisakabe/pptx-glimpse/main/docs/comparison-pptx-glimpse.png) |\n\n## Motivation\n\npptx-glimpse is designed for two primary use cases:\n\n- **Frontend PPTX preview** — Render slide thumbnails without depending on\n  Microsoft Office or LibreOffice. The SVG output can be embedded directly\n  in web pages.\n- **AI image recognition** — Convert slides to PNG so that vision-capable LLMs\n  can understand slide content and layout.\n\nThe library focuses on accurately reproducing text, shapes, and spatial layout\nrather than pixel-perfect rendering of every PowerPoint feature.\n\n## Why not LibreOffice?\n\n|              | LibreOffice                | pptx-glimpse                   |\n| ------------ | -------------------------- | ------------------------------ |\n| Install size | ~500 MB+                   | `npm install` (~30 MB)         |\n| Docker image | Large base image required  | Works in any Node.js image     |\n| Startup time | Process spawning overhead  | In-process, no spawning        |\n| Concurrency  | One process per conversion | Async, runs in your event loop |\n\n## Requirements\n\n- **Node.js \u003e= 22**\n\n## Installation\n\n```bash\nnpm install pptx-glimpse\n```\n\n## Usage\n\n```typescript\nimport { readFileSync, writeFileSync } from \"fs\";\nimport { convertPptxToSvg, convertPptxToPng } from \"pptx-glimpse\";\n\nconst pptx = readFileSync(\"presentation.pptx\");\n\n// Convert to SVG\nconst svgResults = await convertPptxToSvg(pptx);\n// [{ slideNumber: 1, svg: \"\u003csvg\u003e...\u003c/svg\u003e\" }, ...]\n\n// Convert to PNG\nconst pngResults = await convertPptxToPng(pptx);\n// [{ slideNumber: 1, png: Buffer, width: 960, height: 540 }, ...]\n\nwriteFileSync(\"slide1.png\", pngResults[0].png);\n```\n\n### Options\n\nBoth `convertPptxToSvg` and `convertPptxToPng` accept an optional `ConvertOptions` object.\n\n```typescript\nconst results = await convertPptxToPng(pptx, {\n  slides: [1, 3], // Convert only slides 1 and 3\n  width: 1920, // Output width in pixels (default: 960)\n  height: 1080, // Output height in pixels (width takes priority if both set)\n  logLevel: \"warn\", // Warning log level: \"off\" | \"warn\" | \"debug\"\n  fontDirs: [\"/custom/fonts\"], // Additional font directories to search\n  skipSystemFonts: true, // Skip OS system font directories; use fontDirs only\n  fontMapping: {\n    \"Custom Corp Font\": \"Noto Sans\", // Custom font name mapping\n  },\n});\n```\n\n### Advanced Usage\n\n\u003cdetails\u003e\n\u003csummary\u003eFont Utilities\u003c/summary\u003e\n\n#### Collecting used fonts\n\n`collectUsedFonts` parses a PPTX file and returns all font names used across slides — without performing a full render. Useful for pre-checking which fonts need to be installed.\n\n```typescript\nimport { collectUsedFonts } from \"pptx-glimpse\";\n\nconst fonts = collectUsedFonts(pptx);\n// {\n//   theme: { majorFont: \"Calibri Light\", minorFont: \"Calibri\", majorFontEa: \"...\", ... },\n//   fonts: [\"Arial\", \"Calibri\", \"Meiryo\"]\n// }\n```\n\n#### Font mapping helpers\n\n```typescript\nimport { DEFAULT_FONT_MAPPING, createFontMapping, getMappedFont } from \"pptx-glimpse\";\n\n// Create a custom mapping (merges with defaults, user values take priority)\nconst mapping = createFontMapping({ Calibri: \"Ubuntu\" });\n\n// Look up mapped font (case-insensitive)\ngetMappedFont(\"Meiryo\", mapping); // \"Noto Sans JP\"\ngetMappedFont(\"calibri\", mapping); // \"Ubuntu\"\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eCustom Font Loading\u003c/summary\u003e\n\nIn environments where system fonts are not available, you can build a text measurer from font buffers using `createOpentypeSetupFromBuffers`. This is a low-level utility for advanced use cases.\n\n```typescript\nimport { readFileSync } from \"fs\";\nimport { createOpentypeSetupFromBuffers } from \"pptx-glimpse\";\n\nconst setup = await createOpentypeSetupFromBuffers([\n  { name: \"Carlito\", data: readFileSync(\"fonts/Carlito-Regular.ttf\") },\n  { name: \"Noto Sans JP\", data: readFileSync(\"fonts/NotoSansJP-Regular.ttf\") },\n]);\n// setup.measurer — text width measurement\n// setup.fontResolver — text-to-SVG-path conversion\n```\n\n\u003c/details\u003e\n\n## Fonts\n\n### Automatic Font Loading\n\npptx-glimpse automatically scans system font directories and loads fonts using [opentype.js](https://opentype.js.org/). Text in SVG output is converted to `\u003cpath\u003e` elements, ensuring consistent rendering regardless of the environment.\n\nDefault system font directories:\n\n| OS      | Directories                                                  |\n| ------- | ------------------------------------------------------------ |\n| Linux   | `/usr/share/fonts`, `/usr/local/share/fonts`                 |\n| macOS   | `/System/Library/Fonts`, `/Library/Fonts`, `~/Library/Fonts` |\n| Windows | `C:\\Windows\\Fonts`                                           |\n\nUse the `fontDirs` option to add custom font directories. To skip system font scanning entirely and use only `fontDirs` (useful in containers, serverless environments, or when you want to bundle specific fonts to reduce startup time), set `skipSystemFonts: true`.\n\n### Font Mapping\n\nPPTX files often reference proprietary fonts (e.g., Calibri, Meiryo). pptx-glimpse maps these to open-source alternatives available on Google Fonts.\n\nDefault mapping:\n\n| PPTX Font                           | Mapped to     |\n| ----------------------------------- | ------------- |\n| Calibri                             | Carlito       |\n| Arial                               | Arimo         |\n| Times New Roman                     | Tinos         |\n| Courier New                         | Cousine       |\n| Cambria                             | Caladea       |\n| Meiryo / Yu Gothic / MS Gothic etc. | Noto Sans JP  |\n| MS Mincho / Yu Mincho etc.          | Noto Serif JP |\n\nYou can customize the mapping via the `fontMapping` option:\n\n```typescript\nconst results = await convertPptxToSvg(pptx, {\n  fontMapping: {\n    \"Custom Corp Font\": \"Noto Sans\", // Add a new mapping\n    Arial: \"Inter\", // Override the default\n  },\n});\n```\n\n## Feature Support\n\n136 preset shapes, charts, tables, SmartArt, gradients, shadows, and more — covering the most common static PowerPoint content.\n\n### Supported Features\n\n#### Shapes\n\n| Feature       | Details                                                                                                                        |\n| ------------- | ------------------------------------------------------------------------------------------------------------------------------ |\n| Preset shapes | 136 types (rectangles, ellipses, arrows, flowcharts, callouts, stars, math symbols, etc.)                                      |\n| Custom shapes | Arbitrary shape drawing using custom paths (moveTo, lnTo, cubicBezTo, quadBezTo, arcTo, close), adjust values / guide formulas |\n| Connectors    | Straight / bent / curved connectors, arrow endpoints (headEnd/tailEnd), line style / color / width                             |\n| Groups        | Shape grouping, nested groups, group rotation / flip                                                                           |\n| Transforms    | Position, size, rotation, flip (flipH/flipV), adjustment values                                                                |\n\n#### Text\n\n| Feature              | Details                                                                                                                                     |\n| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |\n| Character formatting | Font size, font family (East Asian font support), bold, italic, underline, strikethrough, font color, superscript / subscript, hyperlinks   |\n| Paragraph formatting | Horizontal alignment (left/center/right/justify), vertical anchor (top/center/bottom), line spacing, before/after paragraph spacing, indent |\n| Bullet points        | Character bullets (buChar), auto-numbering (buAutoNum, 9 types), bullet font / color / size                                                 |\n| Text boxes           | Word wrap (square/none), auto-fit (noAutofit/normAutofit/spAutofit), font scaling, margins                                                  |\n| Word wrapping        | Word wrapping for English, Japanese, and CJK text, wrapping with mixed font sizes                                                           |\n| Style inheritance    | Full text style inheritance chain (run → paragraph default → body lstStyle → layout → master → txStyles → defaultTextStyle → theme fonts)   |\n| Tab stops / fields   | Tab stop positions, field codes (slide number, date, etc.)                                                                                  |\n\n#### Fill\n\n| Feature      | Details                                                          |\n| ------------ | ---------------------------------------------------------------- |\n| Solid color  | RGB color specification, transparency                            |\n| Gradient     | Linear gradient, radial gradient, multiple gradient stops, angle |\n| Image fill   | PNG/JPEG/GIF, stretch mode, cropping (srcRect)                   |\n| Pattern fill | Hatching patterns (horizontal, vertical, diagonal, cross, etc.)  |\n| Group fill   | Inherit fill from parent group                                   |\n| No fill      | noFill specification                                             |\n\n#### Lines \u0026 Borders\n\n| Feature    | Details                                                           |\n| ---------- | ----------------------------------------------------------------- |\n| Line style | Line width, solid color, transparency, lineCap, lineJoin          |\n| Dash style | solid, dash, dot, dashDot, lgDash, lgDashDot, sysDash, sysDot     |\n| Arrows     | Head / tail arrow endpoints with type, width, and length settings |\n\n#### Colors\n\n| Feature          | Details                                                                  |\n| ---------------- | ------------------------------------------------------------------------ |\n| Color types      | RGB (srgbClr), theme color (schemeClr), system color (sysClr)            |\n| Theme colors     | Color scheme (dk1, lt1, dk2, lt2, accent1-6, hlink, folHlink), color map |\n| Color transforms | Luminance adjustment (lumMod/lumOff), tint, shade, transparency (alpha)  |\n\n#### Effects\n\n| Feature      | Details                                                |\n| ------------ | ------------------------------------------------------ |\n| Outer shadow | Blur radius, distance, direction, color / transparency |\n| Inner shadow | Blur radius, distance, direction, color / transparency |\n| Glow         | Radius, color / transparency                           |\n| Soft edge    | Radius                                                 |\n\n#### Images\n\n| Feature        | Details                                                                      |\n| -------------- | ---------------------------------------------------------------------------- |\n| Image elements | PNG/JPEG/GIF, position / size / rotation / flip, cropping (srcRect), effects |\n| Image fill     | Image fill for shapes and backgrounds                                        |\n\n#### Tables\n\n| Feature         | Details                                                                         |\n| --------------- | ------------------------------------------------------------------------------- |\n| Table structure | Row and column grid, cell merging (gridSpan/rowSpan), row height / column width |\n| Cell formatting | Text, fill (solid/gradient/image), borders (top/bottom/left/right, styles)      |\n\n#### Charts\n\n| Feature          | Details                                                                                                   |\n| ---------------- | --------------------------------------------------------------------------------------------------------- |\n| Supported charts | Bar chart (vertical/horizontal), line chart, pie chart, scatter plot, area chart, doughnut, bubble, radar |\n| Chart elements   | Title, legend (position), series (name/values/categories/color), category axis, value axis                |\n\n#### SmartArt\n\n| Feature             | Details                                                                        |\n| ------------------- | ------------------------------------------------------------------------------ |\n| Pre-rendered shapes | Renders SmartArt using PowerPoint's pre-rendered drawing shapes (drawingN.xml) |\n| mc:AlternateContent | Handles AlternateContent fallback mechanism used by SmartArt                   |\n\n#### Background \u0026 Slide Settings\n\n| Feature      | Details                                                                |\n| ------------ | ---------------------------------------------------------------------- |\n| Background   | Solid, gradient, image. Fallback order: slide → layout → master        |\n| Slide size   | 16:9, 4:3, custom sizes                                                |\n| Theme        | Theme color scheme, theme fonts (majorFont/minorFont), theme font refs |\n| showMasterSp | Control visibility of master shapes per slide / layout                 |\n\n\u003cdetails\u003e\n\u003csummary\u003eUnsupported Features\u003c/summary\u003e\n\n| Category       | Unsupported features                                                       |\n| -------------- | -------------------------------------------------------------------------- |\n| Fill           | Path gradient (rect/shape type)                                            |\n| Effects        | Reflection, 3D rotation / extrusion, artistic effects                      |\n| Charts         | Stock, combo, histogram, box plot, waterfall, treemap, sunburst            |\n| Chart details  | Data labels, axis titles / tick marks / grid lines, error bars, trendlines |\n| Text           | Individual text effects (shadow/glow), text columns                        |\n| Tables         | Table style template application, diagonal borders                         |\n| Shapes         | Shape operations (Union/Subtract/Intersect/Fragment)                       |\n| Multimedia     | Embedded video / audio                                                     |\n| Animations     | Object animations, slide transitions                                       |\n| Slide elements | Slide notes, comments, headers / footers, slide numbers / dates            |\n| Image formats  | EMF/WMF (parsed but not rendered)                                          |\n| Other          | Macros / VBA, sections, zoom slides                                        |\n\n\u003c/details\u003e\n\n## Development\n\n\u003cdetails\u003e\n\u003csummary\u003eTest rendering\u003c/summary\u003e\n\nYou can specify a PPTX file to preview SVG and PNG conversion results.\n\n```bash\nnpm run render -- \u003cpptx-file\u003e [output-dir]\n```\n\n- If `output-dir` is omitted, output is saved to `./output`\n\n```bash\n# Examples\nnpm run render -- presentation.pptx\nnpm run render -- presentation.pptx ./my-output\n```\n\n\u003c/details\u003e\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhirokisakabe%2Fpptx-glimpse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhirokisakabe%2Fpptx-glimpse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhirokisakabe%2Fpptx-glimpse/lists"}