Skip to content

fix(pptx): render master/layout, parametric presets, and bulleted lists faithfully#54

Merged
karthikmudunuri merged 1 commit into
mainfrom
karthikmudunuri/run-dev-server
May 19, 2026
Merged

fix(pptx): render master/layout, parametric presets, and bulleted lists faithfully#54
karthikmudunuri merged 1 commit into
mainfrom
karthikmudunuri/run-dev-server

Conversation

@karthikmudunuri
Copy link
Copy Markdown
Member

Summary

Batch of PPTX import fidelity fixes surfaced while importing the KBC sample deck. Each issue is a real divergence from PowerPoint's rendering, not a cosmetic preference.

Master / canvas

  • Honour showMasterSp="0" on <p:sld> / <p:sldLayout> so master decorations don't leak onto title slides that opt out.
  • Clip the slide canvas to its 1920×1080 rect — slide-master trim is routinely positioned outside the slide bounds (y=-46px, x=-40px) as bleed marks and would otherwise sit on top of the slide.

Parametric preset shapes

  • Synthesise SVG paths for arc, chevron / homePlate / pentagon, cube, and ellipse / circle. Each respects flipH / flipV baked into the path coordinates.
  • When the shape carries text (<p:txBody> with content), attach the synthesised path as the text element's backingPath so the silhouette survives the isText short-circuit. Fixes the 7-S diagram's central oval, process-bar chevrons, and 3D-cube grids.
  • Apply the inscribed txRect for chevron/homePlate/pentagon so long labels wrap inside the polygon body, not the bounding rectangle. Stops icon-column overlap in process bars.

Bullets and paragraphs

  • Surface per-paragraph marL / indent / algn / <a:spcBef> on TextElement and render each paragraph in its own block. Hanging-indent bullets now wrap under the text-after-bullet column instead of collapsing to column 0; spcBef produces the authored vertical air between items.
  • Defensive fallback for <a:br/> in paragraphs whose raw XML wasn't preserved — previously "FOO" <br/> "BAR" could collapse into "FOOBAR".
  • Resolve <a:fld type="slidenum"> to the slide's 1-based index (was rendering the literal ‹#› design-time token).

Stroke and fill

  • Read <a:prstDash> (dot, dash, dashDot, …) on shape strokes and emit border-style / stroke-dasharray. Previously only line-element connectors honoured dashes.
  • Parse <a:fillToRect> attributes in their literal-percent form ("0%" / "100%"). PowerPoint emits both that and 1000ths-of-percent integers; Number("0%") = NaN was collapsing radial gradient focus points to 0% 0%.

Connectors

  • Apply flipH to <p:cxnSp> and <p:sp prst="line" / "straightConnector1">. Only flipV was honoured before, so flipped-diagonal struts (e.g. 7-S model) drew the wrong way.

Test plan

  • Import KBC sample deck end-to-end and verify each slide matches the screenshots reviewed during this work.
  • Re-import an existing chart-heavy / placeholder-heavy deck to confirm no regressions in shapes that already rendered correctly.
  • Round-trip a slide with bulleted lists (import → edit → export) and confirm marL/indent survive.
  • Confirm the canvas clip doesn't crop legitimately on-slide content near the edges.

…ts faithfully

Tightens the PPTX importer + canvas across a batch of fidelity issues
surfaced while importing the KBC sample deck:

- Honour `showMasterSp="0"` on slide/layout; clip the canvas to slide
  bounds so master bleed-area trim no longer leaks in.
- Synthesise SVG paths for arc, chevron/homePlate/pentagon, cube, and
  ellipse/circle presets (incl. flipH/flipV). Attach as `backingPath` on
  text-bearing variants so the silhouette survives the isText branch.
- Apply the inscribed `txRect` for chevron/pentagon so long labels wrap
  inside the polygon body, not the bounding rectangle.
- Per-paragraph `marL`/`indent`/`algn`/`spcBef` on TextElement →
  PowerPoint-style hanging-indent bullets with authored spacing. Restore
  `<a:br/>` when raw XML isn't preserved. Resolve `<a:fld
  type="slidenum">` to the slide's index.
- Read `<a:prstDash>` on shape strokes and parse `<a:fillToRect>`
  literal-percent attributes (`"0%"`/`"100%"`) so radial gradients land
  at the right focus.
- Apply `flipH` to connectors and `prst="line"` / `straightConnector1`
  shapes so diagonal struts (e.g. the 7-S diagram) draw the correct
  direction.
@karthikmudunuri karthikmudunuri merged commit a14645a into main May 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant