public function writeFooter(Document_Word_Writer_Section_Footer $footer) { require_once __DIR__ . '/../../Shared/XMLWriter.php'; // Create XML writer $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { $objWriter = new Document_Word_Writer_Shared_XMLWriter(Document_Word_Writer_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { $objWriter = new Document_Word_Writer_Shared_XMLWriter(Document_Word_Writer_Shared_XMLWriter::STORAGE_MEMORY); } // XML header $objWriter->startDocument('1.0', 'UTF-8', 'yes'); $objWriter->startElement('w:ftr'); $objWriter->writeAttribute('xmlns:ve', 'http://schemas.openxmlformats.org/markup-compatibility/2006'); $objWriter->writeAttribute('xmlns:o', 'urn:schemas-microsoft-com:office:office'); $objWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships'); $objWriter->writeAttribute('xmlns:m', 'http://schemas.openxmlformats.org/officeDocument/2006/math'); $objWriter->writeAttribute('xmlns:v', 'urn:schemas-microsoft-com:vml'); $objWriter->writeAttribute('xmlns:wp', 'http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing'); $objWriter->writeAttribute('xmlns:w10', 'urn:schemas-microsoft-com:office:word'); $objWriter->writeAttribute('xmlns:w', 'http://schemas.openxmlformats.org/wordprocessingml/2006/main'); $objWriter->writeAttribute('xmlns:wne', 'http://schemas.microsoft.com/office/word/2006/wordml'); $_elements = $footer->getElements(); foreach ($_elements as $element) { if ($element instanceof Document_Word_Writer_Section_Text) { $this->_writeText($objWriter, $element); } elseif ($element instanceof Document_Word_Writer_Section_TextRun) { $this->_writeTextRun($objWriter, $element); } elseif ($element instanceof Document_Word_Writer_Section_TextBreak) { $this->_writeTextBreak($objWriter); } elseif ($element instanceof Document_Word_Writer_Section_Table) { $this->_writeTable($objWriter, $element); } elseif ($element instanceof Document_Word_Writer_Section_Image || $element instanceof Document_Word_Writer_Section_MemoryImage) { $this->_writeImage($objWriter, $element); } elseif ($element instanceof Document_Word_Writer_Section_Footer_PreserveText) { $this->_writePreserveText($objWriter, $element, true); } } $objWriter->endElement(); // Return return $objWriter->getData(); }
public function addPreserveText($text, $styleFont = null, $styleParagraph = null) { require_once __DIR__ . '/Footer.php'; Document_Word_Writer_Section_Footer::addPreserveText($text, $styleFont, $styleParagraph); }