Open XML the Markup Explained
Total Page:16
File Type:pdf, Size:1020Kb
Wouter van Vugt Open XML The markup explained i Contents Contents Contents ........................................................................................................................................................................ ii Acknowledgements ...................................................................................................................................................... iv Foreword ....................................................................................................................................................................... v Introduction .................................................................................................................................................................. vi Who is this book for? ............................................................................................................................................... vi Code samples ........................................................................................................................................................... vi ECMA Office Open XML ................................................................................................................................................. 1 The Open XML standard ........................................................................................................................................... 1 Chapter 1 WordprocessingML ....................................................................................................................................... 2 Creating digital documents ....................................................................................................................................... 2 Setting up the main structure ................................................................................................................................... 3 Adding text to the document .................................................................................................................................... 8 Text formatting ....................................................................................................................................................... 12 Tables ...................................................................................................................................................................... 16 Styling the document .............................................................................................................................................. 19 Adding images ......................................................................................................................................................... 29 Page layout ............................................................................................................................................................. 32 Custom XML in documents ..................................................................................................................................... 35 Finalizing the document.......................................................................................................................................... 43 Advanced topics ...................................................................................................................................................... 45 WordprocessingML wrap-up .................................................................................................................................. 54 Chapter 2 SpreadsheetML ........................................................................................................................................... 55 Introduction ............................................................................................................................................................ 55 Elements of a simple spreadsheet .......................................................................................................................... 56 Creating worksheets ............................................................................................................................................... 58 Formulas ................................................................................................................................................................. 59 Worksheet optimizations ........................................................................................................................................ 59 Tables ...................................................................................................................................................................... 62 Pivot tables ............................................................................................................................................................. 66 Adding and positioning the chart............................................................................................................................ 71 Styling content ........................................................................................................................................................ 73 Conditional formatting ........................................................................................................................................... 79 Chart sheets ............................................................................................................................................................ 81 Supporting features ................................................................................................................................................ 82 Wrap-up .................................................................................................................................................................. 83 Chapter 3 PresentationML........................................................................................................................................... 85 ii Contents Introduction ............................................................................................................................................................ 85 PresentationML document structure ..................................................................................................................... 85 Shapes ..................................................................................................................................................................... 86 The elements of a simple presentation .................................................................................................................. 91 Placeholders ............................................................................................................................................................ 94 Pictures ................................................................................................................................................................... 96 Tables, charts and diagrams ................................................................................................................................... 97 Chapter 4 DrawingML .................................................................................................................................................. 99 Introduction ............................................................................................................................................................ 99 Text ......................................................................................................................................................................... 99 Graphics ................................................................................................................................................................ 102 Tables .................................................................................................................................................................... 109 Charts .................................................................................................................................................................... 113 Themes ................................................................................................................................................................. 121 Units of measure ....................................................................................................................................................... 123 The EMU ............................................................................................................................................................... 123 The twip ................................................................................................................................................................ 123 iii Acknowledgements Acknowledgements Being used to blogging as my primary outlet of technical content, writing a book was an endeavor I am not accustomed to. To help me achieve readable and technically correct content I have been supported by Doug Mahugh and Mauricio Ordonez, without whom this book would have taken a lot longer to complete. Due to their combined effort this book has greatly improved. Thanks to both of you for the time you put in. iv Foreword Foreword I first noticed the name Wouter Van Vugt in April