-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description
When a PPTX shape has both a solid fill (or gradient) AND text content, the parser emits it as a TextBox and discards the fill color, stroke, rotation, opacity, and shadow. This causes shapes with background colors and text to lose their background.
Root Cause
In crates/office2pdf/src/parser/pptx.rs (line ~2068-2111), the shape finalization logic is:
let has_text = paragraphs.iter().any(|p| !p.runs.is_empty());
if has_text {
// TextBox — only text content, fill/stroke/etc. discarded
kind: FixedElementKind::TextBox(blocks),
} else if let Some(ref geom) = prst_geom {
// Shape — fill, stroke, rotation preserved
kind: FixedElementKind::Shape(Shape { fill: shape_fill, ... }),
}The TextBox branch does not carry any shape properties. So a rectangle with solidFill="#003366" and text "Section Title" inside it will render as plain text with no background.
Expected
A colored rectangle with text overlaid on it.
Actual
Only the text is rendered, with no background shape.
Fix Suggestion
Either:
- Extend
FixedElementKind::TextBoxto carry optional shape properties (fill, stroke, etc.), or - Emit both a
Shapeelement and aTextBoxelement at the same position when a shape has both fill and text
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working