├── .gitattributes ├── .gitignore ├── composer.json ├── composer.lock ├── font ├── HYÑWåtH.ttf ├── liguofu.ttf └── quietsky.ttf ├── output.docx ├── output.html ├── output.odt ├── preview.jpg ├── process.php ├── readme.md ├── text.txt └── vendor ├── autoload.php ├── composer ├── ClassLoader.php ├── LICENSE ├── autoload_classmap.php ├── autoload_namespaces.php ├── autoload_psr4.php ├── autoload_real.php ├── autoload_static.php └── installed.json ├── pclzip └── pclzip │ ├── composer.json │ ├── gnu-lgpl.txt │ ├── pclzip.lib.php │ └── readme.txt ├── phpoffice ├── common │ ├── .gitignore │ ├── .scrutinizer.yml │ ├── .travis.yml │ ├── .travis_shell_after_success.sh │ ├── CHANGELOG.md │ ├── COPYING │ ├── COPYING.LESSER │ ├── LICENSE │ ├── README.md │ ├── VERSION │ ├── composer.json │ ├── phpmd.xml.dist │ ├── phpunit.xml.dist │ ├── src │ │ └── Common │ │ │ ├── Adapter │ │ │ └── Zip │ │ │ │ ├── PclZipAdapter.php │ │ │ │ ├── ZipArchiveAdapter.php │ │ │ │ └── ZipInterface.php │ │ │ ├── Autoloader.php │ │ │ ├── Drawing.php │ │ │ ├── File.php │ │ │ ├── Font.php │ │ │ ├── Microsoft │ │ │ ├── OLERead.php │ │ │ └── PasswordEncoder.php │ │ │ ├── Text.php │ │ │ ├── XMLReader.php │ │ │ └── XMLWriter.php │ └── tests │ │ ├── Common │ │ └── Tests │ │ │ ├── Adapter │ │ │ └── Zip │ │ │ │ ├── AbstractZipAdapterTest.php │ │ │ │ ├── PclZipAdapterTest.php │ │ │ │ └── ZipArchiveAdapterTest.php │ │ │ ├── AutoloaderTest.php │ │ │ ├── DrawingTest.php │ │ │ ├── FileTest.php │ │ │ ├── FontTest.php │ │ │ ├── Microsoft │ │ │ └── PasswordEncoderTest.php │ │ │ ├── TextTest.php │ │ │ ├── XMLReaderTest.php │ │ │ ├── XMLWriterTest.php │ │ │ └── _includes │ │ │ ├── TestHelperZip.php │ │ │ └── XmlDocument.php │ │ ├── bootstrap.php │ │ └── resources │ │ ├── files │ │ ├── Sample_01_Simple.pptx │ │ └── reader.zip │ │ └── images │ │ └── PHPPowerPointLogo.png └── phpword │ ├── .php_cs.dist │ ├── CHANGELOG.md │ ├── CONTRIBUTING.md │ ├── COPYING │ ├── COPYING.LESSER │ ├── LICENSE │ ├── README.md │ ├── bootstrap.php │ ├── composer.json │ ├── phpword.ini.dist │ └── src │ └── PhpWord │ ├── Collection │ ├── AbstractCollection.php │ ├── Bookmarks.php │ ├── Charts.php │ ├── Comments.php │ ├── Endnotes.php │ ├── Footnotes.php │ └── Titles.php │ ├── ComplexType │ ├── FootnoteProperties.php │ ├── ProofState.php │ ├── TblWidth.php │ └── TrackChangesView.php │ ├── Element │ ├── AbstractContainer.php │ ├── AbstractElement.php │ ├── Bookmark.php │ ├── Cell.php │ ├── Chart.php │ ├── CheckBox.php │ ├── Comment.php │ ├── Endnote.php │ ├── Field.php │ ├── Footer.php │ ├── Footnote.php │ ├── FormField.php │ ├── Header.php │ ├── Image.php │ ├── Line.php │ ├── Link.php │ ├── ListItem.php │ ├── ListItemRun.php │ ├── OLEObject.php │ ├── PageBreak.php │ ├── PreserveText.php │ ├── Row.php │ ├── SDT.php │ ├── Section.php │ ├── Shape.php │ ├── TOC.php │ ├── Table.php │ ├── Text.php │ ├── TextBox.php │ ├── TextBreak.php │ ├── TextRun.php │ ├── Title.php │ └── TrackChange.php │ ├── Escaper │ ├── AbstractEscaper.php │ ├── EscaperInterface.php │ ├── RegExp.php │ ├── Rtf.php │ └── Xml.php │ ├── Exception │ ├── CopyFileException.php │ ├── CreateTemporaryFileException.php │ ├── Exception.php │ ├── InvalidImageException.php │ ├── InvalidObjectException.php │ ├── InvalidStyleException.php │ └── UnsupportedImageTypeException.php │ ├── IOFactory.php │ ├── Media.php │ ├── Metadata │ ├── Compatibility.php │ ├── DocInfo.php │ ├── Protection.php │ └── Settings.php │ ├── PhpWord.php │ ├── Reader │ ├── AbstractReader.php │ ├── HTML.php │ ├── MsDoc.php │ ├── ODText.php │ ├── ODText │ │ ├── AbstractPart.php │ │ ├── Content.php │ │ └── Meta.php │ ├── RTF.php │ ├── RTF │ │ └── Document.php │ ├── ReaderInterface.php │ ├── Word2007.php │ └── Word2007 │ │ ├── AbstractPart.php │ │ ├── DocPropsApp.php │ │ ├── DocPropsCore.php │ │ ├── DocPropsCustom.php │ │ ├── Document.php │ │ ├── Endnotes.php │ │ ├── Footnotes.php │ │ ├── Numbering.php │ │ ├── Settings.php │ │ └── Styles.php │ ├── Settings.php │ ├── Shared │ ├── AbstractEnum.php │ ├── Converter.php │ ├── Html.php │ ├── OLERead.php │ ├── PCLZip │ │ └── pclzip.lib.php │ └── ZipArchive.php │ ├── SimpleType │ ├── DocProtect.php │ ├── Jc.php │ ├── JcTable.php │ ├── LineSpacingRule.php │ ├── NumberFormat.php │ ├── TblWidth.php │ ├── TextAlignment.php │ └── Zoom.php │ ├── Style.php │ ├── Style │ ├── AbstractStyle.php │ ├── Border.php │ ├── Cell.php │ ├── Chart.php │ ├── Extrusion.php │ ├── Fill.php │ ├── Font.php │ ├── Frame.php │ ├── Image.php │ ├── Indentation.php │ ├── Language.php │ ├── Line.php │ ├── LineNumbering.php │ ├── ListItem.php │ ├── Numbering.php │ ├── NumberingLevel.php │ ├── Outline.php │ ├── Paper.php │ ├── Paragraph.php │ ├── Row.php │ ├── Section.php │ ├── Shading.php │ ├── Shadow.php │ ├── Shape.php │ ├── Spacing.php │ ├── TOC.php │ ├── Tab.php │ ├── Table.php │ ├── TablePosition.php │ └── TextBox.php │ ├── Template.php │ ├── TemplateProcessor.php │ ├── Writer │ ├── AbstractWriter.php │ ├── HTML.php │ ├── HTML │ │ ├── Element │ │ │ ├── AbstractElement.php │ │ │ ├── Bookmark.php │ │ │ ├── Container.php │ │ │ ├── Endnote.php │ │ │ ├── Footnote.php │ │ │ ├── Image.php │ │ │ ├── Link.php │ │ │ ├── ListItem.php │ │ │ ├── PageBreak.php │ │ │ ├── Table.php │ │ │ ├── Text.php │ │ │ ├── TextBreak.php │ │ │ ├── TextRun.php │ │ │ └── Title.php │ │ ├── Part │ │ │ ├── AbstractPart.php │ │ │ ├── Body.php │ │ │ └── Head.php │ │ └── Style │ │ │ ├── AbstractStyle.php │ │ │ ├── Font.php │ │ │ ├── Generic.php │ │ │ ├── Image.php │ │ │ └── Paragraph.php │ ├── ODText.php │ ├── ODText │ │ ├── Element │ │ │ ├── AbstractElement.php │ │ │ ├── Container.php │ │ │ ├── Image.php │ │ │ ├── Link.php │ │ │ ├── PageBreak.php │ │ │ ├── Table.php │ │ │ ├── Text.php │ │ │ ├── TextBreak.php │ │ │ ├── TextRun.php │ │ │ └── Title.php │ │ ├── Part │ │ │ ├── AbstractPart.php │ │ │ ├── Content.php │ │ │ ├── Manifest.php │ │ │ ├── Meta.php │ │ │ ├── Mimetype.php │ │ │ └── Styles.php │ │ └── Style │ │ │ ├── AbstractStyle.php │ │ │ ├── Font.php │ │ │ ├── Image.php │ │ │ ├── Paragraph.php │ │ │ ├── Section.php │ │ │ └── Table.php │ ├── PDF.php │ ├── PDF │ │ ├── AbstractRenderer.php │ │ ├── DomPDF.php │ │ ├── MPDF.php │ │ └── TCPDF.php │ ├── RTF.php │ ├── RTF │ │ ├── Element │ │ │ ├── AbstractElement.php │ │ │ ├── Container.php │ │ │ ├── Image.php │ │ │ ├── Link.php │ │ │ ├── ListItem.php │ │ │ ├── PageBreak.php │ │ │ ├── Table.php │ │ │ ├── Text.php │ │ │ ├── TextBreak.php │ │ │ ├── TextRun.php │ │ │ └── Title.php │ │ ├── Part │ │ │ ├── AbstractPart.php │ │ │ ├── Document.php │ │ │ └── Header.php │ │ └── Style │ │ │ ├── AbstractStyle.php │ │ │ ├── Border.php │ │ │ ├── Font.php │ │ │ ├── Indentation.php │ │ │ ├── Paragraph.php │ │ │ ├── Section.php │ │ │ └── Tab.php │ ├── Word2007.php │ ├── Word2007 │ │ ├── Element │ │ │ ├── AbstractElement.php │ │ │ ├── Bookmark.php │ │ │ ├── Chart.php │ │ │ ├── CheckBox.php │ │ │ ├── Container.php │ │ │ ├── Endnote.php │ │ │ ├── Field.php │ │ │ ├── Footnote.php │ │ │ ├── FormField.php │ │ │ ├── Image.php │ │ │ ├── Line.php │ │ │ ├── Link.php │ │ │ ├── ListItem.php │ │ │ ├── ListItemRun.php │ │ │ ├── OLEObject.php │ │ │ ├── PageBreak.php │ │ │ ├── ParagraphAlignment.php │ │ │ ├── PreserveText.php │ │ │ ├── SDT.php │ │ │ ├── Shape.php │ │ │ ├── TOC.php │ │ │ ├── Table.php │ │ │ ├── TableAlignment.php │ │ │ ├── Text.php │ │ │ ├── TextBox.php │ │ │ ├── TextBreak.php │ │ │ ├── TextRun.php │ │ │ └── Title.php │ │ ├── Part │ │ │ ├── AbstractPart.php │ │ │ ├── Chart.php │ │ │ ├── Comments.php │ │ │ ├── ContentTypes.php │ │ │ ├── DocPropsApp.php │ │ │ ├── DocPropsCore.php │ │ │ ├── DocPropsCustom.php │ │ │ ├── Document.php │ │ │ ├── Endnotes.php │ │ │ ├── FontTable.php │ │ │ ├── Footer.php │ │ │ ├── Footnotes.php │ │ │ ├── Header.php │ │ │ ├── Numbering.php │ │ │ ├── Rels.php │ │ │ ├── RelsDocument.php │ │ │ ├── RelsPart.php │ │ │ ├── Settings.php │ │ │ ├── Styles.php │ │ │ ├── Theme.php │ │ │ └── WebSettings.php │ │ └── Style │ │ │ ├── AbstractStyle.php │ │ │ ├── Cell.php │ │ │ ├── Extrusion.php │ │ │ ├── Fill.php │ │ │ ├── Font.php │ │ │ ├── Frame.php │ │ │ ├── Image.php │ │ │ ├── Indentation.php │ │ │ ├── Line.php │ │ │ ├── LineNumbering.php │ │ │ ├── MarginBorder.php │ │ │ ├── Outline.php │ │ │ ├── Paragraph.php │ │ │ ├── Row.php │ │ │ ├── Section.php │ │ │ ├── Shading.php │ │ │ ├── Shadow.php │ │ │ ├── Shape.php │ │ │ ├── Spacing.php │ │ │ ├── Tab.php │ │ │ ├── Table.php │ │ │ ├── TablePosition.php │ │ │ └── TextBox.php │ └── WriterInterface.php │ └── resources │ ├── doc.png │ ├── ppt.png │ └── xls.png └── zendframework └── zend-escaper ├── CHANGELOG.md ├── LICENSE.md ├── README.md ├── composer.json └── src ├── Escaper.php └── Exception ├── ExceptionInterface.php ├── InvalidArgumentException.php └── RuntimeException.php /.gitattributes: -------------------------------------------------------------------------------- 1 | *.html linguist-language=PHP 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | gfyh.iml 3 | .idea/workspace.xml 4 | .idea/ 5 | Thumb.db 6 | thumb.db 7 | __MACOSX 8 | .DS_Store 9 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | "phpoffice/phpword": "^0.15.0" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /font/HYÑWåtH.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjsxwc/handwrite-text/fb8793f397237033d722c6bb11c6eb4091a542f7/font/HYÑWåtH.ttf -------------------------------------------------------------------------------- /font/liguofu.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjsxwc/handwrite-text/fb8793f397237033d722c6bb11c6eb4091a542f7/font/liguofu.ttf -------------------------------------------------------------------------------- /font/quietsky.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjsxwc/handwrite-text/fb8793f397237033d722c6bb11c6eb4091a542f7/font/quietsky.ttf -------------------------------------------------------------------------------- /output.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjsxwc/handwrite-text/fb8793f397237033d722c6bb11c6eb4091a542f7/output.docx -------------------------------------------------------------------------------- /output.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjsxwc/handwrite-text/fb8793f397237033d722c6bb11c6eb4091a542f7/output.odt -------------------------------------------------------------------------------- /preview.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjsxwc/handwrite-text/fb8793f397237033d722c6bb11c6eb4091a542f7/preview.jpg -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | 让打印出来的字体看起来像手写 2 | 3 | > 目前只在我的`macOS`下使用正常,没在`Windows`与`Linux`下测试过 4 | 5 | 1. 双击`font`目录下的ttf文件来安装这3个手写字体到你的操作系统 6 | 7 | 2. 把要转换的文本粘贴到`text.txt`文件里 8 | 9 | 3. 执行`php process.php` 10 | 11 | 4. 打开`output.docx`检查生成结果 12 | 13 | 14 | 结果截图例子: 15 | 16 |
17 |
18 |
19 |
20 |
' . $this->escaper->escapeHtml($this->element->getTextObject()->getText()) . '
' . PHP_EOL; 42 | } else { 43 | $content = '' . $this->element->getTextObject()->getText() . '
' . PHP_EOL; 44 | } 45 | 46 | return $content; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/HTML/Element/PageBreak.php: -------------------------------------------------------------------------------- 1 | parentWriter; 38 | if ($parentWriter->isPdf()) { 39 | return '' . PHP_EOL; 38 | } 39 | 40 | return $content; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/HTML/Element/TextRun.php: -------------------------------------------------------------------------------- 1 | writeOpening(); 37 | $writer = new Container($this->parentWriter, $this->element); 38 | $content .= $writer->write(); 39 | $content .= $this->writeClosing(); 40 | 41 | return $content; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/HTML/Element/Title.php: -------------------------------------------------------------------------------- 1 | element instanceof \PhpOffice\PhpWord\Element\Title) { 37 | return ''; 38 | } 39 | 40 | $tag = 'h' . $this->element->getDepth(); 41 | 42 | $text = $this->element->getText(); 43 | if (is_string($text)) { 44 | if (Settings::isOutputEscapingEnabled()) { 45 | $text = $this->escaper->escapeHtml($text); 46 | } 47 | } elseif ($text instanceof \PhpOffice\PhpWord\Element\AbstractContainer) { 48 | $writer = new Container($this->parentWriter, $this->element); 49 | $text = $writer->write(); 50 | } 51 | 52 | $content = "<{$tag}>{$text}{$tag}>" . PHP_EOL; 53 | 54 | return $content; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/HTML/Part/AbstractPart.php: -------------------------------------------------------------------------------- 1 | escaper = new Escaper(); 42 | } 43 | 44 | /** 45 | * @return string 46 | */ 47 | abstract public function write(); 48 | 49 | /** 50 | * @param \PhpOffice\PhpWord\Writer\AbstractWriter $writer 51 | */ 52 | public function setParentWriter(AbstractWriter $writer = null) 53 | { 54 | $this->parentWriter = $writer; 55 | } 56 | 57 | /** 58 | * @throws \PhpOffice\PhpWord\Exception\Exception 59 | * 60 | * @return \PhpOffice\PhpWord\Writer\AbstractWriter 61 | */ 62 | public function getParentWriter() 63 | { 64 | if ($this->parentWriter !== null) { 65 | return $this->parentWriter; 66 | } 67 | throw new Exception('No parent WriterInterface assigned.'); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/HTML/Style/Generic.php: -------------------------------------------------------------------------------- 1 | getStyle(); 35 | $css = array(); 36 | 37 | if (is_array($style) && !empty($style)) { 38 | $css = $style; 39 | } 40 | 41 | return $this->assembleCss($css); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/HTML/Style/Image.php: -------------------------------------------------------------------------------- 1 | getStyle(); 35 | if (!$style instanceof \PhpOffice\PhpWord\Style\Image) { 36 | return ''; 37 | } 38 | $css = array(); 39 | 40 | $width = $style->getWidth(); 41 | $height = $style->getHeight(); 42 | $css['width'] = $this->getValueIf(is_numeric($width), $width . 'px'); 43 | $css['height'] = $this->getValueIf(is_numeric($height), $height . 'px'); 44 | 45 | return $this->assembleCss($css); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Element/AbstractElement.php: -------------------------------------------------------------------------------- 1 | getXmlWriter(); 33 | $element = $this->getElement(); 34 | if (!$element instanceof \PhpOffice\PhpWord\Element\Link) { 35 | return; 36 | } 37 | 38 | if (!$this->withoutP) { 39 | $xmlWriter->startElement('text:p'); // text:p 40 | } 41 | 42 | $xmlWriter->startElement('text:a'); 43 | $xmlWriter->writeAttribute('xlink:type', 'simple'); 44 | $xmlWriter->writeAttribute('xlink:href', $element->getSource()); 45 | $this->writeText($element->getText()); 46 | $xmlWriter->endElement(); // text:a 47 | 48 | if (!$this->withoutP) { 49 | $xmlWriter->endElement(); // text:p 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Element/PageBreak.php: -------------------------------------------------------------------------------- 1 | getXmlWriter(); 31 | 32 | $xmlWriter->startElement('text:p'); 33 | $xmlWriter->writeAttribute('text:style-name', 'P1'); 34 | $xmlWriter->endElement(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Element/TextBreak.php: -------------------------------------------------------------------------------- 1 | getXmlWriter(); 33 | 34 | $xmlWriter->startElement('text:p'); 35 | $xmlWriter->writeAttribute('text:style-name', 'Standard'); 36 | $xmlWriter->endElement(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Element/TextRun.php: -------------------------------------------------------------------------------- 1 | getXmlWriter(); 33 | $element = $this->getElement(); 34 | 35 | $xmlWriter->startElement('text:p'); 36 | 37 | $containerWriter = new Container($xmlWriter, $element); 38 | $containerWriter->write(); 39 | 40 | $xmlWriter->endElement(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Element/Title.php: -------------------------------------------------------------------------------- 1 | getXmlWriter(); 33 | $element = $this->getElement(); 34 | if (!$element instanceof \PhpOffice\PhpWord\Element\Title) { 35 | return; 36 | } 37 | 38 | $xmlWriter->startElement('text:h'); 39 | $xmlWriter->writeAttribute('text:outline-level', $element->getDepth()); 40 | $text = $element->getText(); 41 | if (is_string($text)) { 42 | $this->writeText($text); 43 | } elseif ($text instanceof \PhpOffice\PhpWord\Element\AbstractContainer) { 44 | $containerWriter = new Container($xmlWriter, $text); 45 | $containerWriter->write(); 46 | } 47 | $xmlWriter->endElement(); // text:h 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Part/Mimetype.php: -------------------------------------------------------------------------------- 1 | getStyle(); 34 | if (!$style instanceof \PhpOffice\PhpWord\Style\Image) { 35 | return; 36 | } 37 | $xmlWriter = $this->getXmlWriter(); 38 | 39 | $xmlWriter->startElement('style:style'); 40 | $xmlWriter->writeAttribute('style:name', $style->getStyleName()); 41 | $xmlWriter->writeAttribute('style:family', 'graphic'); 42 | $xmlWriter->writeAttribute('style:parent-style-name', 'Graphics'); 43 | $xmlWriter->startElement('style:graphic-properties'); 44 | $xmlWriter->writeAttribute('style:vertical-pos', 'top'); 45 | $xmlWriter->writeAttribute('style:vertical-rel', 'baseline'); 46 | $xmlWriter->endElement(); // style:graphic-properties 47 | $xmlWriter->endElement(); // style:style 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Style/Section.php: -------------------------------------------------------------------------------- 1 | getStyle(); 34 | if (!$style instanceof \PhpOffice\PhpWord\Style\Section) { 35 | return; 36 | } 37 | $xmlWriter = $this->getXmlWriter(); 38 | 39 | $xmlWriter->startElement('style:style'); 40 | $xmlWriter->writeAttribute('style:name', $style->getStyleName()); 41 | $xmlWriter->writeAttribute('style:family', 'section'); 42 | $xmlWriter->startElement('style:section-properties'); 43 | 44 | $xmlWriter->startElement('style:columns'); 45 | $xmlWriter->writeAttribute('fo:column-count', $style->getColsNum()); 46 | $xmlWriter->endElement(); // style:columns 47 | 48 | $xmlWriter->endElement(); // style:section-properties 49 | $xmlWriter->endElement(); // style:style 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/PDF/DomPDF.php: -------------------------------------------------------------------------------- 1 | setPaper(strtolower($paperSize), $orientation); 54 | $pdf->loadHtml(str_replace(PHP_EOL, '', $this->getContent())); 55 | $pdf->render(); 56 | 57 | // Write to file 58 | fwrite($fileHandle, $pdf->output()); 59 | 60 | parent::restoreStateAfterSave($fileHandle); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/RTF/Element/Container.php: -------------------------------------------------------------------------------- 1 | element instanceof ImageElement) { 38 | return ''; 39 | } 40 | 41 | $this->getStyles(); 42 | $style = $this->element->getStyle(); 43 | 44 | $content = ''; 45 | $content .= $this->writeOpening(); 46 | $content .= '{\*\shppict {\pict'; 47 | $content .= '\pngblip\picscalex100\picscaley100'; 48 | $content .= '\picwgoal' . round(Converter::pixelToTwip($style->getWidth())); 49 | $content .= '\pichgoal' . round(Converter::pixelToTwip($style->getHeight())); 50 | $content .= PHP_EOL; 51 | $content .= $this->element->getImageStringData(); 52 | $content .= '}}'; 53 | $content .= $this->writeClosing(); 54 | 55 | return $content; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/RTF/Element/Link.php: -------------------------------------------------------------------------------- 1 | element instanceof \PhpOffice\PhpWord\Element\Link) { 35 | return ''; 36 | } 37 | 38 | $this->getStyles(); 39 | 40 | $content = ''; 41 | $content .= $this->writeOpening(); 42 | $content .= '{\field {\*\fldinst {HYPERLINK "' . $this->element->getSource() . '"}}{\\fldrslt {'; 43 | $content .= $this->writeFontStyle(); 44 | $content .= $this->writeText($this->element->getText()); 45 | $content .= '}}}'; 46 | $content .= $this->writeClosing(); 47 | 48 | return $content; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/RTF/Element/ListItem.php: -------------------------------------------------------------------------------- 1 | element; 36 | $elementClass = str_replace('\\Writer\\RTF', '', get_class($this)); 37 | if (!$element instanceof $elementClass || !is_string($element->getText())) { 38 | return ''; 39 | } 40 | 41 | $this->getStyles(); 42 | 43 | $content = ''; 44 | $content .= $this->writeOpening(); 45 | $content .= '{'; 46 | $content .= $this->writeFontStyle(); 47 | $content .= $this->writeText($element->getText()); 48 | $content .= '}'; 49 | $content .= $this->writeClosing(); 50 | 51 | return $content; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/RTF/Element/TextBreak.php: -------------------------------------------------------------------------------- 1 | parentWriter; 36 | $parentWriter->setLastParagraphStyle(); 37 | 38 | return '\pard\par' . PHP_EOL; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/RTF/Element/TextRun.php: -------------------------------------------------------------------------------- 1 | parentWriter, $this->element); 35 | 36 | $content = ''; 37 | $content .= $this->writeOpening(); 38 | $content .= '{'; 39 | $content .= $writer->write(); 40 | $content .= '}'; 41 | $content .= $this->writeClosing(); 42 | 43 | return $content; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/RTF/Element/Title.php: -------------------------------------------------------------------------------- 1 | escaper = new Rtf(); 42 | } 43 | 44 | /** 45 | * @return string 46 | */ 47 | abstract public function write(); 48 | 49 | /** 50 | * @param \PhpOffice\PhpWord\Writer\AbstractWriter $writer 51 | */ 52 | public function setParentWriter(AbstractWriter $writer = null) 53 | { 54 | $this->parentWriter = $writer; 55 | } 56 | 57 | /** 58 | * @throws \PhpOffice\PhpWord\Exception\Exception 59 | * @return \PhpOffice\PhpWord\Writer\AbstractWriter 60 | */ 61 | public function getParentWriter() 62 | { 63 | if ($this->parentWriter !== null) { 64 | return $this->parentWriter; 65 | } 66 | throw new Exception('No parent WriterInterface assigned.'); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/RTF/Style/AbstractStyle.php: -------------------------------------------------------------------------------- 1 | getStyle(); 35 | if (!$style instanceof \PhpOffice\PhpWord\Style\Indentation) { 36 | return ''; 37 | } 38 | 39 | $content = '\fi' . $style->getFirstLine(); 40 | $content .= '\li' . $style->getLeft(); 41 | $content .= '\ri' . $style->getRight(); 42 | 43 | return $content . ' '; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/RTF/Style/Tab.php: -------------------------------------------------------------------------------- 1 | getStyle(); 33 | if (!$style instanceof \PhpOffice\PhpWord\Style\Tab) { 34 | return; 35 | } 36 | $tabs = array( 37 | \PhpOffice\PhpWord\Style\Tab::TAB_STOP_RIGHT => '\tqr', 38 | \PhpOffice\PhpWord\Style\Tab::TAB_STOP_CENTER => '\tqc', 39 | \PhpOffice\PhpWord\Style\Tab::TAB_STOP_DECIMAL => '\tqdec', 40 | ); 41 | $content = ''; 42 | if (isset($tabs[$style->getType()])) { 43 | $content .= $tabs[$style->getType()]; 44 | } 45 | $content .= '\tx' . $style->getPosition(); 46 | 47 | return $content; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Element/Bookmark.php: -------------------------------------------------------------------------------- 1 | getXmlWriter(); 33 | $element = $this->getElement(); 34 | if (!$element instanceof \PhpOffice\PhpWord\Element\Bookmark) { 35 | return; 36 | } 37 | 38 | $rId = $element->getRelationId(); 39 | 40 | $xmlWriter->startElement('w:bookmarkStart'); 41 | $xmlWriter->writeAttribute('w:id', $rId); 42 | $xmlWriter->writeAttribute('w:name', $element->getName()); 43 | $xmlWriter->endElement(); 44 | 45 | $xmlWriter->startElement('w:bookmarkEnd'); 46 | $xmlWriter->writeAttribute('w:id', $rId); 47 | $xmlWriter->endElement(); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Element/Endnote.php: -------------------------------------------------------------------------------- 1 | getXmlWriter(); 40 | $element = $this->getElement(); 41 | if (!$element instanceof \PhpOffice\PhpWord\Element\Footnote) { 42 | return; 43 | } 44 | 45 | $this->startElementP(); 46 | 47 | $xmlWriter->startElement('w:r'); 48 | $xmlWriter->startElement('w:rPr'); 49 | $xmlWriter->startElement('w:rStyle'); 50 | $xmlWriter->writeAttribute('w:val', ucfirst($this->referenceType)); 51 | $xmlWriter->endElement(); // w:rStyle 52 | $xmlWriter->endElement(); // w:rPr 53 | $xmlWriter->startElement("w:{$this->referenceType}"); 54 | $xmlWriter->writeAttribute('w:id', $element->getRelationId()); 55 | $xmlWriter->endElement(); // w:$referenceType 56 | $xmlWriter->endElement(); // w:r 57 | 58 | $this->endElementP(); // w:p 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Element/Link.php: -------------------------------------------------------------------------------- 1 | getXmlWriter(); 33 | $element = $this->getElement(); 34 | if (!$element instanceof \PhpOffice\PhpWord\Element\Link) { 35 | return; 36 | } 37 | 38 | $rId = $element->getRelationId() + ($element->isInSection() ? 6 : 0); 39 | 40 | $this->startElementP(); 41 | 42 | $xmlWriter->startElement('w:hyperlink'); 43 | if ($element->isInternal()) { 44 | $xmlWriter->writeAttribute('w:anchor', $element->getSource()); 45 | } else { 46 | $xmlWriter->writeAttribute('r:id', 'rId' . $rId); 47 | } 48 | $xmlWriter->writeAttribute('w:history', '1'); 49 | $xmlWriter->startElement('w:r'); 50 | 51 | $this->writeFontStyle(); 52 | 53 | $xmlWriter->startElement('w:t'); 54 | $xmlWriter->writeAttribute('xml:space', 'preserve'); 55 | $this->writeText($element->getText()); 56 | $xmlWriter->endElement(); // w:t 57 | $xmlWriter->endElement(); // w:r 58 | $xmlWriter->endElement(); // w:hyperlink 59 | 60 | $this->endElementP(); // w:p 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Element/PageBreak.php: -------------------------------------------------------------------------------- 1 | getXmlWriter(); 35 | 36 | $xmlWriter->startElement('w:p'); 37 | $xmlWriter->startElement('w:r'); 38 | $xmlWriter->startElement('w:br'); 39 | $xmlWriter->writeAttribute('w:type', 'page'); 40 | $xmlWriter->endElement(); // w:br 41 | $xmlWriter->endElement(); // w:r 42 | $xmlWriter->endElement(); // w:p 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Element/ParagraphAlignment.php: -------------------------------------------------------------------------------- 1 | attributes['w:val'] = $value; 39 | } 40 | 41 | /** 42 | * @since 0.13.0 43 | * 44 | * @return string 45 | */ 46 | final public function getName() 47 | { 48 | return $this->name; 49 | } 50 | 51 | /** 52 | * @since 0.13.0 53 | * 54 | * @return string[] 55 | */ 56 | final public function getAttributes() 57 | { 58 | return $this->attributes; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Element/TableAlignment.php: -------------------------------------------------------------------------------- 1 | attributes['w:val'] = $value; 39 | } 40 | 41 | /** 42 | * @since 0.13.0 43 | * 44 | * @return string 45 | */ 46 | final public function getName() 47 | { 48 | return $this->name; 49 | } 50 | 51 | /** 52 | * @since 0.13.0 53 | * 54 | * @return string[] 55 | */ 56 | final public function getAttributes() 57 | { 58 | return $this->attributes; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Element/TextBreak.php: -------------------------------------------------------------------------------- 1 | getXmlWriter(); 33 | $element = $this->getElement(); 34 | if (!$element instanceof \PhpOffice\PhpWord\Element\TextBreak) { 35 | return; 36 | } 37 | 38 | if (!$this->withoutP) { 39 | $hasStyle = $element->hasStyle(); 40 | $this->startElementP(); 41 | 42 | if ($hasStyle) { 43 | $xmlWriter->startElement('w:pPr'); 44 | $this->writeFontStyle(); 45 | $xmlWriter->endElement(); // w:pPr 46 | } 47 | 48 | $this->endElementP(); // w:p 49 | } else { 50 | $xmlWriter->writeElement('w:br'); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Element/TextRun.php: -------------------------------------------------------------------------------- 1 | getXmlWriter(); 33 | $element = $this->getElement(); 34 | 35 | $this->startElementP(); 36 | 37 | $containerWriter = new Container($xmlWriter, $element); 38 | $containerWriter->write(); 39 | 40 | $this->endElementP(); // w:p 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Part/DocPropsApp.php: -------------------------------------------------------------------------------- 1 | getParentWriter()->getPhpWord(); 35 | $xmlWriter = $this->getXmlWriter(); 36 | $schema = 'http://schemas.openxmlformats.org/officeDocument/2006/extended-properties'; 37 | 38 | $xmlWriter->startDocument('1.0', 'UTF-8', 'yes'); 39 | $xmlWriter->startElement('Properties'); 40 | $xmlWriter->writeAttribute('xmlns', $schema); 41 | $xmlWriter->writeAttribute('xmlns:vt', 'http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes'); 42 | 43 | $xmlWriter->writeElement('Application', 'PHPWord'); 44 | $xmlWriter->writeElement('Company', $phpWord->getDocInfo()->getCompany()); 45 | $xmlWriter->writeElement('Manager', $phpWord->getDocInfo()->getManager()); 46 | 47 | $xmlWriter->endElement(); // Properties 48 | 49 | return $xmlWriter->getData(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Part/Endnotes.php: -------------------------------------------------------------------------------- 1 | 'officeDocument/2006/relationships/styles', 36 | 'numbering.xml' => 'officeDocument/2006/relationships/numbering', 37 | 'settings.xml' => 'officeDocument/2006/relationships/settings', 38 | 'theme/theme1.xml' => 'officeDocument/2006/relationships/theme', 39 | 'webSettings.xml' => 'officeDocument/2006/relationships/webSettings', 40 | 'fontTable.xml' => 'officeDocument/2006/relationships/fontTable', 41 | ); 42 | $xmlWriter = $this->getXmlWriter(); 43 | 44 | /** @var \PhpOffice\PhpWord\Writer\Word2007 $parentWriter Type hint */ 45 | $parentWriter = $this->getParentWriter(); 46 | $this->writeRels($xmlWriter, $xmlRels, $parentWriter->getRelationships()); 47 | 48 | return $xmlWriter->getData(); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Part/RelsPart.php: -------------------------------------------------------------------------------- 1 | getXmlWriter(); 42 | $this->writeRels($xmlWriter, array(), $this->media); 43 | 44 | return $xmlWriter->getData(); 45 | } 46 | 47 | /** 48 | * Set media 49 | * 50 | * @param array $media 51 | * @return self 52 | */ 53 | public function setMedia($media) 54 | { 55 | $this->media = $media; 56 | 57 | return $this; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Part/WebSettings.php: -------------------------------------------------------------------------------- 1 | '', 34 | ); 35 | 36 | $xmlWriter = $this->getXmlWriter(); 37 | 38 | $xmlWriter->startDocument('1.0', 'UTF-8', 'yes'); 39 | $xmlWriter->startElement('w:webSettings'); 40 | $xmlWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships'); 41 | $xmlWriter->writeAttribute('xmlns:w', 'http://schemas.openxmlformats.org/wordprocessingml/2006/main'); 42 | 43 | foreach ($settings as $settingKey => $settingValue) { 44 | $this->writeSetting($xmlWriter, $settingKey, $settingValue); 45 | } 46 | 47 | $xmlWriter->endElement(); // w:settings 48 | 49 | return $xmlWriter->getData(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Style/Extrusion.php: -------------------------------------------------------------------------------- 1 | getStyle(); 33 | if (!$style instanceof \PhpOffice\PhpWord\Style\Extrusion) { 34 | return; 35 | } 36 | $xmlWriter = $this->getXmlWriter(); 37 | 38 | $xmlWriter->startElement('o:extrusion'); 39 | $xmlWriter->writeAttribute('on', 't'); 40 | $xmlWriter->writeAttributeIf($style->getType() !== null, 'type', $style->getType()); 41 | $xmlWriter->writeAttributeIf($style->getColor() !== null, 'color', $style->getColor()); 42 | $xmlWriter->endElement(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Style/Fill.php: -------------------------------------------------------------------------------- 1 | getStyle(); 33 | if (!$style instanceof \PhpOffice\PhpWord\Style\Fill) { 34 | return; 35 | } 36 | $xmlWriter = $this->getXmlWriter(); 37 | 38 | $xmlWriter->writeAttribute('on', 't'); 39 | $xmlWriter->writeAttributeIf($style->getColor() !== null, 'fillcolor', $style->getColor()); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Style/Image.php: -------------------------------------------------------------------------------- 1 | getStyle(); 33 | if (!$style instanceof \PhpOffice\PhpWord\Style\Indentation) { 34 | return; 35 | } 36 | $xmlWriter = $this->getXmlWriter(); 37 | 38 | $xmlWriter->startElement('w:ind'); 39 | 40 | $xmlWriter->writeAttribute('w:left', $this->convertTwip($style->getLeft())); 41 | $xmlWriter->writeAttribute('w:right', $this->convertTwip($style->getRight())); 42 | 43 | $firstLine = $style->getFirstLine(); 44 | $xmlWriter->writeAttributeIf(!is_null($firstLine), 'w:firstLine', $this->convertTwip($firstLine)); 45 | 46 | $hanging = $style->getHanging(); 47 | $xmlWriter->writeAttributeIf(!is_null($hanging), 'w:hanging', $this->convertTwip($hanging)); 48 | 49 | $xmlWriter->endElement(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Style/LineNumbering.php: -------------------------------------------------------------------------------- 1 | getStyle(); 34 | if (!$style instanceof \PhpOffice\PhpWord\Style\LineNumbering) { 35 | return; 36 | } 37 | $xmlWriter = $this->getXmlWriter(); 38 | 39 | $xmlWriter->startElement('w:lnNumType'); 40 | $xmlWriter->writeAttribute('w:start', $style->getStart() - 1); 41 | $xmlWriter->writeAttribute('w:countBy', $style->getIncrement()); 42 | $xmlWriter->writeAttribute('w:distance', $style->getDistance()); 43 | $xmlWriter->writeAttribute('w:restart', $style->getRestart()); 44 | $xmlWriter->endElement(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Style/Outline.php: -------------------------------------------------------------------------------- 1 | getStyle(); 33 | if (!$style instanceof \PhpOffice\PhpWord\Style\Outline) { 34 | return; 35 | } 36 | $xmlWriter = $this->getXmlWriter(); 37 | 38 | $xmlWriter->startElement('v:stroke'); 39 | $xmlWriter->writeAttribute('on', 't'); 40 | $xmlWriter->writeAttributeIf($style->getColor() !== null, 'color', $style->getColor()); 41 | $xmlWriter->writeAttributeIf($style->getWeight() !== null, 'weight', $style->getWeight() . $style->getUnit()); 42 | $xmlWriter->writeAttributeIf($style->getDash() !== null, 'dashstyle', $style->getDash()); 43 | $xmlWriter->writeAttributeIf($style->getLine() !== null, 'linestyle', $style->getLine()); 44 | $xmlWriter->writeAttributeIf($style->getEndCap() !== null, 'endcap', $style->getEndCap()); 45 | $xmlWriter->writeAttributeIf($style->getStartArrow() !== null, 'startarrow', $style->getStartArrow()); 46 | $xmlWriter->writeAttributeIf($style->getEndArrow() !== null, 'endarrow', $style->getEndArrow()); 47 | $xmlWriter->endElement(); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Style/Row.php: -------------------------------------------------------------------------------- 1 | getStyle(); 38 | if (!$style instanceof \PhpOffice\PhpWord\Style\Row) { 39 | return; 40 | } 41 | 42 | $xmlWriter = $this->getXmlWriter(); 43 | $xmlWriter->startElement('w:trPr'); 44 | 45 | if ($this->height !== null) { 46 | $xmlWriter->startElement('w:trHeight'); 47 | $xmlWriter->writeAttribute('w:val', $this->height); 48 | $xmlWriter->writeAttribute('w:hRule', ($style->isExactHeight() ? 'exact' : 'atLeast')); 49 | $xmlWriter->endElement(); 50 | } 51 | $xmlWriter->writeElementIf($style->isTblHeader(), 'w:tblHeader', 'w:val', '1'); 52 | $xmlWriter->writeElementIf($style->isCantSplit(), 'w:cantSplit', 'w:val', '1'); 53 | 54 | $xmlWriter->endElement(); // w:trPr 55 | } 56 | 57 | /** 58 | * Set height. 59 | * 60 | * @param int $value 61 | */ 62 | public function setHeight($value = null) 63 | { 64 | $this->height = $value; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Style/Shading.php: -------------------------------------------------------------------------------- 1 | getStyle(); 33 | if (!$style instanceof \PhpOffice\PhpWord\Style\Shading) { 34 | return; 35 | } 36 | $xmlWriter = $this->getXmlWriter(); 37 | 38 | $xmlWriter->startElement('w:shd'); 39 | $xmlWriter->writeAttributeIf(!is_null($style->getPattern()), 'w:val', $style->getPattern()); 40 | $xmlWriter->writeAttributeIf(!is_null($style->getColor()), 'w:color', $style->getColor()); 41 | $xmlWriter->writeAttributeIf(!is_null($style->getFill()), 'w:fill', $style->getFill()); 42 | $xmlWriter->endElement(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Style/Shadow.php: -------------------------------------------------------------------------------- 1 | getStyle(); 33 | if (!$style instanceof \PhpOffice\PhpWord\Style\Shadow) { 34 | return; 35 | } 36 | $xmlWriter = $this->getXmlWriter(); 37 | 38 | $xmlWriter->startElement('v:shadow'); 39 | $xmlWriter->writeAttribute('on', 't'); 40 | $xmlWriter->writeAttributeIf($style->getColor() !== null, 'color', $style->getColor()); 41 | $xmlWriter->writeAttributeIf($style->getOffset() !== null, 'offset', $style->getOffset()); 42 | $xmlWriter->endElement(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Style/Shape.php: -------------------------------------------------------------------------------- 1 | getStyle(); 33 | if (!$style instanceof \PhpOffice\PhpWord\Style\Shape) { 34 | return; 35 | } 36 | 37 | $xmlWriter = $this->getXmlWriter(); 38 | 39 | $childStyles = array('Frame', 'Fill', 'Outline', 'Shadow', 'Extrusion'); 40 | foreach ($childStyles as $childStyle) { 41 | $method = "get{$childStyle}"; 42 | $this->writeChildStyle($xmlWriter, $childStyle, $style->$method()); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Style/Spacing.php: -------------------------------------------------------------------------------- 1 | getStyle(); 33 | if (!$style instanceof \PhpOffice\PhpWord\Style\Spacing) { 34 | return; 35 | } 36 | $xmlWriter = $this->getXmlWriter(); 37 | 38 | $xmlWriter->startElement('w:spacing'); 39 | 40 | $before = $style->getBefore(); 41 | $xmlWriter->writeAttributeIf(!is_null($before), 'w:before', $this->convertTwip($before)); 42 | 43 | $after = $style->getAfter(); 44 | $xmlWriter->writeAttributeIf(!is_null($after), 'w:after', $this->convertTwip($after)); 45 | 46 | $line = $style->getLine(); 47 | $xmlWriter->writeAttributeIf(!is_null($line), 'w:line', $line); 48 | 49 | $xmlWriter->writeAttributeIf(!is_null($line), 'w:lineRule', $style->getLineRule()); 50 | 51 | $xmlWriter->endElement(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Style/Tab.php: -------------------------------------------------------------------------------- 1 | getStyle(); 33 | if (!$style instanceof \PhpOffice\PhpWord\Style\Tab) { 34 | return; 35 | } 36 | $xmlWriter = $this->getXmlWriter(); 37 | 38 | $xmlWriter->startElement('w:tab'); 39 | $xmlWriter->writeAttribute('w:val', $style->getType()); 40 | $xmlWriter->writeAttribute('w:leader', $style->getLeader()); 41 | $xmlWriter->writeAttribute('w:pos', $this->convertTwip($style->getPosition())); 42 | $xmlWriter->endElement(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Style/TablePosition.php: -------------------------------------------------------------------------------- 1 | getStyle(); 31 | if (!$style instanceof \PhpOffice\PhpWord\Style\TablePosition) { 32 | return; 33 | } 34 | 35 | $values = array(); 36 | $properties = array( 37 | 'leftFromText', 38 | 'rightFromText', 39 | 'topFromText', 40 | 'bottomFromText', 41 | 'vertAnchor', 42 | 'horzAnchor', 43 | 'tblpXSpec', 44 | 'tblpX', 45 | 'tblpYSpec', 46 | 'tblpY', 47 | ); 48 | foreach ($properties as $property) { 49 | $method = 'get' . $property; 50 | if (method_exists($style, $method)) { 51 | $values[$property] = $style->$method(); 52 | } 53 | } 54 | $values = array_filter($values); 55 | 56 | if ($values) { 57 | $xmlWriter = $this->getXmlWriter(); 58 | $xmlWriter->startElement('w:tblpPr'); 59 | foreach ($values as $property => $value) { 60 | $xmlWriter->writeAttribute('w:' . $property, $value); 61 | } 62 | $xmlWriter->endElement(); 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Style/TextBox.php: -------------------------------------------------------------------------------- 1 | getStyle(); 35 | if (!$style instanceof TextBoxStyle || !$style->hasInnerMargins()) { 36 | return; 37 | } 38 | 39 | $xmlWriter = $this->getXmlWriter(); 40 | $margins = implode(', ', $style->getInnerMargin()); 41 | 42 | $xmlWriter->writeAttribute('inset', $margins); 43 | } 44 | 45 | /** 46 | * Writer border. 47 | */ 48 | public function writeBorder() 49 | { 50 | $style = $this->getStyle(); 51 | if (!$style instanceof TextBoxStyle) { 52 | return; 53 | } 54 | $xmlWriter = $this->getXmlWriter(); 55 | 56 | $xmlWriter->startElement('v:stroke'); 57 | $xmlWriter->writeAttributeIf($style->getBorderSize() !== null, 'weight', $style->getBorderSize() . 'pt'); 58 | $xmlWriter->writeAttributeIf($style->getBorderColor() !== null, 'color', $style->getBorderColor()); 59 | $xmlWriter->endElement(); // v:stroke 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/WriterInterface.php: -------------------------------------------------------------------------------- 1 |