Each slide is its own part, such as ppt/slides/slide1.xml, with the root
element p:sld. The part names say nothing about the order: that comes from
p:sldIdLst. A slide’s
relationships lead to its layout, notes, comments and media.
<p:sld xmlns:p="…" xmlns:a="…" xmlns:r="…" show="1">
<p:cSld>
<p:spTree>
<p:nvGrpSpPr>…</p:nvGrpSpPr>
<p:grpSpPr/>
<p:sp>
<p:nvSpPr>
<p:cNvPr id="2" name="Title 1"/>
<p:cNvSpPr/>
<p:nvPr><p:ph type="title"/></p:nvPr>
</p:nvSpPr>
<p:spPr/>
<p:txBody>
<a:bodyPr/>
<a:p><a:r><a:t>A title</a:t></a:r></a:p>
</p:txBody>
</p:sp>
</p:spTree>
</p:cSld>
</p:sld>
The shape tree
p:spTree holds the slide’s shapes, in drawing order: the first is at the
back. It is itself a group.
| Element | Is |
|---|---|
p:sp | A shape: an auto-shape, a text box or a placeholder. |
p:pic | A picture: p:blipFill/a:blip names the image by r:embed or r:link. |
p:graphicFrame | A frame for a table, a chart, a SmartArt diagram or an embedded object. |
p:grpSp | A group that holds more of these. |
p:cxnSp | A connector. |
mc:AlternateContent | Markup compatibility: a mc:Choice for readers that know a feature and a mc:Fallback for those that do not. |
Shape properties
Each shape has a non-visual part (p:nvSpPr: id and name, and in
p:nvPr a placeholder p:ph) and visual properties in
p:spPr: position and size in a:xfrm (in EMUs), geometry and
line.
A placeholder shape has a p:ph whose type is one of
title, ctrTitle, subTitle, body,
obj, chart, tbl, dgm,
pic, dt, ftr, sldNum, and others,
and whose idx links it to the placeholder on the layout.
Tables, charts and diagrams
A p:graphicFrame holds an a:graphic whose
a:graphicData has a uri saying what it is.
| uri ends in | Holds |
|---|---|
/drawingml/2006/table | a:tbl with a:tr rows and a:tc cells, each with an a:txBody. |
/drawingml/2006/chart | A c:chart with an r:id to a chart part. |
/drawingml/2006/diagram | dgm:relIds pointing to the diagram’s data, layout, style and colour parts. |
/presentationml/2006/ole | An embedded OLE object. |
Slide settings
On p:sld, show="0" hides a slide from the show. Transitions
and animations are in p:transition and p:timing, after
p:clrMapOvr.
Slide extensions from [MS-PPTX]
Read in research/ooxml/ms/MS-PPTX.txt (v20240820): 2.2.6, 2.2.9, 2.3.1.4, 2.3.1.17, 2.3.1.19, 2.3.1.26,
2.3.3.7-9, 2.3.3.16, 2.3.3.17, 2.3.3.19, 2.3.3.21, 2.3.3.28, 2.3.3.31, 2.3.4.6. Namespace
http://schemas.microsoft.com/office/powerpoint/2010/main, each element inside a p:ext of the stated parent.
Parent’s extLst | ext uri | Child | Meaning |
|---|---|---|---|
p:sld | {3A86A75C-4F4B-4683-9AE1-C65F6400EC91} | laserTraceLst |
List of laser traces on the slide (CT_LaserTraceList, 2.3.3.8): tracePtLst elements (CT_LaserTrace, 2.3.3.7), each a list of
tracePt points. The first point says when and where the laser dot appears, the last when and where it disappears.
A tracePt (2.3.3.9) has required t (time from the start of the slide timeline, not counting the transition),
x and y (a:ST_Coordinate, from the top left corner of the slide). |
p:sld | {E180D4A7-C9FB-4DFB-919C-405C955672EB} | showEvtLst |
Slide show events recorded during the show (CT_ShowEventRecordList, 2.3.3.28), in any order and number: triggerEvt
(2.3.3.31: required type from p:ST_TLTriggerEvent, time, objId), playEvt,
stopEvt, pauseEvt, resumeEvt (2.3.3.16: time, objId of the media object),
seekEvt (2.3.3.17: time, objId, and seek, the position in the media to jump to) and
nullEvt (2.3.3.19: an unknown event kept for future extension; time, objId). Times are relative to the
start of the slide timeline, without the transition. |
p:cSld | {BB962C8B-B14F-4D97-AF65-F5344CB8AC3E} | creationId |
An identifier generated when the slide is created (2.2.9, 2.3.1.4). CT_RandomId (2.3.3.21): required val, an unsigned int,
“a cryptographically strong random number”. |
p:nvPr | {D42A27DB-BD31-4B8C-83A1-F6EECF244321} | modId |
An identifier updated each time a shape is modified (2.3.1.19), same type as creationId. Each identifier must be unique to the slide
that contains it. |
ST_UniversalTimeOffset (2.3.4.6), used by all the times above, is a string TIME [UNITS]: digits with an optional
fraction, then h, min, s, ms, µs or ns; with no unit the value is in milliseconds.
The explorer shows none of these as drawn content (they describe the live show and editing history); the Overview tab lists them in the table “Slide extensions” with the raw values.
Rules and defaults
Sources read: ECMA-376 5th edition Part 1 (research/ooxml/ecma376/p1/part1.txt) 19.3.1.12, 19.3.1.13, 19.3.1.33,
19.3.1.36, 19.3.1.38, 19.3.1.45 and Annex A.3 (CT_Slide, CT_Placeholder,
ST_PlaceholderType, ST_PlaceholderSize, AG_ChildSlide); [MS-OI29500] v20260818 2.1.1118 to
2.1.1135; python-pptx oxml/shapes/autoshape.py and groupshape.py (research/pptx/src/).
p:sld (19.3.1.38, Annex A.3)
- Children in order:
cSld(required),clrMapOvr(theEG_ChildSlidegroup),transition,timing,extLst. Note that the standard’s own example spells the elementp:clrMapOver; the schema name isclrMapOvr. - Attributes:
show(boolean, default true: the slide is shown in the slide show),showMasterSp(default true: shapes of the layout and master are drawn) andshowMasterPhAnim(default true), the last two fromAG_ChildSlide. - PowerPoint uses
sldas the root element of a slide part ([MS-OI29500] 2.1.1128 a); the standard’s sentence speaks of a slide in a list.
Shape tree (19.3.1.45)
- Every shape-based object, grouped or not, is one level of z-order, and the order in the file is the z-order: the first is lowest (drawn first, at the back), the last highest. The same order is the navigation (tab) order.
- PowerPoint draws the shapes of a notes master in the order written, and always draws the note text in the foreground ([MS-OI29500] 2.1.1124 b).
p:controlsmay not be a child ofcSldwhen its parent is a handout master, a notes slide or a notes master (2.1.1121 a).bgPrmay not holdgrpFillin PowerPoint (2.1.1119 a).
Non-visual properties
p:cNvPr(19.3.1.12):id(required, ST_DrawingElementId) must be unique in the document, otherwise the document is non-conformant;name;descr(alternative text; absent means none);title(absent means none);hidden(absent means shown). python-pptx gives a new shape the lowest unused positive id, starting from 1 and reusing gaps; thespTreeitself has id 1, so the first shape gets 2 (pptx-oxml-shapes-groupshape.py236-249).p:cNvSpPr(19.3.1.13):txBox(default false) marks a text box; a shape that is not marked can still hold text. python-pptx: a text box is ap:spwhosetxBoxis true; an auto shape hasa:prstGeomand notxBox; one witha:custGeomis a freeform (pptx-oxml-shapes-autoshape.py213-241).p:nvPr(19.3.1.33):isPhotoanduserDrawn. PowerPoint does not supportisPhotoundernvGrpSpPr, and does not allowphundernvCxnSpPrornvGrpSpPr(2.1.1126 a, b). PowerPoint identifies photo album pictures byisPhotoonnvPr(2.1.1106 a).
Placeholders (p:ph, 19.3.1.36, Annex A.3)
| Attribute | Type and default |
|---|---|
type | ST_PlaceholderType, default obj: title, body, ctrTitle, subTitle, dt, sldNum, ftr, hdr, obj, chart, tbl, clipArt, dgm, media, sldImg, pic (16 values). |
orient | ST_Direction, default horz. |
sz | ST_PlaceholderSize, default full: full, half, quarter. |
idx | unsignedInt, default 0; used to match placeholders when a layout or template changes. |
hasCustomPrompt | boolean, default false. |
The standard says nothing about inheritance. PowerPoint: a slide placeholder inherits from the layout placeholder with the same
idx; a notes slide placeholder from the notes master placeholder with the same type ([MS-OI29500] 2.1.1127 b).
Rules PowerPoint adds for idx (2.1.1127 a): on a master, notes master, handout master, layout or notes slide the value is
not 0xffffffff; no two placeholders on one of those parts share a value; no two on a slide share a value unless it is 0xffffffff;
and a slide placeholder whose value is not 0xffffffff has a placeholder with the same value on its layout.
Tags
A p:tag needs both name and val in PowerPoint, and names are unique within one
tagLst, ignoring case (2.1.1135 a to c). PowerPoint stores the automatic slide timings as the tag named
TIMING, whose value is a list of seconds, each preceded by |, rounded to a tenth of a second
(for example |2.9|3.5|4.6), and empty when the slide has no animation (2.1.1135 d).
Custom data and embedded objects
The standard does not say what custData's id refers to; PowerPoint requires it to name a valid data store item
([MS-OI29500] 2.1.1122 a). PowerPoint uses embed and link for OLE objects, embedded and linked
(2.1.1132 a, 2.1.1133 a), and oleObj as the global element for them (2.1.1134 a). On control and
oleObj, imgW and imgH are the width and height of the thumbnail image, not of the control
(2.1.1131 b, c; 2.1.1134 b, c), and showAsIcon records the user's choice to show the object as an icon
(2.1.1131 a, 2.1.1134 d). The xfrm of a graphic frame follows the DrawingML notes (2.1.1130).
Divergence from spec: python-pptx slide classes
Compared line by line with research/pptx/src/pptx-oxml-slide.py against Annex A of Part 1
(part1.txt lines 158148 to 158475).
- Agreement. The child orders in the file match the schema:
CT_Slide(cSld,clrMapOvr,transition,timing,extLst; python-pptx line 162),CT_SlideLayout(line 257, addshf),CT_SlideMaster(lines 287 to 296:clrMap,sldLayoutIdLst,transition,timing,hf,txStyles),CT_NotesMaster(line 132) andCT_NotesSlide(line 145).CT_CommonSlideDatahasbg,spTree,custDataLst,controls,extLst(line 97) and anamethat defaults to the empty string (line 103), as in Annex A. - Background. Annex A gives
p:bgabwModeattribute (defaultwhite) and a choice ofbgProrbgRef; python-pptx declares the choice (lines 44 to 48) but nobwMode, and builds a new background asbgPrwithnoFilland an emptyeffectLst(lines 51 to 56). Its fill choices inbgPrincludegrpFill(line 80), which PowerPoint does not allow there ([MS-OI29500] 2.1.1119 a, above). - New slide. python-pptx writes a new slide with a
spTreeholding the group shape id 1 with an empty name, andclrMapOvrwitha:masterClrMapping(lines 234 to 251): the form PowerPoint writes for a slide that follows its master’s colour mapping. - Timing. python-pptx replaces any existing
p:timingwhen it adds a video (lines 196 to 205), and the new one has a root time node (tmRoot,dur="indefinite",restart="never") with an empty child list; itsp:videohascMediaNode vol="80000"and a start condition withdelay="indefinite"(lines 317 to 329). Its own comment says this may drop timing the file already had. - Connectors (
pptx-oxml-shapes-connector.py).p:cxnSphasnvCxnSpPr,spPr,style,extLst(line 30), asCT_Connectorin Annex A (part1.txtline 157935). Inp:cNvCxnSpPrthe order iscxnSpLocks,stCxn,endCxn,extLst(line 104; Annex A line 160426); python-pptx modelsstCxnandendCxn, each with a requiredid(the connected shape) andidx(a connection site number, unsigned; lines 23 and 24). A new connector gets ap:stylewithlnRef idx="2",fillRef idx="0",effectRef idx="1"(all accent 1) andfontRef minor(tx1) (lines 68 to 81), and flips are written asflipHandflipVona:xfrm(line 49). The explorer draws a connector from its geometry and line only;stCxnandendCxnare not followed, so a connector is not rerouted to its shapes: the spec gives no rerouting rule and the storeda:xfrmis what a reader draws. The package check does report a connection whoseidnames no shape on the slide (Annex C, DrawingML Main). - Not modelled. python-pptx declares no
transitionelement on a slide, a layout or a master (only the position of one in the sequence), and nopreserveattribute on a master (Annex A, default false).
Divergence from spec: python-pptx shape classes
Compared line by line with research/pptx/src/pptx-oxml-shapes-autoshape.py against Part 1 19.3.1.13 (part1.txt line 94966),
20.1.9.8 (line 106278) and CT_Path2D, CT_CustomGeometry2D, CT_PresetGeometry2D in dml-main.xsd (Transitional, lines 2064 to 2105).
- Agreement: text box flag. Part 1 says an omitted
txBoxmeans the shape is not specifically a text box (and may still carry text). python-pptx readstxBoxas an optional boolean (line 80),is_textboxis true only when it is true (lines 235 to 241) andis_autoshapeneeds aprstGeomand notxBox="1"(lines 223 to 232). - Agreement: child orders.
CT_CustomGeometry2DisavLst, gdLst, ahLst, cxnLst, rect, pathLstin the schema and in python-pptx (line 50);CT_PresetGeometry2Dholds only an optionalavLstand a requiredprst(line 170).p:spisnvSpPr, spPr, style, txBody, extLstin the schema; python-pptx declaresnvSpPr,spPrandtxBodywithextLstas the only successor (lines 198 to 200), so it does not modelp:stylebut keeps one it finds. - Divergence:
pathLstis required. The schema givespathLstminOccurs="1"in a custom geometry; python-pptx declares itZeroOrOne(line 51) and writes an empty<a:pathLst/>for a new freeform (line 319), which is valid because an empty list satisfies the type. - Divergence: path commands.
a:pathis an unbounded choice ofclose, moveTo, lnTo, arcTo, quadBezTo, cubicBezTo, in drawing order (schema line 2065). python-pptx models onlyclose,moveToandlnToas three separateZeroOrMorechildren with no successors (lines 92 to 94), so it cannot build or reorder paths with curves; the other three commands and the attributesfill(defaultnorm),stroke(default true) andextrusionOk(default true) are not modelled, andwandhare optional there as in the schema (default 0). - Guides. A
a:gdhas requirednameandfmlastrings (lines 62 and 63); python-pptx rewrites adjustments asval Nformulas (line 190). python-pptx does not evaluate guide formulas. - Written forms. A new autoshape has
p:stylewithlnRef 1,fillRef 3,effectRef 2(accent 1) andfontRef minor(lt1) and abodyPr rtlCol="0" anchor="ctr"with a centred paragraph (lines 253 to 290); a new text box hastxBox="1",prstGeom rect,noFillandbodyPr wrap="none"withspAutoFit(lines 414 to 441); a new placeholder has an emptyspPrand atxBodyonly for title, centre title, subtitle, body and object types (lines 374 to 383).
Divergence from spec: Apache POI XSLFSimpleShape (outline, anchor, shadow, geometry)
Compared line by line with research/pptx/src/poi-XSLFSimpleShape.java (every line read) and
poi-DrawSimpleShape.java (line end drawing) against Part 1 20.1.2.2.24 ln (part1.txt line 101365),
20.1.8.38 headEnd (line 105490), 20.1.10.15 and 20.1.10.31 to 20.1.10.35 (lines 107229, 107558 to 107617).
- Defaults of
a:ln. The standard says:capomitted meanssq,cmpdomitted meanssng,womitted means 0 (line 101380 to 101394). POI readscap,cmpdandprstDashfrom the shape, then from the placeholder chain (fetchShapeProperty), then from the theme line style named bylnRef(lines 208 to 238); it never applies the standard’ssqdefault, it returns nothing forcapwhen none is found, and the width is 0 when neither the shape nor the theme gives one (lines 412 to 424). The explorer draws an omitted cap as flat (butt) and applies the standard’s attribute valuesflat,rndandsqwhen present: a divergence from the spec’ssqdefault that follows POI and the cap values the theme styles always state. - Theme line style index. POI takes line style number
idxoflnStyleLstasgetLnArray(idx - 1)and returns nothing when the list is shorter thanidx(lines 233 to 237);idx0 is not caught there and would index -1. For the line paint it testsidx <= 0first and returns nothing (line 337). The standard (20.1.4.2.19,part1.txtline 103708) says only thatidxis the index of a style in the style matrix, and words it as an index into thefillStyleLstelement, which is a slip: both POI and PowerPoint files uselnStyleLstforlnRef. - Anchor and rotation. POI returns no anchor when
a:xfrmhas noa:off(lines 126 to 129), a rotation of 0 withoutxfrmorrot(line 170), and flips false without the attributes (lines 192 and 198); rotation is stored in 60000ths of a degree (line 163). The explorer inherits the box from the layout or master placeholder when the slide shape has noxfrm. - Compound line quirk. POI’s
getLineCompound(lines 457 to 489) returns a value only when the shape and its placeholders give nocmpdand the theme style does; when the shape itself statescmpdthe method falls through toreturn null. So a program that relies on it sees no compound type for exactly the shapes that set one. - Line ends. POI reads
headEndandtailEndonly from the shape’s owna:ln(lines 778 to 953), defaulting tonone, widthmedand lengthmed, without looking at the placeholder chain or at the theme line style. The standard (20.1.8.38) liststype,wandlenwithout defaults and gives the sizes only as pictures relative to the line width (20.1.10.32, 20.1.10.34). POI draws a decoration with scale 1.5 to the power (n + 1), n = 0, 1, 2 for sm, med, lg, times the larger of 2.5 and the line width (poi-DrawSimpleShape.javalines 56, 200, 214 and 215, 278, 292 and 293), and aligns it with the diagonal of the shape’s box (atan(height / width), lines 207 and 285), which is wrong for a flipped or curved line.stealthis drawn asarrow(an open chevron), anddiamondis not drawn at all (lines 223 to 257 and 300 to 334). The explorer uses POI’s sizes, but aligns each decoration with the last segment of the drawn path and draws all five types (arrow as an open chevron, triangle, stealth, diamond and oval filled). - Shadow. POI reads only
effectLst/outerShdw, from the shape or the placeholder chain, otherwise from theeffectStyleLstitemeffectRef idx - 1of the theme (lines 641 to 676); it ignores other effects, aneffectDag, and fails when the index is past the end of the list or the style has noeffectLst. The explorer draws outer, inner, soft edge, glow and reflection (see the effects section on the overview). - Geometry. POI uses a
prstGeomby name from its table and throwsIllegalStateExceptionfor a name it does not know; with neitherprstGeomnorcustGeomin a shape that has a geometry property, it usesrect(lines 681 to 703).getAdjustValuelooks a guide up by name in the shape’s ownavLstonly, so a default adjust value of a preset is not returned (lines 955 to 971). The explorer evaluates the 186 preset definitions ofpresetShapeDefinitions.xmlwith the shape’s own adjust values over the preset’s defaults. - Fill and line set to none. POI’s
setLineWidth(0)writesnoFilland removesw(lines 362 to 377), so a width of 0 and no line are the same thing in POI.setFillColor(null)testsisSetPattFillbut then removes the gradient fill (lines 605 to 607), so a pattern fill is left in place beside the newnoFill.getFillColorreturns a colour only for a solid fill, and nothing for gradient, pattern or picture (lines 628 to 635). - Hyperlink. POI takes the shape link from
cNvPr/hlinkClick(lines 1073 to 1090) and creates it there. - Compound lines. The explorer draws
cmpdother thansng(ST_CompoundLine, 20.1.10.15) on shapes as parallel stripes of the stated total width, with proportions of its own because the standard gives none; the borders of table cells are still drawn as one stroke.
Divergence from spec: Apache POI XSLFShape (inheritance, fills, style matrix)
Compared with research/pptx/src/poi-XSLFShape.java (every line read) against Part 1 20.1.4.2.10 fillRef (part1.txt line 103522) and 20.1.10.57.
- Inheritance. A property is looked up on the slide shape, then on the layout placeholder, then on the master placeholder, matched by placeholder type and index (lines 335 to 379). POI’s own comment at line 328 says that themes and their defaults are not handled correctly. The explorer follows the same order for fill, line and geometry.
- Style matrix index. The standard says
fillRef idx0 or 1000 means no fill, 1 to 999 indexfillStyleLstand 1001 and up indexbgFillStyleLst(1001 is the first). POI follows the same split (lines 435 to 478). The explorer now applies all three ranges to shapes as well as to table styles; before, a shape withidx1001 or 1000 took the wrong list. - Line override. A shape’s own
a:lnoverrides the theme line style named bylnRefproperty by property; the explorer merges them this way (width, dash, cap, join, ends), and takes thelnRefcolour when the shape’s line has no fill of its own.
Divergence from spec: Apache POI XSLFPictureShape and XSLFConnectorShape
Compared with research/pptx/src/poi-XSLFPictureShape.java and poi-XSLFConnectorShape.java (every line read) against Part 1 20.1.8.6 alphaModFix (part1.txt line 104975).
- Embedded and linked pictures. POI treats a picture as linked when
a:bliphas nor:embedbut anr:link(lines 122 to 124, 197 to 216); the link target is read from the slide’s relationship (lines 153 to 171). The explorer shows a grey frame saying the picture is linked and not loaded. - Crop. POI reads
a:srcRectinto four insets (top, left, bottom, right) as percentages (lines 218 to 227), and returns nothing when the element is missing; it does not reada:fillRectora:tileof the picture’s fill. The explorer crops bysrcRectand stretches the result over the shape box. - Opacity. POI reads the first
alphaModFixchild of the blip and returns itsamtas the picture alpha, 100% when absent (lines 229 to 235). The standard says the effect multiplies alpha by a fixed percentage; the explorer appliesamtto the whole picture (noamtmeans 100%), and applies grayscale, bi-level, duotone, colour replacement, luminance and the alpha effects as an SVG filter (media page;hsl,tintandclrChangeare not applied). - SVG. A picture can carry a vector copy under
a:blip/a:extLst/a:extwith the URI{96DAC541-7B7A-43D3-8B79-37D633B846F1}and anasvg:svgBlipelement whoser:embednames the SVG part; the bitmap stays as the fallback (lines 75 to 78, 331 to 350, 243 to 278). The explorer shows the bitmap only. - Media. A picture is a video when
nvPrhasvideoFileand an audio when it hasaudioFile; the link is ther:linkof that element (lines 454 to 503). The explorer draws the badge and control bar described on the media page. - Connectors. POI’s connector is a simple shape whose shadow is always dropped (lines 64 to 70, a comment saying shadows of lines are suppressed) and which refuses to be a placeholder with an exception (lines 72 to 75); a new one has
prstGeom lineand an emptya:ln(lines 47 to 61). Neither of these two classes readsstCxnorendCxn, so POI never reroutes a connector; the explorer also draws the stored box and geometry only and reports a connection naming an absent shape id.
Divergence from spec: Apache POI XSLFGroupShape
Compared with research/pptx/src/poi-XSLFGroupShape.java (every line read) against Part 1 20.1.7.1 chExt, 20.1.7.2 chOff and 20.1.7.5 xfrm for grouped objects (part1.txt lines 104774, 104796, 104879).
- Child coordinate space. The standard says the child extents rectangle (
chOff,chExt) is used for the grouping, scaling and rotation of the children. POI reads it as the “interior anchor” (lines 119 to 128) and the group box as the anchor (lines 86 to 95), and performs no mapping itself: both methods fail with a null pointer whena:off,a:ext,a:chOffora:chExtis missing (they callgetOff(),getExt()without a test), where the schema makes these optional (Annex A.4.1,CT_GroupTransform2D,part1.txtline 160077). The explorer maps a child with the scale (ext/chExt) and offset (off-chOfftimes scale), takeschOffandchExtfromoffandextwhen they are missing, treats a zero child extent as 1, and nests to a depth of 32. A group withoutofforextapplies no mapping: its children are drawn in the coordinates of the group around it. - Flip and rotation. The standard (20.1.7.5) says a group flip is about the centre of the group’s bounding box and the rotation is clockwise. POI only stores and returns the flags and the angle (lines 324 to 354: rotation is the stored value divided by 60000, the unit of
ST_Angle; the sentence in 20.1.7.5 says 1/64000 of a degree, which is a slip against 20.1.10.3). The group’s flips and rotation are applied by POI’s drawing classes, not in this file. The explorer mirrors the child boxes about the group centre (centre moved, own flip flags toggled, rotation sign changed when one axis is mirrored; text is not mirrored, as with a shape’s own flip), and rotates the group about its centre after the flip, also for groups inside flipped groups. - Shape kinds in a group. POI’s group holds
sp,grpSp,cxnSp,graphicFrameandpicchildren (the cases ofremoveShape, lines 177 to 193) and throwsIllegalArgumentExceptionfor another element. Copying a group warns and skips a child that is not a text box, freeform, auto shape, connector, picture, group or table (lines 379 to 400); OLE objects are not copied. The explorer draws the same five kinds, and looks insidemc:AlternateContent. - Ids. Removing a shape deregisters its id from the sheet (line 176), and a new group is named
Group NwithNas the id (lines 203 to 214). The standard asks forcNvPr idto be unique in the document (19.3.1.12, above); the explorer does not renumber and does not check this. - Adding a shape from elsewhere is refused (
addShape, lines 427 to 431); a shape must be created inside the group. This is an API rule, not a file rule.
Divergence from spec: Apache POI XSLFGraphicFrame
Compared with research/pptx/src/poi-XSLFGraphicFrame.java (every line read) against Part 1 19.3.2.4 oleObj (part1.txt line 96026) and the p:xfrm of a graphic frame (CT_Transform2D).
- Kind by URI. POI chooses the class from the
uriofa:graphicData: the table URI gives a table, the OLE URI an object shape, the diagram URI a diagram, every other URI (the chart URI included) a plain frame; a frame with nographicorgraphicDatahas the empty URI and is a plain frame (lines 115 to 132). A chart is found throughc:chart/@r:idand the slide’s relationship of that id (lines 204 to 223); a frame without that id has no chart. The explorer reads the same URIs (chart, diagram, OLE) and takes a table from ana:tblchild whatever the URI says; anything else is shown as a labelled box, “Embedded content”. - Anchor. POI’s
getAnchorthrowsIllegalArgumentExceptionwhenp:xfrm,a:offora:extis missing (lines 75 to 96). The explorer draws nothing for a frame withoutxfrm(the schema requires it inCT_GraphicalObjectFrame). - Rotation and flips. POI’s frame always reports rotation 0 and no flips, and its setters throw (lines 143 to 185), although
p:xfrmis aCT_Transform2Dwithrot,flipHandflipV. The explorer does the same: the attributes on a frame are not drawn (a frame inside a flipped group is moved with the group, not mirrored). - Fallback picture. POI’s
getFallbackPicture(lines 307 to 332) finds the firstp:picundermc:Fallbackof the frame. This is where PowerPoint puts the picture of an embedded object: 19.3.2.4 says that whenoleObjholds apic, itscNvPr idis ignored and the id of the graphic frame is used. The explorer now draws an OLE frame by that picture (the firstp:picinsidea:graphicData, taken wherever it sits, with its ownxfrm), and shows the box “Embedded object” only when there is none. The object’s own data (p:embed,p:link,progId,showAsIcon) is not read or run: the picture is all the viewer shows. - Copying (lines 225 to 305) duplicates a chart with its workbook and a diagram’s four parts (data, layout, quick style, colours) and does nothing for other kinds; it is an API behaviour, not a file rule.
Divergence from spec: python-pptx graphic frames and OLE objects
Compared with research/pptx/src/pptx-oxml-shapes-graphfrm.py (every line read) against Part 1 19.3.2.4 oleObj.
- Which
oleObj. python-pptx takes the lastp:oleObjfound undera:graphicData(lines 104 to 116), because anmc:AlternateContentthere can hold several choices and the last is the lowest common denominator. The explorer takes its picture from the firstp:picfound under the frame, which for PowerPoint’s files is the one inmc:Fallback(the last in document order). - Embedded or linked is decided by the presence of a
p:embedchild (lines 339 to 342);showAsIcondefaults to false when absent (lines 335 to 337) andprogIdandr:idare optional. The explorer does not read these attributes (see the POI note above). - Frames it writes. A new frame gets
a:graphicFrameLocks noGrp="1"and a requiredp:xfrm; a table frame has the table URI and ana:tbl, a chart frame the chart URI and ac:chartwith anr:id; an OLE frame is written as an icon (showAsIcon="1") with ap:embedand ap:picwhosecNvPrhas id 0 and an empty name (lines 180 to 308). These are writing choices, not rules the standard states.
Divergence from spec: python-pptx shared shape elements (placeholder, transform, shape properties, line)
Compared with research/pptx/src/pptx-oxml-shapes-shared.py (every line read) against Part 1 19.3.1.36 ph and the DrawingML xfrm, spPr and ln types.
- Placeholder defaults.
p:phwithout attributes means typeobj, orientationhorz, sizefulland index 0 (lines 309 to 323). A shape is a placeholder when./*[1]/p:nvPr/p:phexists (lines 92 to 98), that is, when the first child (nvSpPr,nvPicPrand so on) holds one. These are the defaults ofCT_Placeholderinpml.xsd(typeobj, orienthorz, szfull, idx 0,hasCustomPromptfalse); the text of 19.3.1.36 gives none. The explorer treats a missing type asbody, and matches a slide shape to the master’s shape of typebodyforobjas well, so the two agree on a master; on a layout it matches by index first and then by type. - Transform.
a:xfrmhas the childrenoff,ext,chOff,chExtand the attributesrot(default 0),flipHandflipV(default false); one class serves shapes and groups (lines 444 to 463). A shape with noxfrmreports no position (lines 183 to 190, 418 to 438); the explorer looks for the position in the matching layout shape and then the master shape (findPlaceholderinpptx/render.js). - Shape properties order. The order it keeps in
p:spPris xfrm, custGeom, prstGeom, one fill, ln, effectLst, effectDag, scene3d, sp3d, extLst (lines 355 to 371); it addslnafter the fill andeffectLstafterln. It does not model the other effect or 3-D children; they are kept as they are. - Line. Its line class models only the fill choice,
prstDash,custDashand the widthw(default 0 EMU, lines 239 to 292). The compound typecmpd, the cap, the joins and the arrow ends are not modelled, so a program that rewrites a line through it leaves those untouched. The explorer reads all of them (compound lines as parallel stripes; see the overview). - Hyperlinks on a shape.
p:cNvPrholdshlinkClickthenhlinkHoverthenextLst(lines 295 to 306);idandnameare required.
Divergence from spec: Apache POI XSLFSheet (shape tree, alternate content, placeholders, colour map)
Compared with research/pptx/src/poi-XSLFSheet.java (every line read), the base class of slides, layouts, masters and notes. The explorer’s side is pptx/render.js.
- Which children of the shape tree count.
buildShapeswalks the children ofp:spTreein document order and builds a shape forsp,grpSp,cxnSp,picandgraphicFrameonly (lines 146 to 161); every other child,contentPart(19.3.1.14) included, is dropped. The explorer draws the same five and, for acontentPartoutside alternate content, a labelled box at itsp14:xfrm(MS-PPTX 2.3.1.34), because 19.3.1.14 says an application that cannot process the content should carry on and, if possible, indicate that it was not imported. - Alternate content. For an
mc:AlternateContentchild POI goes into the firstmc:Choice, whatever itsRequiressays, and parses only the first element inside it as a group, so any later element of the Choice is lost and the Fallback is never read (lines 162 to 177, with a comment in the code admitting the loss). The explorer reads every element of the branch it picks, and picks the Fallback when the Choice requires a namespace it cannot draw (a14,cx,aink,am3d,p164) or holds acontentPart(MS-PPTX 2.2.3 and 2.2.3.1 give apicas the Fallback of a content part). - The shape tree itself. POI takes the first
p:spTreefound anywhere below the root (lines 410 to 426) and fails when there is none. A slide, layout or master has exactly one, insidep:cSld. - Placeholders. POI finds the shape a placeholder inherits from first by
idx, then bytype(lines 566 to 576). In the by-type table a placeholder with an explicitidxother than 0 never replaces one without anidxor withidx0, but is kept when it is the only one of its type (lines 593 to 603), so a second title on a layout does not take over the first one’s style. Only text shapes are placeholders (line 585). Placeholder numbering is the order of the tree. - Master graphics. The base class answers “do not show the master’s shapes” (lines 646 to 649) and leaves the rule to the slide and layout classes; they read
showMasterSp(19.3.1.39 describes it on a layout; the schema groupAG_ChildSlide,part1.txtline 158130, gives it, default true, to slides and layouts alike). The explorer shows the master and layout shapes unless the slide or the layout hasshowMasterSp="0". - Colour map. A scheme colour is mapped by the slide’s
clrMapOvr/overrideClrMappingwhen it has one, otherwise by the master’sclrMap, and is left as it is when neither names it (lines 761 to 791). The explorer starts from the master’s map (through the layout), lets the layout’s ownoverrideClrMappingreplace each name it lists (19.3.1.7 allows one on a slide layout; this was missing until round 36), and then the slide’s override the same way;masterClrMappingkeeps the map found so far. - Shape ids. POI allocates the lowest id not yet used, starting at 1, and only logs a warning when a file uses an id twice (lines 119 to 131). The explorer neither renumbers nor checks.
- API only, not file rules: adding a shape from another container is refused (lines 340 to 346); removing a shape of a kind other than the five above throws (line 391);
importContentandappendContentcopy the tree and then copy each shape (lines 450 to 511), andappendContentcopies only the five kinds.
Divergence from spec: Apache POI XSLFSlide
Compared with research/pptx/src/poi-XSLFSlide.java (every line read) against 19.3.1.38 sld (part1.txt line 95556).
- Master graphics. A slide shows the master’s shapes when
showMasterSpis true; POI returns the attribute through the generated bean (line 284), which carries the schema default, true (part1.txtline 158131). The explorer reads it the same way, and also stops when the layout says0. - Layout, notes and comments relationships. For the layout and the notes POI loops over all relationships without stopping, so the last one of the kind wins (lines 150 to 154, 228 to 232); for the comments it stops at the first (lines 173 to 178). A slide with no layout relationship throws (lines 156 to 158). The explorer takes the first relationship of each kind; a slide with no layout relationship is listed without a layout and drawn without one, with no error.
- Comments. POI lists only the legacy comments of the comments part, through
cmLst/cm(lines 211 to 223); the modern comment parts (MS-PPTX threaded comments with a status and replies) are not read. The comments part class (poi-XSLFComments.java, every line read) parses the part as acmLstdocument and offers the count, the list and access by position (lines 54 to 69); it knows nothing of authors, positions or replies. The authors are looked up on the slide’s own relationships first and then on the presentation’s (lines 189 to 208). The explorer reads both kinds, with the status, assignment and replies of the modern ones; its authors come from the presentation part. - Title. POI’s
getTitlereturns the text of the first text shape whose placeholder type istitle(lines 257 to 261), so a slide whose title is actrTitlehas none. The explorer takestitleandctrTitlealike. - Background. A slide’s own
cSld/bgif there is one, otherwise the layout’s background, which in turn falls back to the master’s (lines 272 to 280). The explorer follows the same chain, slide then layout then master. POI’s “follow master background” and “follow master colour scheme” answer false and refuse to be set (lines 347 to 382; the code comment says the first is not in the specification). - Hidden slides and names. A slide is hidden when
showis set and false (lines 426 to 430); the name iscSld/@nameor “Slide” and the 1-based position (lines 432 to 436). The explorer marks a hidden slide (show0 or false) and numbers slides by their order insldIdLst. - Colours. The slide’s
clrMapOvris consulted first, then the master’s map (line 438 to 441, with the base class). A new slide is created withclrMapOvr/masterClrMappingand a group tree with zero offset and extent (lines 92 to 119); an API default, not a rule. - Copying a slide (
importContent, lines 307 to 345) copies the notes and only a background the slide itself has, importing its picture; it is an API behaviour.
Divergence from spec: Apache POI XSLFSlideLayout
Compared with research/pptx/src/poi-XSLFSlideLayout.java (every line read) against 19.3.1.39 sldLayout (part1.txt line 95583).
- Master. The layout’s master is the last slide master relationship in the part, and a layout without one throws (lines 76 to 88); the theme is the master’s (lines 95 to 98). The explorer takes the first
slideMasterrelationship. - Master graphics and background.
showMasterSpof the layout is read through the bean, default true (lines 101 to 104). The layout’scSld/bg, if any, else the master’s (lines 106 to 114). The explorer does the same (it also skips the master’s shapes when the slide itself saysshowMasterSp="0"). - Colour map. POI maps scheme colours with the layout’s own
clrMapOvrand then the master’s map (lines 147 to 150); 19.3.1.7 says anoverrideClrMappingcan be specific to a slide layout. The explorer now applies it to every slide on that layout. - Type. The layout type is the number of the
typevalue minus one used as a position in POI’s own list (lines 141 to 144); the list must follow the order ofST_SlideLayoutType(19.7.15) for that to be right, and a layout with notypefails. The explorer shows the attribute text and shows nothing when it is absent. - Placeholders copied to a new slide (
copyLayout, lines 121 to 135) are the text placeholders except date, slide number and footer; an API behaviour, not a file rule.
Divergence from spec: Apache POI XSLFSlideMaster
Compared with research/pptx/src/poi-XSLFSlideMaster.java (every line read) against 19.3.1.52 txStyles (part1.txt line 95883) and 19.3.1.42 sldMaster (line 95662).
- Layouts. POI collects the layouts from the master’s relationships into a map keyed by the lower-cased layout name (lines 87 to 98), so two layouts with the same name (the schema does not make names unique) leave only one, and the order of
sldLayoutIdLstis lost (a hash map has no order). Lookup by type takes the first match in that map (lines 115 to 122). The explorer lists the layouts a slide uses by part, in the order the slides use them, and does not key anything on the name. - Which text style applies. POI picks
titleStylefor title, centred title and subtitle placeholders,bodyStylefor body, andotherStylefor everything else (lines 139 to 148). The standard only says that the three elements give the formatting of title text, body text and other slide text (19.3.1.52) and does not name placeholder types. The explorer pickstitleStylefortitleandctrTitle, andbodyStyleforbody,subTitle,obj,chart,tbl,clipArt,dgm,media,sldImgandpic; the rest takeotherStyle. The two choices differ for a subtitle that has no level formatting of its own on the layout or the slide; no sample or document consulted settles which one the standard intends. - Background and theme. A master’s
cSld/bgis returned as it is, and null when there is none (lines 150 to 158), and the theme is the master’s theme relationship (lines 160 to 163). The explorer draws no background when neither slide, layout nor master has one. - Colour map. The master’s
clrMapmaps a scheme name, and a name it does not list stays as it is (lines 165 to 169). The explorer starts fromclrMapin the same way, and, for bg1, tx1, bg2 and tx2 that no map lists, uses lt1, dk1, lt2 and dk2.
Timing and transitions are described on Animations and Slide transitions.