一、PHPword生成word文件原理
2003以上版本(不含2003)的word是通过VML(矢量可标记语言,详细查看微软的开发文档)来生成word文件,同理,word也可以另存为包含VML的xml文件。
phpword会先把要输出信息 还有样式保存为xml文件,这个xml文件就是根据VML生成的,
不同的信息会保存在不同的xml文件中,
$this->parts = array(
'ContentTypes' => '[Content_Types].xml',
'Rels' => '_rels/.rels',
'DocPropsApp' => 'docProps/app.xml',
'DocPropsCore' => 'docProps/core.xml',
'DocPropsCustom' => 'docProps/custom.xml',
'RelsDocument' => 'word/_rels/document.xml.rels',
'Document' => 'word/document.xml', //保存要写入到word的信息
'Styles' => 'word/styles.xml', //保存全局的样式