50
Office Open XML Developer Workshop PresentationML

Office Open XML Developer Workshop PresentationML

Embed Size (px)

Citation preview

Page 1: Office Open XML Developer Workshop PresentationML

Office Open XML Developer Workshop

PresentationMLPresentationML

Page 2: Office Open XML Developer Workshop PresentationML

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.

Page 3: Office Open XML Developer Workshop PresentationML

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

Page 4: Office Open XML Developer Workshop PresentationML

Office Open XML Developer Workshop

A TYPICAL SLIDEA TYPICAL SLIDE

Page 5: Office Open XML Developer Workshop PresentationML

Office Open XML Developer Workshop

Typical slide with common types of content:

Sample SlideSample Slide

Shape ChartTextbox

Page 6: Office Open XML Developer Workshop PresentationML

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

Page 7: Office Open XML Developer Workshop PresentationML

Office Open XML Developer Workshop

Shape ChartTextbox

DEMO

Chart Part (chart1.xml)

Data source

Page 8: Office Open XML Developer Workshop PresentationML

Office Open XML Developer Workshop

TABLESTABLES

Page 9: Office Open XML Developer Workshop PresentationML

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

Page 10: Office Open XML Developer Workshop PresentationML

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”

Page 11: Office Open XML Developer Workshop PresentationML

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

Page 12: Office Open XML Developer Workshop PresentationML

Office Open XML Developer Workshop

Table Styles – tableStyles.xmlTable Styles – tableStyles.xml

Implicit relationship from presentationStyle are identified by GUID, not rId

Page 13: Office Open XML Developer Workshop PresentationML

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

Page 14: Office Open XML Developer Workshop PresentationML

Office Open XML Developer Workshop

PRESENTATION ELEMENTPRESENTATION ELEMENT

Page 15: Office Open XML Developer Workshop PresentationML

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

Page 16: Office Open XML Developer Workshop PresentationML

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

Page 17: Office Open XML Developer Workshop PresentationML

Office Open XML Developer Workshop

MASTERSMASTERS

Page 18: Office Open XML Developer Workshop PresentationML

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

Page 19: Office Open XML Developer Workshop PresentationML

Office Open XML Developer Workshop

Other MastersOther Masters

Notes Master: specifies master properties for slide notes page

Handout Master: specifies formatting for handout pages

Page 20: Office Open XML Developer Workshop PresentationML

Office Open XML Developer Workshop

SLIDE LAYOUTSSLIDE LAYOUTS

Page 21: Office Open XML Developer Workshop PresentationML

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

Page 22: Office Open XML Developer Workshop PresentationML

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

Page 23: Office Open XML Developer Workshop PresentationML

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

Page 24: Office Open XML Developer Workshop PresentationML

Office Open XML Developer Workshop

Layouts and MastersLayouts and Masters

Title Placeholder information inherited from Slide MasterOther “content” placeholders projected into Body Placeholder

Page 25: Office Open XML Developer Workshop PresentationML

Office Open XML Developer Workshop

Master Text StylesMaster Text Styles

Defined in slideMaster1.xml

Inherited by layouts

Text-style sections:TitleBodyNotesOther

Page 26: Office Open XML Developer Workshop PresentationML

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)

Page 27: Office Open XML Developer Workshop PresentationML

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

Page 28: Office Open XML Developer Workshop PresentationML

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

Page 29: Office Open XML Developer Workshop PresentationML

Office Open XML Developer Workshop

NOTESNOTES

Page 30: Office Open XML Developer Workshop PresentationML

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

Page 31: Office Open XML Developer Workshop PresentationML

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>

Page 32: Office Open XML Developer Workshop PresentationML

Office Open XML Developer Workshop

Slide Notes part: slideNotes1.xmlSlide Notes part: slideNotes1.xml

Page 33: Office Open XML Developer Workshop PresentationML

Office Open XML Developer Workshop

Notes Master part: notesMaster1.xmlNotes Master part: notesMaster1.xml

DEMO

Page 34: Office Open XML Developer Workshop PresentationML

Office Open XML Developer Workshop

COMMENTSCOMMENTS

Page 35: Office Open XML Developer Workshop PresentationML

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

Page 36: Office Open XML Developer Workshop PresentationML

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

Page 37: Office Open XML Developer Workshop PresentationML

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

Page 38: Office Open XML Developer Workshop PresentationML

Office Open XML Developer Workshop

SLIDE TRANSITIONSSLIDE TRANSITIONS

Page 39: Office Open XML Developer Workshop PresentationML

Office Open XML Developer Workshop

Slide TransitionSlide Transition

Animation effect when changing slides22 predefined slide transitions available

Page 40: Office Open XML Developer Workshop PresentationML

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

Page 41: Office Open XML Developer Workshop PresentationML

Office Open XML Developer Workshop

ANIMATIONSANIMATIONS

Page 42: Office Open XML Developer Workshop PresentationML

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

Page 43: Office Open XML Developer Workshop PresentationML

Office Open XML Developer Workshop

A

B1

B2

C

Timeline ExampleTimeline Example

Page 44: Office Open XML Developer Workshop PresentationML

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

Page 45: Office Open XML Developer Workshop PresentationML

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

Page 46: Office Open XML Developer Workshop PresentationML

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

Page 47: Office Open XML Developer Workshop PresentationML

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>

Page 48: Office Open XML Developer Workshop PresentationML

Office Open XML Developer Workshop

ConditionsConditions

Allow granular control of animations

Page 49: Office Open XML Developer Workshop PresentationML

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>

Page 50: Office Open XML Developer Workshop PresentationML

Office Open XML Developer Workshop