PowerPoint Document Masking
The unstructured_text mask runs on Microsoft PowerPoint files (.pptx)
inside mask_file tasks.
DataMasque pulls the text out of the deck,
detects and masks entities,
then writes a new deck with the masked text in place.
How It Works
PowerPoint masking runs in three stages:
- Extract text from slides, tables, and speaker notes.
- Mask the entities found in that text.
- Rebuild a new deck around the masked content.
Some kinds of content are not supported (charts, SmartArt, OLE objects, embedded video, comments, document properties, custom XML) and are dropped from the output instead of getting preserved and masked. See What is dropped for the full list and Limitations for what this means in practice.
What is masked and preserved
Text in these surfaces is masked, and its formatting is preserved:
- Slide bodies and slide titles.
- Tables.
- Speaker notes.
- Slide masters and slide layouts (non-placeholder shapes only; see Slide master, slide layout, and notes master placeholders for placeholder text handling).
- Run-level formatting on rewritten text: bold, italic, underline, font size, and RGB font colour.
- Hyperlinked text: the display text is masked, and the link target (URL) is removed.
Embedded images are handled per
image_handling.
Slide backgrounds are covered in
Backgrounds.
Slide master, slide layout, and notes master placeholders
Placeholder shapes on masters, layouts, and the notes master hold design-time prompt text such as "Click to edit Master title style". It is stripped on rebuild (which also clears any author or contact details baked into the template).
Non-placeholder shapes (footers, logos, watermarks) are masked the same as slide content.
What is dropped
These are removed during the rebuild:
- Charts and SmartArt diagrams.
- OLE objects and embedded workbooks.
- Math equations (Office Math).
- Audio and video.
- Slide animations (entrance, emphasis, exit, and motion-path effects).
- Newer transition effects stored in extension blocks, such as Morph (common transitions like Fade, Push, and Wipe are preserved).
- Ink annotations.
- PowerPoint Designer (Design Ideas) styling, so a Designer-styled slide reverts to its underlying theme appearance (text, shapes, and layout are still preserved and masked).
- Comments and comment authors.
- The modify-password write-protection (
modifyVerifier), so the masked deck opens without prompting for a modify password. - Document properties (author, title, last-modified-by, custom properties).
- Custom XML parts.
- Accessibility metadata on every shape
(the
name,descr, andtitleattributes used by screen readers). - Presentation and view settings (slideshow playback options, editor zoom, last-viewed slide). PowerPoint regenerates defaults on open.
What passes through unchanged
A few structural parts of the file are copied across as-is so the masked deck still renders with the original style:
- Theme definitions (
ppt/theme/*.xml): colour schemes, font schemes, gradient fills. - Embedded font files (
ppt/fonts/*). - Table style definitions (
ppt/tableStyles.xml).
Display names in these parts (theme, colour-scheme, font-scheme, table style) don't get masked.
image_handling
Controls embedded images. The same parameter applies to Word and PDF masking and has no effect on text columns.
| Value | Description |
|---|---|
redact (default) |
Replace every embedded image with a 1x1 black PNG placeholder. |
retain |
Keep the original images byte-for-byte. |
Note: Image relationships and slide dimensions are preserved when redacting, so the placeholder scales to fit the original image's frame.
Backgrounds
Slide-level backgrounds
(typically set via PowerPoint's "Format Background")
follow image_handling for the picture case:
- Solid colour, gradient, and pattern backgrounds are always preserved.
- Picture backgrounds under
redactare removed so the slide falls back to its master or theme background. - Picture backgrounds under
retainare kept byte-for-byte.
File Type Detection
PowerPoint masking runs in two contexts:
- In
mask_filetasks, the.pptxfile extension picks the file type. - In
mask_tabletasks, binary column values are inspected: a ZIP archive containing appt/presentation.xmlentry is treated as a PowerPoint document. This lets PowerPoint blobs stored in database columns be masked.
Failure Modes
- AI Engine errors during entity detection trigger the configured
fallback_masks, the same as for Word and PDF. - Extraction failures (a corrupted or invalid
.pptx) raise aMaskError("The file is either corrupted or not a valid PPTX file.") and the run fails for that file.fallback_masksis not applied to extraction failures. Set the run-levelcontinue_on_failureoption to keep a batch going past per-file errors.
Macro-enabled PowerPoint files (.pptm) are not a supported input format.
Convert to .pptx (without macros) before masking.
Strict Open XML files (ISO/IEC 29500 Strict) are not a supported input format.
These open normally in PowerPoint but use a different namespace set;
re-save as a standard (Transitional) .pptx before masking.
Limitations
- Images may contain PII that text matchers cannot detect.
Use
image_handling: redact(the default) if images might hold sensitive data. - When an entity match crosses run boundaries, the masked text takes the formatting of the first run it overlaps.
- Masking can change the length of text, which may cause content to overflow its original shape or cell.
- The fallback mask for PowerPoint only supports
from_blob. Other fallback mask types are not supported for binary documents.