pptx-glimpse 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,23 @@
1
1
  # pptx-glimpse
2
2
 
3
- A TypeScript library for converting PPTX slides to SVG / PNG.
3
+ [![npm](https://img.shields.io/npm/v/pptx-glimpse)](https://www.npmjs.com/package/pptx-glimpse)
4
+
5
+ A TypeScript library to render PPTX slides as SVG / PNG.
6
+
7
+ [Demo](https://hirokisakabe.github.io/pptx-glimpse/) | [npm](https://www.npmjs.com/package/pptx-glimpse)
8
+
9
+ ## Motivation
10
+
11
+ pptx-glimpse is designed for two primary use cases:
12
+
13
+ - **Frontend PPTX preview** — Render slide thumbnails without depending on
14
+ Microsoft Office or LibreOffice. The SVG output can be embedded directly
15
+ in web pages.
16
+ - **AI image recognition** — Convert slides to PNG so that vision-capable LLMs
17
+ can understand slide content and layout.
18
+
19
+ The library focuses on accurately reproducing text, shapes, and spatial layout
20
+ rather than pixel-perfect rendering of every PowerPoint feature.
4
21
 
5
22
  ## Requirements
6
23
 
@@ -38,104 +55,115 @@ Supports conversion of static visual content in PowerPoint. Dynamic elements suc
38
55
 
39
56
  #### Shapes
40
57
 
41
- | Feature | Details |
42
- | -------------- | ------------------------------------------------------------------------------------------------ |
43
- | Preset shapes | 113 types (rectangles, ellipses, arrows, flowcharts, callouts, stars, math symbols, etc.) |
44
- | Custom shapes | Arbitrary shape drawing using custom paths (moveTo, lnTo, cubicBezTo, close) |
45
- | Connectors | Line connector drawing, line style / color / width settings |
46
- | Groups | Shape grouping, nested groups |
47
- | Transforms | Position, size, rotation, flip (flipH/flipV), adjustment values |
58
+ | Feature | Details |
59
+ | ------------- | ------------------------------------------------------------------------------------------------------------------------------ |
60
+ | Preset shapes | 136 types (rectangles, ellipses, arrows, flowcharts, callouts, stars, math symbols, etc.) |
61
+ | Custom shapes | Arbitrary shape drawing using custom paths (moveTo, lnTo, cubicBezTo, quadBezTo, arcTo, close), adjust values / guide formulas |
62
+ | Connectors | Straight / bent / curved connectors, arrow endpoints (headEnd/tailEnd), line style / color / width |
63
+ | Groups | Shape grouping, nested groups, group rotation / flip |
64
+ | Transforms | Position, size, rotation, flip (flipH/flipV), adjustment values |
48
65
 
49
66
  #### Text
50
67
 
51
- | Feature | Details |
52
- | -------------- | -------------------------------------------------------------------------------------------------------------------- |
53
- | Character formatting | Font size, font family (East Asian font support), bold, italic, underline, strikethrough, font color, superscript / subscript |
68
+ | Feature | Details |
69
+ | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
70
+ | Character formatting | Font size, font family (East Asian font support), bold, italic, underline, strikethrough, font color, superscript / subscript, hyperlinks |
54
71
  | Paragraph formatting | Horizontal alignment (left/center/right/justify), vertical anchor (top/center/bottom), line spacing, before/after paragraph spacing, indent |
55
- | Bullet points | Character bullets (buChar), auto-numbering (buAutoNum, 9 types), bullet font / color / size |
56
- | Text boxes | Word wrap (square/none), auto-fit (noAutofit/normAutofit/spAutofit), font scaling, margins |
57
- | Word wrapping | Word wrapping for English, Japanese, and CJK text, wrapping with mixed font sizes |
72
+ | Bullet points | Character bullets (buChar), auto-numbering (buAutoNum, 9 types), bullet font / color / size |
73
+ | Text boxes | Word wrap (square/none), auto-fit (noAutofit/normAutofit/spAutofit), font scaling, margins |
74
+ | Word wrapping | Word wrapping for English, Japanese, and CJK text, wrapping with mixed font sizes |
75
+ | Style inheritance | Full text style inheritance chain (run → paragraph default → body lstStyle → layout → master → txStyles → defaultTextStyle → theme fonts) |
76
+ | Tab stops / fields | Tab stop positions, field codes (slide number, date, etc.) |
58
77
 
59
78
  #### Fill
60
79
 
61
- | Feature | Details |
62
- | -------------- | ---------------------------------------------------- |
63
- | Solid color | RGB color specification, transparency |
64
- | Gradient | Linear gradient, multiple gradient stops, angle |
65
- | Image fill | PNG/JPEG/GIF, stretch mode |
66
- | No fill | noFill specification |
80
+ | Feature | Details |
81
+ | ------------ | ---------------------------------------------------------------- |
82
+ | Solid color | RGB color specification, transparency |
83
+ | Gradient | Linear gradient, radial gradient, multiple gradient stops, angle |
84
+ | Image fill | PNG/JPEG/GIF, stretch mode, cropping (srcRect) |
85
+ | Pattern fill | Hatching patterns (horizontal, vertical, diagonal, cross, etc.) |
86
+ | Group fill | Inherit fill from parent group |
87
+ | No fill | noFill specification |
67
88
 
68
89
  #### Lines & Borders
69
90
 
70
- | Feature | Details |
71
- | -------------- | ------------------------------------------------------------- |
72
- | Line style | Line width, solid color, transparency |
73
- | Dash style | solid, dash, dot, dashDot, lgDash, lgDashDot, sysDash, sysDot |
91
+ | Feature | Details |
92
+ | ---------- | ----------------------------------------------------------------- |
93
+ | Line style | Line width, solid color, transparency, lineCap, lineJoin |
94
+ | Dash style | solid, dash, dot, dashDot, lgDash, lgDashDot, sysDash, sysDot |
95
+ | Arrows | Head / tail arrow endpoints with type, width, and length settings |
74
96
 
75
97
  #### Colors
76
98
 
77
- | Feature | Details |
78
- | -------------- | ------------------------------------------------------------------------------------ |
79
- | Color types | RGB (srgbClr), theme color (schemeClr), system color (sysClr) |
80
- | Theme colors | Color scheme (dk1, lt1, dk2, lt2, accent1-6, hlink, folHlink), color map |
81
- | Color transforms | Luminance adjustment (lumMod/lumOff), tint, shade, transparency (alpha) |
99
+ | Feature | Details |
100
+ | ---------------- | ------------------------------------------------------------------------ |
101
+ | Color types | RGB (srgbClr), theme color (schemeClr), system color (sysClr) |
102
+ | Theme colors | Color scheme (dk1, lt1, dk2, lt2, accent1-6, hlink, folHlink), color map |
103
+ | Color transforms | Luminance adjustment (lumMod/lumOff), tint, shade, transparency (alpha) |
82
104
 
83
105
  #### Effects
84
106
 
85
- | Feature | Details |
86
- | -------------- | ------------------------------------------ |
87
- | Outer shadow | Blur radius, distance, direction, color / transparency |
88
- | Inner shadow | Blur radius, distance, direction, color / transparency |
89
- | Glow | Radius, color / transparency |
90
- | Soft edge | Radius |
107
+ | Feature | Details |
108
+ | ------------ | ------------------------------------------------------ |
109
+ | Outer shadow | Blur radius, distance, direction, color / transparency |
110
+ | Inner shadow | Blur radius, distance, direction, color / transparency |
111
+ | Glow | Radius, color / transparency |
112
+ | Soft edge | Radius |
91
113
 
92
114
  #### Images
93
115
 
94
- | Feature | Details |
95
- | -------------- | ---------------------------------------------------------- |
96
- | Image elements | PNG/JPEG/GIF, position / size / rotation / flip, effects |
97
- | Image fill | Image fill for shapes and backgrounds |
116
+ | Feature | Details |
117
+ | -------------- | ---------------------------------------------------------------------------- |
118
+ | Image elements | PNG/JPEG/GIF, position / size / rotation / flip, cropping (srcRect), effects |
119
+ | Image fill | Image fill for shapes and backgrounds |
98
120
 
99
121
  #### Tables
100
122
 
101
- | Feature | Details |
102
- | ---------------- | --------------------------------------------------------------------------- |
103
- | Table structure | Row and column grid, cell merging (gridSpan/rowSpan), row height / column width |
104
- | Cell formatting | Text, fill (solid/gradient/image), borders (top/bottom/left/right, styles) |
123
+ | Feature | Details |
124
+ | --------------- | ------------------------------------------------------------------------------- |
125
+ | Table structure | Row and column grid, cell merging (gridSpan/rowSpan), row height / column width |
126
+ | Cell formatting | Text, fill (solid/gradient/image), borders (top/bottom/left/right, styles) |
105
127
 
106
128
  #### Charts
107
129
 
108
- | Feature | Details |
109
- | ---------------- | ------------------------------------------------------------------------------------ |
110
- | Supported charts | Bar chart (vertical/horizontal), line chart, pie chart, scatter plot |
130
+ | Feature | Details |
131
+ | ---------------- | ------------------------------------------------------------------------------------------ |
132
+ | Supported charts | Bar chart (vertical/horizontal), line chart, pie chart, scatter plot |
111
133
  | Chart elements | Title, legend (position), series (name/values/categories/color), category axis, value axis |
112
134
 
135
+ #### SmartArt
136
+
137
+ | Feature | Details |
138
+ | ------------------- | ------------------------------------------------------------------------------ |
139
+ | Pre-rendered shapes | Renders SmartArt using PowerPoint's pre-rendered drawing shapes (drawingN.xml) |
140
+ | mc:AlternateContent | Handles AlternateContent fallback mechanism used by SmartArt |
141
+
113
142
  #### Background & Slide Settings
114
143
 
115
- | Feature | Details |
116
- | -------------- | --------------------------------------------------------------------------------------- |
117
- | Background | Solid, gradient, image. Fallback order: slide → layout → master |
118
- | Slide size | 16:9, 4:3, custom sizes |
119
- | Theme | Theme color scheme, theme fonts (majorFont/minorFont) |
144
+ | Feature | Details |
145
+ | ------------ | ---------------------------------------------------------------------- |
146
+ | Background | Solid, gradient, image. Fallback order: slide → layout → master |
147
+ | Slide size | 16:9, 4:3, custom sizes |
148
+ | Theme | Theme color scheme, theme fonts (majorFont/minorFont), theme font refs |
149
+ | showMasterSp | Control visibility of master shapes per slide / layout |
120
150
 
121
151
  ### Unsupported Features
122
152
 
123
- | Category | Unsupported features |
124
- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------- |
125
- | Fill | Pattern fill, radial gradient, path gradient |
126
- | Effects | Reflection, 3D rotation / extrusion, artistic effects |
127
- | Charts | Area, radar, doughnut, bubble, stock, combo, histogram, box plot, waterfall, treemap, sunburst |
128
- | Chart details | Data labels, axis titles / tick marks / grid lines, error bars, trendlines |
129
- | Text | Vertical text, individual text effects (shadow/glow), text outline, text columns |
130
- | Tables | Table style template application, diagonal borders |
131
- | Shapes | Shape operations (Union/Subtract/Intersect/Fragment) |
132
- | SmartArt | All SmartArt features |
133
- | Multimedia | Embedded video / audio |
134
- | Animations | Object animations, slide transitions |
135
- | Links | Hyperlinks |
136
- | Slide elements | Slide notes, comments, headers / footers, slide numbers / dates |
137
- | Image formats | EMF/WMF (parsed but not rendered) |
138
- | Other | Macros / VBA, sections, zoom slides |
153
+ | Category | Unsupported features |
154
+ | -------------- | ---------------------------------------------------------------------------------------------- |
155
+ | Fill | Path gradient (rect/shape type) |
156
+ | Effects | Reflection, 3D rotation / extrusion, artistic effects |
157
+ | Charts | Area, radar, doughnut, bubble, stock, combo, histogram, box plot, waterfall, treemap, sunburst |
158
+ | Chart details | Data labels, axis titles / tick marks / grid lines, error bars, trendlines |
159
+ | Text | Vertical text, individual text effects (shadow/glow), text outline, text columns |
160
+ | Tables | Table style template application, diagonal borders |
161
+ | Shapes | Shape operations (Union/Subtract/Intersect/Fragment) |
162
+ | Multimedia | Embedded video / audio |
163
+ | Animations | Object animations, slide transitions |
164
+ | Slide elements | Slide notes, comments, headers / footers, slide numbers / dates |
165
+ | Image formats | EMF/WMF (parsed but not rendered) |
166
+ | Other | Macros / VBA, sections, zoom slides |
139
167
 
140
168
  ## Test Rendering
141
169