Upload
bryan-miles
View
261
Download
9
Tags:
Embed Size (px)
Citation preview
Office Open XML Developer Workshop
PresentationMLPresentationML
Office Open XML Developer Workshop
DisclaimerDisclaimerThe information contained in this slide deck represents the current view of Microsoft Corporation on the issues discussed as of the date of
publication. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information presented after the date of publication.
This slide deck is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS DOCUMENT.
Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this slide deck may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation.
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this slide deck. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this slide deck does not give you any license to these patents, trademarks, copyrights, or other intellectual property.
Unless otherwise noted, the example companies, organizations, products, domain names, e-mail addresses, logos, people, places and events depicted herein are fictitious, and no association with any real company, organization, product, domain name, email address, logo, person, place or event is intended or should be inferred.
© 2006 Microsoft Corporation. All rights reserved.Microsoft, 2007 Microsoft Office System, .NET Framework 3.0, Visual Studio, and Windows Vista are either registered trademarks or
trademarks of Microsoft Corporation in the United States and/or other countries.The names of actual companies and products mentioned herein may be the trademarks of their respective owners.
Office Open XML Developer Workshop
PresentationML Document ArchitecturePresentationML Document Architecture
View Properties
PresentationProperties
Code
Themes
Fonts
Notes Masters
Slides
HandoutMasters
Slide Masters
Notes Slides
Slide Layouts
Presentation
Office Open XML Developer Workshop
A TYPICAL SLIDEA TYPICAL SLIDE
Office Open XML Developer Workshop
Typical slide with common types of content:
Sample SlideSample Slide
Shape ChartTextbox
Office Open XML Developer Workshop
Slide part (slide1.xml)Slide part (slide1.xml)
<p:sld xmlns:p=“…/presentationml/2006/main” xmlns:a=“…/drawingml/2006/main” …> <p:cSld> <p:spTree> <p:sp> <p:nvSpPr> <p:cNvPr id="2" name="7-Point Star 1” /> … <p:sp> <p:nvSpPr> <p:cNvPr id="3" name="TextBox 2” /> … <p:graphicFrame> <p:nvGraphicFramePr> <p:cNvPr id="4" name="Chart 3” /> … </p:spTree> </p:cSld> <p:clrMapOvr> <a:masterClrMapping /> </p:clrMapOvr></p:sld>
Shape
Chart
Textbox
Office Open XML Developer Workshop
Shape ChartTextbox
DEMO
Chart Part (chart1.xml)
Data source
Office Open XML Developer Workshop
TABLESTABLES
Office Open XML Developer Workshop
Tables in PresentationMLTables in PresentationML
Slide part contains table definitionIn a graphicFrame elementAll DrawingML is in the slide – no separate “table part”
Table position
Table definition
Header-row formatting: YES
Banded-row formatting: YES
TableStyleID = GUID
Office Open XML Developer Workshop
Table Definition: LayoutTable Definition: Layout
EMUs: 914400/inch, 12700/pt
<a:tbl> ... <a:tblGrid> <a:gridCol w="2514600" /> <a:gridCol w="2514600" /> <a:gridCol w="2514600" /> </a:tblGrid> <a:tr h="867195"> … </a:tr> <a:tr h="1496802"> … </a:tr> <a:tr h="1496802"> … </a:tr></a:tbl>
Column widths = 2.75”
Header row height = .95”
Row 2/3 height = 1.64”
Office Open XML Developer Workshop
Table Definition: ContentTable Definition: Content
DEMO
<a:tbl> ... <a:tr h="867195"> <a:tc> <a:txBody> <a:bodyPr /> <a:p><a:r><a:t>Heading #1</a:t></a:r></a:p> </a:txBody> </a:tc> <a:tc> ... Heading #2 ...</a:tc> <a:tc> ... Heading #3 ...</a:tc> </a:tr> <a:tr h="1496802"> <a:tc> <a:txBody> <a:bodyPr /> <a:p><a:r><a:t>column 1, row 2</a:t></a:r></a:p> </a:txBody> </a:tc> <a:tc> ... column 2, row 2 ... </a:tc> <a:tc> ... column 3, row 2 ... </a:tc> </a:tr> <a:tr h="1496802"> <a:tc> <a:txBody> <a:bodyPr /> <a:p><a:r><a:t>column 1, row 3</a:t></a:r></a:p> </a:txBody> </a:tc> <a:tc> ... column 2, row 3 ... </a:tc> <a:tc> ... column 3, row 3 ... </a:tc> </a:tr></a:tbl>
<tc> - table cell
<txBody> - text body
<bodyPr> - required, but may be empty
Para/Run/Text, as in WordprocessingML
Office Open XML Developer Workshop
Table Styles – tableStyles.xmlTable Styles – tableStyles.xml
Implicit relationship from presentationStyle are identified by GUID, not rId
Office Open XML Developer Workshop
Table Styles – table part stylesTable Styles – table part styles
13 table part styles may be defined within each style:wholeTbl – formatting for the entire tableband1H – 1st/3rd/5th/etc row banding format (when enabled)band2H – 2nd/4th/6th/etc row banding format (when enabled)band1V – 1st/3rd/5th/etc column banding format (when enabled)band2V –2nd/4th/6th/etc column banding format (when enabled)lastCol – last-column formatting (when enabled)firstCol – first-column formatting (when enabled)lastRow – last-row formatting (when enabled)firstRow – first-row formatting (when enabled)seCell – southeast column format (when last-row/last-col enabled)swCell – southwest column format (when 1st-col/last-row enabled)neCell – northeast column format (when lastt-col/1st-row enabled)nwCell – northwest column format (when 1stt-col/1st-row enabled)And #14 … table background style (not actually a table part) DEMO
Office Open XML Developer Workshop
PRESENTATION ELEMENTPRESENTATION ELEMENT
Office Open XML Developer Workshop
Presentation Element <presentation>Presentation Element <presentation>Start part: presentation.xml
Relationships part: presentation.xml.rels
<p:presentation xmlns:r=“…/officeDocument/relationship“ xmlns:p=“…/presentationml/3/main"> <p:sldMasterIdLst> <p:sldMasterId r:id="rId1"/> </p:sldMasterIdLst> <p:notesMasterIdLst> <p:notesMasterId r:id="rId5"/> </p:notesMasterIdLst> <p:handoutMasterIdLst> <p:handoutMasterId r:id="rId6"/> </p:handoutMasterIdLst> <p:sldIdLst> <p:sldId id="256" r:id="rId2"/> <p:sldId id="257" r:id="rId3"/> <p:sldId id="258" r:id="rId4"/> </p:sldIdLst> <p:sldSz cx="9144000" cy="6858000" type="screen"/> <p:notesSz cx="6858000" cy="9144000"/></p:presentation>
<Relationships xmlns="http://schemas.openxmlformats.org/package/relationships"><Relationship Id="rId8” Type=“…relationships/viewProps" Target="viewProps.xml"/><Relationship Id="rId2“ Type=“…/relationships/slide“ Target="slides/slide1.xml"/><Relationship Id="rId3“ Type=“…/relationships/slide“ Target="slides/slide2.xml"/><Relationship Id="rId4“ Type=“…/relationships/slide” Target="slides/slide3.xml"/> <Relationship Id="rId9” Type=“…/relationships/theme” Target="theme/theme1.xml"/>
</Relationships>
DEMO
Sizing info
Slides
Slide MastersNotes MastersHandout Masters
Office Open XML Developer Workshop
Presentation Element: Non-Slide ContentPresentation Element: Non-Slide Content
Masters ListsSlide Masters, Notes Masters, Handout Masters
Custom ShowsSizing InformationSave-Related Properties
Embed TrueType fonts, compress pictures, modify password
Editor-Related PropertiesSmart tags, zoom scale, compatibility mode
Content-Related PropertiesFirst slide #, show placeholders, PhotoAlbum properties
HTML Publish properties, web propertiesSlide Show properties
Looping, narration, animation, timing
Office Open XML Developer Workshop
MASTERSMASTERS
Office Open XML Developer Workshop
Slide MasterSlide Master
Defines common properties for a set of layoutsLayouts inherit properties from Slide MasterSlide inherits properties from Slide LayoutSlides may override Slide Master property settings
Office Open XML Developer Workshop
Other MastersOther Masters
Notes Master: specifies master properties for slide notes page
Handout Master: specifies formatting for handout pages
Office Open XML Developer Workshop
SLIDE LAYOUTSSLIDE LAYOUTS
Office Open XML Developer Workshop
Masters and LayoutsMasters and Layouts
One master has many layouts that inherit from it<sldLayoutIdLst> list the relationship IDs for the layouts
slideMaster1.xml
slideMaster1.xml.rels
Office Open XML Developer Workshop
Anatomy of a Slide LayoutAnatomy of a Slide Layout
Placeholder Formatting
Body Placeholder
Click to add sales summary
Background Object
Headers and Footers(date, footer, slide #)
Title Placeholder
Subtitle Placeholder (TBD)Background Fill
Office Open XML Developer Workshop
Layout TypesLayout TypesTitleTextTwo Column TextTableText and ChartChart and TextDiagramChartText and ClipArtClipArt and TextTitle OnlyBlankText and ObjectObject and TextObject OnlyObject
Text and MediaMedia and TextObject over TextText over ObjectText and Two ObjectsTwo Objects and TextTwo Objects over TextFour ObjectsVertical TextClipArt and Vertical TextVertical Title and TextVertical Title and Text over ChartTwo ObjectsObject and Two ObjectsTwo Objects and Object
Office Open XML Developer Workshop
Layouts and MastersLayouts and Masters
Title Placeholder information inherited from Slide MasterOther “content” placeholders projected into Body Placeholder
Office Open XML Developer Workshop
Master Text StylesMaster Text Styles
Defined in slideMaster1.xml
Inherited by layouts
Text-style sections:TitleBodyNotesOther
Office Open XML Developer Workshop
PlaceholdersPlaceholders
Regions on slide master/layoutsPrimary purpose: organize slide content consistentlyPlaceholders are shapes and can be editedPlaceholders inherit from the slide master
Title placeholder inherits from master-slide title placeholderContent placeholder inherits from master body placeholder
Placeholders generally contain properties not contentException: placeholder text (“Click to add title”)
Rendered on masters and layouts, but not on slides
Instantiation of placeholders replaces with a new shape (except for pictures)
Office Open XML Developer Workshop
Placeholders <ph>Placeholders <ph>
Specialized instances of shapes done in client dataThey are actual shapes on the slide surfacePlaceholders cannot be grouped
Some Placeholders are projected into Body Placeholder of the previous surfaceSize is a function of Body Placeholder size
Office Open XML Developer Workshop
Any placeholder can appear on a slide or slide layoutSome placeholders can’t appear on master slide
Placeholder TypesPlaceholder Types
Placeholder type Use on Master Slide? Use on Layout? Use on Slide?
Title YES YES YES
Body YES YES YES
Center Title No YES YES
Sub-Title No YES YES
Date/Time YES YES YES
Slide Number YES YES YES
Footer YES YES YES
Object, Chart, ClipArt, Diagram, Media, Picture No YES YES
Office Open XML Developer Workshop
NOTESNOTES
Office Open XML Developer Workshop
Slide NotesSlide Notes
Adding notes to slides programmatically requires several supporting steps:
1. You must define a Notes Master2. You must define the layout of printed Notes pages3. Should include placeholders for slide image and slide #
For these reasons, you’ll want to use embedded resources for the slide notes and notes master parts
Office Open XML Developer Workshop
Slide Notes partSlide Notes part
One slide notes part for each slide that has notes
Slide notes part has two relationshipsTo the slide with which it is associatedTo the Notes Master, for layout information
Slide notes part is essentially a slide<p:spTree> element containing a slide definitionInside <p:cSld>, which is inside the root note <p:notes>
Office Open XML Developer Workshop
Slide Notes part: slideNotes1.xmlSlide Notes part: slideNotes1.xml
Office Open XML Developer Workshop
Notes Master part: notesMaster1.xmlNotes Master part: notesMaster1.xml
DEMO
Office Open XML Developer Workshop
COMMENTSCOMMENTS
Office Open XML Developer Workshop
CommentsComments
Can only be added to slides ( not masters or layouts )Special shapes with simple text, no formatting options
Each slide with comments has a comment partMay contain any number of comments
Slide has an implicit relationship to its comment part
Each comment is attached to a comment authorComment authors are stored in the CAL (comment author list)The package has a relationship to the CAL
Office Open XML Developer Workshop
Comment Part: comment1.xmlComment Part: comment1.xml
The comment part defines position and contentAuthor information is referenced by a Author ID (as defined in the CAL)
Author Time stamp Index
Position
Text
Office Open XML Developer Workshop
CAL: commentAuthors.xmlCAL: commentAuthors.xml
One comment author list per presentationlastIdx value must be maintained for each authorclrIdx allows color-coding of each author’s commentsOnly one author per unique name+initials
Author ID Full name Initials Last index Color index
Office Open XML Developer Workshop
SLIDE TRANSITIONSSLIDE TRANSITIONS
Office Open XML Developer Workshop
Slide TransitionSlide Transition
Animation effect when changing slides22 predefined slide transitions available
Office Open XML Developer Workshop
Slide Transition ExampleSlide Transition Example
<p:sld> <p:cSld>... <p:clrMapOvr>... <p:transition> <p:fade /> </p:transition> <p:timing>...</p:sld>
Slide Transition
Office Open XML Developer Workshop
ANIMATIONSANIMATIONS
Office Open XML Developer Workshop
TimelinesTimelines
Dictates the order of animationsDone through Time NodesCan have nested Time Nodes3 types of time Nodes
TimelineStart End
<seq>
<seq>
<seq>
Sequence
TimelineStart End
<par>
<par>
<par>
Parallel
TimelineStart End
<excl>
Exclusive
<par> Stopped
Office Open XML Developer Workshop
A
B1
B2
C
Timeline ExampleTimeline Example
Office Open XML Developer Workshop
<seq> Main Sequence
<seq> Time Container
A
<seq> Time Container
<par> Time Container
B1
B2
<seq> Time Container
C
Timeline0 3
Timeline ExampleTimeline Example
Office Open XML Developer Workshop
<p:timing> <p:tnLst> <p:seq concurrent="1" nextAc="seek"> <p:stCondLst>... <p:cTn id="2" dur="indefinite" nodeType="mainSeq"> <p:childTnLst> <p:seq>... // Square A
<p:seq> <par>... // Square B1
<par>... // Square B2 </p:seq> <p:seq>... // Square C</p:childTnLst>
</p:cTn> <p:prevCondLst>... <p:nextCondLst>... </seq> </p:tnLst> <p:bldLst>...</p:timing>
Timeline Example
Office Open XML Developer Workshop
Animation EffectsAnimation EffectsSix pre-defined animations effects – may be combined
Animate Behavior
Animate Color
Animate Effect
Animate Motion
Animate Rotation
Animate Scale
Office Open XML Developer Workshop
Animation ExampleAnimation Example
Light Bulb
<p:par> <p:cTn id="5"> <p:childTnLst> <p:animScale> // Animation Scale <p:cBhvr> // Animation Properties <p:cTn id="7" dur="500" autoRev="1" fill="hold"/> <p:tgtEl> // Target Element <p:spTgt spid="9"/> </p:tgtEl> </p:cBhvr> <p:by x="105000" y="105000"/> // Effect </p:animScale> <p:animEffect transition="out" filter="fade">... // Animation Effect </p:childTnLst> </p:cTn></p:par>
Office Open XML Developer Workshop
ConditionsConditions
Allow granular control of animations
Office Open XML Developer Workshop
Conditions ExampleConditions Example
<p:par> <p:cTn id="5" nodeType="clickEffect"> <p:stCondLst> // Start Condition List <p:cond delay=“1000"/> // Condition </p:stCondLst> <p:childTnLst> <p:animRot by="21600000">... </p:childTnLst> </p:cTn></p:par>
Office Open XML Developer Workshop