Top Banner
Components of WordprocessingML Main Document Paragraphs & Rich Formatting Runs Run Content Tables Custom Markup Sections Styles Paragraph Character Numbering Table Document Defaults Fonts Numbering Headers/Footers Footnotes/Endnotes Glossary Document Annotations Comments Revisions Bookmarks Mail Merge Document Settings Web Settings Compatibility Settings Fields & Hyperlinks Odds & Ends (Textboxes, Subdocuments, Extensibility) Ecma/TC45/2006/115 (Rev.)
22
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 9   wordprocessing ml subject - headers and footers

Components of WordprocessingML• Main Document• Paragraphs & Rich Formatting

– Runs– Run Content

• Tables• Custom Markup• Sections• Styles

– Paragraph– Character– Numbering– Table– Document Defaults

• Fonts• Numbering• Headers/Footers• Footnotes/Endnotes• Glossary Document• Annotations

– Comments– Revisions– Bookmarks

• Mail Merge• Document Settings

– Web Settings– Compatibility Settings

• Fields & Hyperlinks• Odds & Ends (Textboxes, Subdocuments, Extensibility)

Ecma/TC45/2006/115 (Rev.)

Page 2: 9   wordprocessing ml subject - headers and footers

WordprocessingML – Headers and Footers

Page 3: 9   wordprocessing ml subject - headers and footers

Headers and Footers

• Headers and footers are ‘stories’ in a WordprocessingML document

• Like the main document story, they can contain text, graphics or data (such as page number, date, document title, and so on)– There is no fundamental restriction to the

contents of the header/footer story

Page 4: 9   wordprocessing ml subject - headers and footers

Headers and Footers

• What makes these unique is where they are displayed in page view:– Headers appear above the top of the main

document story’s text extent– Footers appear below the bottom of the main

document story’s text extent• Headers and footers are linked to the main

story as a section-level property in WordprocessingML

Page 5: 9   wordprocessing ml subject - headers and footers

Header Part

• Stored in multiple header parts, each of which has an explicit relationship from the document part– The explicit relationship tells the consumer the

section(s) to which a particular header is anchored

Page 6: 9   wordprocessing ml subject - headers and footers

Header Part

• Relationship type: http://schemas.openxmlformats.org/wordprocessingml/2006/header

• Content type: vnd-openxmlformats.officedocument.wordprocessingml-header+xml

Page 7: 9   wordprocessing ml subject - headers and footers

Footer Part

• Stored in multiple footer parts, each of which has an explicit relationship from the document part– The explicit relationship tells the consumer the

section(s) to which a particular footer is anchored

Page 8: 9   wordprocessing ml subject - headers and footers

Header Part

• Relationship type: http://schemas.openxmlformats.org/wordprocessingml/2007/footer

• Content type: vnd-openxmlformats.officedocument.wordprocessingml-footer+xml

Page 9: 9   wordprocessing ml subject - headers and footers

Using a Header or Footer

• Using headers and footers in WordprocessingML consists of two parts:– The section properties (referencing the header)– The part (the contents of the header)

• Only if both are present is the header or footer valid

Page 10: 9   wordprocessing ml subject - headers and footers

Section Properties

• Header or footer parts must be associated with a section(s) within the document– Otherwise, they wouldn’t be displayed anywhere

• Each section can contain three types of headers or footers (declared on the reference):– First page – displayed on page one– Odd page – displayed on pages 1(if no pg

one),3,5,7…– Even page – displayed on 2,4,6…

Page 11: 9   wordprocessing ml subject - headers and footers

Section Properties

• The odd page header is the ‘default’ header– If there’s explicitly no page one header, the odd

page header is displayed there– If there’s explicitly no even page header, the odd

page header is displayed there

Page 12: 9   wordprocessing ml subject - headers and footers

Header/Footer References

• References to a header or footer are made via the headerReference and footerReference elements– Each has an attribute with the explicit relationship

ID to the appropriate part• Saying nothing about each type is slightly

more complicated, though – we’ll come back to that

Page 13: 9   wordprocessing ml subject - headers and footers

Header/Footer References Example

Each target specifies the type of header for the section

Page 14: 9   wordprocessing ml subject - headers and footers

Headers and Footers

• A WordprocessingML header and footers consists of one component:

• Content– Any block-level WordprocessingML content

Page 15: 9   wordprocessing ml subject - headers and footers

Headers and Footers

• The root element for the header part is the hdr element

• The root element for the header part is the ftr element

• Beyond that, this is just another text story

Page 16: 9   wordprocessing ml subject - headers and footers

Header Example

Header content

• You’ll notice the paragraph style is called Header – that’s not a requirement

Header Root Element

Page 17: 9   wordprocessing ml subject - headers and footers

Multiple Sections

• Documents can have more than one section• Each section can define up to three headers

and footers (as seen before)

Page 18: 9   wordprocessing ml subject - headers and footers

Multiple Sections

• To optimize the output, we only write out headers and footers when they are different:

• Default (omit a headerReference element): – Section will inherit the previous header and footer

references• Override:

– Section specifies header and footer references

Page 19: 9   wordprocessing ml subject - headers and footers

Multiple Sections

• How do we know which ones to override?

• The header reference tells us the type for each header – if one is missing, we don’t use it.

Page 20: 9   wordprocessing ml subject - headers and footers

Multiple Section Example

No headers or footers

specified=

Inherit all headers and

footers

Page 21: 9   wordprocessing ml subject - headers and footers

Empty Header or Footer

• What if you want an empty header or footer?– Omitting the reference inherits, so that’s no good.– To do this, a header or footer reference must be

made to a NULL target

<Relationship Type=“http://schemas.openxmlformats.org/wordprocessingml/2006/header” target=“NULL” />

Null target part == no header

Page 22: 9   wordprocessing ml subject - headers and footers

Disclaimer

This presentation is for informational purposes only, and should not be relied upon as a substitute or replacement for Microsoft formal file format documentation, which is available at the following website: https://msdn.microsoft.com/en-us/library/cc313118(v=office.12).aspx. Any views or opinions presented in this material are solely those of the author and do not necessarily represent those of Microsoft. Microsoft disclaims all liability for mistakes or inaccuracies in this presentation.