Paper Office
paper-pptxAPI referenceedit

pptx.edit

paper-pptx 0.2.0 API reference

Structural-anchor write APIs: formatting-preserving text replacement (paper-pptx addition).

The write half of the loop pptx.inspect opened. inspect_text produces structural, content-validated anchors; this module consumes them. The run-preservation semantics:

  • literal, case-sensitive matching; matches never cross paragraph, line-break (a:br), or field (a:fld) boundaries;
  • runs are split at match boundaries; boundary fragments keep their source run's rPr verbatim; replacement text inherits the rPr of the run where the match STARTS;
  • runs the match does not touch stay byte-identical; runs consumed whole are removed;
  • staleness refuses (StaleAnchorError) — recovery is the explicit refind(), never a silent re-find.

Traversal is visibility-complete via the same walker inspect_text uses (grouped shapes, table cells), so text that inspection can see, replacement can reach.

RESULT_SCHEMA_NAME

attributeRESULT_SCHEMA_NAME
= 'paper-replace-result'

RESULT_SCHEMA_VERSION

attributeRESULT_SCHEMA_VERSION
= 2

On this page