Skip to content

Pptx: save OpenDocument .odp presentations (first slice) - #568

Open
NikitkaRa wants to merge 1 commit into
storytold:mainfrom
NikitkaRa:odp-export
Open

NikitkaRa wants to merge 1 commit into
storytold:mainfrom
NikitkaRa:odp-export

Conversation

@NikitkaRa

Copy link
Copy Markdown
Contributor

Summary

  • New deckcraft_pptx::odp_write::export_odp: a valid ODF 1.3 package (mimetype first and stored, manifest, content, styles, meta, Pictures/)
  • Slides: page size from the slide size; background colour, hidden slides
  • Shapes: autoshapes as draw:custom-shape (ODF type names, ooxml-<preset> for the rest, as LibreOffice reads them), custom geometry as an enhanced path, rotation kept around the centre, fill and line colours/widths; connectors as draw:line; groups as draw:g; pictures as draw:frame/draw:image; titles and alt text
  • Text: placeholder and theme formatting resolved into explicit automatic styles: font, size, bold, italic, underline, strike, colour, super/subscript, caps, spacing, links; paragraph alignment, spacing and indents; bullets and numbering as ODF lists by level
  • Speaker notes as presentation:notes
  • Engine/UI: file.export and Save As accept .odp / odp; Save As types and the Export dialog list it; the MCP export enum includes it
  • Not written yet (documented in file-format-parity): tables, charts, media, ink, master/layout graphics, gradients (first colour only), dashes, effects, picture crops, transitions, animations
  • Independent of the import stack (Pptx: import OpenDocument .odp presentations #524 / Pptx: .odp import reads tables, master pages and page backgrounds #527 / Pptx: .odp import reads gradient and picture fills and slide transitions #529): new file odp_write.rs; docs rows may need a trivial merge with Pptx: import OpenDocument .odp presentations #524

Test plan

  • pptx unit tests: rotation keeps the centre; package layout (mimetype first and stored), well-formed content, styles and manifest, escaped text, picture, notes with spaces, page size
  • engine test: export a deck with an outline slide, shapes, a picture and notes to .odp
  • Opened the exported file in LibreOffice (headless convert to PDF): title, bullet levels with indents, filled arrow with text, ellipse and picture all show
  • cargo xtask ci

anishguduru pushed a commit to anishguduru/deckcraft that referenced this pull request Oct 16, 2026
… bit 5) (storytold#914)

* Issue storytold#568: honour the document's copy permission

ISO 32000-2 §7.6.4.1 has readers restrict access to an encrypted file
according to its permissions, and Table 22 bit 5 covers "Copy or otherwise
extract text and graphics". PdfCraft reported the bit (Document Properties
shows "Content copying: Not allowed") but ⌘C copied selected text anyway.

- Engine: Document::allows_copying / check_copying, and Needs::Copying for
  Take a snapshot, Export to image/text/Word/HTML/RTF and Export all images.
  Save Image As refuses too.
- UI: ⌘C moves from canvas::shortcuts to the app, which knows the document.
  Refused copies, snapshots and exports say why. The snapshot tool and the
  exports check again when they act, since the tool stays selected across tabs.
- Automation: text_extract (and the MCP text resources), text_paragraphs,
  doc_export_text/images/all_images, doc_export_office and image_save refuse.

Find, read aloud and the accessibility tools keep working: the spec exempts
assistive technology, and searching isn't copying. Page extraction stays with
the assemble bit, as before. Owners and unencrypted files are unaffected.

* Refresh catalog hashes

---------

Co-authored-by: Brandon Thomas <echelon@gmail.com>
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>

@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: saving OpenDocument .odp presentations, a first slice. The CLI convert test moves out.odp out of the list of unsupported targets and checks that converting a file to .odp succeeds and that the result starts with PK\x03\x04 (a ZIP package). The check proves only that a ZIP was written, not that it is a valid ODP; LibreOffice opening the file is the proof, and the PR should say that the contributor opened the result there. It is the writing counterpart of the import PRs (deckcraft#524, #527) by the same author. ODF requires the mimetype entry first and stored (uncompressed), which a test should check. I did not read the writer. 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