Skip to content

Pptx: .odp export writes tables, gradients, dashes, master graphics, transitions and crops - #576

Open
NikitkaRa wants to merge 2 commits into
storytold:mainfrom
NikitkaRa:odp-export-2
Open

NikitkaRa wants to merge 2 commits into
storytold:mainfrom
NikitkaRa:odp-export-2

Conversation

@NikitkaRa

Copy link
Copy Markdown
Contributor

Stacked on #568 (the first .odp export slice). This branch contains its commit; review only the top commit 050309b, or merge #568 first.

Summary

  • Tables: written as draw:frame/table:table with column widths, row heights, merged cells (spans and covered cells), padding, vertical anchor, and fills, borders and text colour/boldness taken from the cell or else from its table style. export_odp_with takes a CellLook hook; the engine passes the renderer's table-style look (deckcraft_render::table_cell_look, newly re-exported), so built-in styles like Medium 2 keep their banding
  • Gradients: draw:gradient in office:styles: first and last colours, a linear angle converted from DrawingML's convention, radial/rectangular gradients keep their centre. Patterns use their background colour
  • Dashes: DrawingML preset and custom dashes become draw:stroke-dash (dots, lengths and distance relative to the line width); line transparency is kept
  • Master graphics: the master's and layout's own shapes (not placeholders) are drawn behind each slide, following show-master-shapes
  • Transitions: slide transitions map to smil:type/subtype/direction (fade, through black, push, cover, uncover, wipe, split, random bars, dissolve, checker, blinds, clock, wheel, circle, diamond, zoom…), plus speed and auto-advance (presentation:transition-type=automatic, presentation:duration)
  • Picture crops: fo:clip, measured on the picture's own size (PNG/JPEG/GIF header)
  • Engine gets zip as a dev-dependency for its test; docs/file-format-parity .odp row updated

Test plan

  • pptx unit tests: master graphic drawn and hidden with show-master-shapes off; wipe transition with slow speed and auto-advance; crop clip; dash mapping
  • engine test: 3×3 table cells, push transition, crop, gradient and dash styles in content.xml/styles.xml
  • Opened in LibreOffice (headless to PDF): banded table with header, red→blue gradient with a dashed outline, arrow, ellipse and picture all show
  • cargo xtask ci

NikitkaRa and others added 2 commits October 16, 2026 21:12
Adds deckcraft_pptx::odp_write: slides with their size, background and
visibility; autoshapes (ODF shape types, ooxml-* for the rest, custom
geometry), text boxes and placeholders with resolved run and paragraph
formatting, bullets and numbering; connectors; groups; pictures; and
speaker notes. Save As, Export and file.export accept .odp.

Co-authored-by: Cursor <cursoragent@cursor.com>
…transitions and crops

Tables become table:table frames with column widths, row heights, merged
cells, padding, anchors, and fills, borders and text colour from the
cell or its table style (the engine passes the renderer's table-style
look). Gradients are written as draw:gradient (first and last colours,
linear angle or radial/rectangular centre), dashes as draw:stroke-dash.
The master's and layout's own graphics are drawn behind each slide.
Slide transitions map to smil types with speed and auto-advance, and
cropped pictures get fo:clip.

Co-authored-by: Cursor <cursoragent@cursor.com>

@FredApps FredApps left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ReviewerA — source-read COMMENT (not an approval)

I read the head of the diff: .odp export writes tables, gradients, dashes, master graphics, transitions and crops. The CLI convert test moves out.odp out of the unsupported list and checks that the result starts with PK\x03\x04, which proves only that a ZIP was written, the same test as in deckcraft#568, the first export slice by the same author; this PR contains its predecessor and should target that branch. Each new element needs a round trip through the importer (deckcraft#524, #527, #529) as the proof, and LibreOffice opening a sample is the real oracle. ODF requires the mimetype entry first and stored. I have not run it, and no exact-head CI result exists for this head. Nothing was run.

I ran nothing and have no exact-head CI result for this PR, so this is not an approval. Where a diff was long I read its code hunks rather than every generated or documentation line.

Status: waiting_author.

@aiongg aiongg added the missing feature The reference application has it and we do not, or only part of it label Nov 4, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

missing feature The reference application has it and we do not, or only part of it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants