├── .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 |

21 | -------------------------------------------------------------------------------- /text.txt: -------------------------------------------------------------------------------- 1 | 吕布使人探听得张勋一军从大路径取徐州,桥蕤一军取小沛,陈纪一军取沂都,雷薄一军取琅琊,陈兰一军取碣石,韩暹一军取下邳,杨奉一军取浚山:七路军马,日行五十里,于路劫掠将来。乃急召众谋士商议,陈宫与陈珪父子俱至。陈宫曰:“徐州之祸,乃陈珪父子所招,媚朝廷以求爵禄,今日移祸于将军。可斩二人之头献袁术,其军自退。”布听其言,即命擒下陈珪、陈登。陈登大笑曰:“何如是之懦也?吾观七路之兵,如七堆腐草,何足介意!”布曰:“汝若有计破敌、免汝死罪。”陈登曰:“将军若用老夫之言,徐州可保无虞。”布曰:“试言之。”登曰:“术兵虽众,皆乌合之师,素不亲信;我以正兵守之,出奇兵胜之,无不成功。更有一计,不止保安徐州,并可生擒袁术。”布曰:“计将安出?” 2 | 登曰:“韩暹、杨奉乃汉旧臣,因惧曹操而走,无家可依,暂归袁术;术必轻之,彼亦不乐为术用。若凭尺书结为内应,更连刘备为外合,必擒袁术矣。”布曰:“汝须亲到韩暹、杨奉处下书。”陈登允诺。布乃发表上许都,并致书与豫州,然后令陈登引数骑,先于下邳道上候韩暹。退引兵至,下寨毕,登入见。暹问曰:“汝乃吕布之人,来此何干?” 3 | 登笑曰:“某为大汉公卿,何谓吕布之人?若将军者,向为汉臣,今乃为叛贼之臣,使昔日关中保驾之功,化为乌有,窃为将军不取也。且袁术性最多疑,将军后必为其所害。今不早图,悔之无及!”暹叹曰:“吾欲归汉,恨无门耳。”登乃出布书。暹览书毕曰:“吾已知之。公先回。吾与杨将军反戈击之。但看火起为号,温侯以兵相应可也。”登辞暹,急回报吕布。 -------------------------------------------------------------------------------- /vendor/autoload.php: -------------------------------------------------------------------------------- 1 | $vendorDir . '/pclzip/pclzip/pclzip.lib.php', 10 | ); 11 | -------------------------------------------------------------------------------- /vendor/composer/autoload_namespaces.php: -------------------------------------------------------------------------------- 1 | array($vendorDir . '/zendframework/zend-escaper/src'), 10 | 'PhpOffice\\PhpWord\\' => array($vendorDir . '/phpoffice/phpword/src/PhpWord'), 11 | 'PhpOffice\\Common\\' => array($vendorDir . '/phpoffice/common/src/Common'), 12 | ); 13 | -------------------------------------------------------------------------------- /vendor/composer/autoload_real.php: -------------------------------------------------------------------------------- 1 | = 50600 && !defined('HHVM_VERSION'); 27 | if ($useStaticLoader) { 28 | require_once __DIR__ . '/autoload_static.php'; 29 | 30 | call_user_func(\Composer\Autoload\ComposerStaticInit14be83cc03b4124b881edda06b5fb787::getInitializer($loader)); 31 | } else { 32 | $map = require __DIR__ . '/autoload_namespaces.php'; 33 | foreach ($map as $namespace => $path) { 34 | $loader->set($namespace, $path); 35 | } 36 | 37 | $map = require __DIR__ . '/autoload_psr4.php'; 38 | foreach ($map as $namespace => $path) { 39 | $loader->setPsr4($namespace, $path); 40 | } 41 | 42 | $classMap = require __DIR__ . '/autoload_classmap.php'; 43 | if ($classMap) { 44 | $loader->addClassMap($classMap); 45 | } 46 | } 47 | 48 | $loader->register(true); 49 | 50 | return $loader; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /vendor/composer/autoload_static.php: -------------------------------------------------------------------------------- 1 | 11 | array ( 12 | 'Zend\\Escaper\\' => 13, 13 | ), 14 | 'P' => 15 | array ( 16 | 'PhpOffice\\PhpWord\\' => 18, 17 | 'PhpOffice\\Common\\' => 17, 18 | ), 19 | ); 20 | 21 | public static $prefixDirsPsr4 = array ( 22 | 'Zend\\Escaper\\' => 23 | array ( 24 | 0 => __DIR__ . '/..' . '/zendframework/zend-escaper/src', 25 | ), 26 | 'PhpOffice\\PhpWord\\' => 27 | array ( 28 | 0 => __DIR__ . '/..' . '/phpoffice/phpword/src/PhpWord', 29 | ), 30 | 'PhpOffice\\Common\\' => 31 | array ( 32 | 0 => __DIR__ . '/..' . '/phpoffice/common/src/Common', 33 | ), 34 | ); 35 | 36 | public static $classMap = array ( 37 | 'PclZip' => __DIR__ . '/..' . '/pclzip/pclzip/pclzip.lib.php', 38 | ); 39 | 40 | public static function getInitializer(ClassLoader $loader) 41 | { 42 | return \Closure::bind(function () use ($loader) { 43 | $loader->prefixLengthsPsr4 = ComposerStaticInit14be83cc03b4124b881edda06b5fb787::$prefixLengthsPsr4; 44 | $loader->prefixDirsPsr4 = ComposerStaticInit14be83cc03b4124b881edda06b5fb787::$prefixDirsPsr4; 45 | $loader->classMap = ComposerStaticInit14be83cc03b4124b881edda06b5fb787::$classMap; 46 | 47 | }, null, ClassLoader::class); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /vendor/pclzip/pclzip/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pclzip/pclzip", 3 | "type": "library", 4 | "description": "A PHP library that offers compression and extraction functions for Zip formatted archives", 5 | "keywords": ["php", "zip"], 6 | "homepage": "http://www.phpconcept.net/pclzip", 7 | "license": ["LGPL-2.1"], 8 | "authors": [ 9 | { 10 | "name": "Vincent Blavet" 11 | } 12 | ], 13 | "autoload": { 14 | "classmap": ["pclzip.lib.php"] 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /vendor/phpoffice/common/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | ._* 3 | .Spotlight-V100 4 | .Trashes 5 | Thumbs.db 6 | Desktop.ini 7 | .idea 8 | build/ 9 | phpunit.xml 10 | composer.phar 11 | vendor 12 | *.settings 13 | *.project 14 | *.buildpath 15 | 16 | /samples/results 17 | /phpunit.bat 18 | /todo.txt 19 | /samples/Sample_00_Test.php 20 | /samples/#47 21 | /samples/#70 22 | /samples/#71 23 | /samples/Github_*.* 24 | /samples/#83/*.lnk 25 | /composer.lock 26 | -------------------------------------------------------------------------------- /vendor/phpoffice/common/.scrutinizer.yml: -------------------------------------------------------------------------------- 1 | filter: 2 | excluded_paths: [ 'vendor/*', 'tests/*', 'samples/*' ] 3 | 4 | before_commands: 5 | - "composer install --prefer-source --dev" 6 | 7 | tools: 8 | php_code_sniffer: 9 | enabled: true 10 | config: 11 | standard: PSR2 12 | php_mess_detector: 13 | enabled: true 14 | config: 15 | ruleset: phpmd.xml.dist 16 | external_code_coverage: 17 | enabled: true 18 | timeout: 900 19 | php_cpd: true 20 | # php_sim: # Temporarily disabled to allow focus on things other than duplicates 21 | # min_mass: 40 22 | php_pdepend: true 23 | php_analyzer: true 24 | sensiolabs_security_checker: true -------------------------------------------------------------------------------- /vendor/phpoffice/common/.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | php: 4 | - 5.4 5 | - 5.5 6 | - 5.6 7 | - 7.0 8 | - 7.1 9 | - 7.2 10 | - hhvm 11 | 12 | matrix: 13 | allow_failures: 14 | - php: 7.1 15 | - php: 7.2 16 | - php: hhvm 17 | 18 | env: 19 | global: 20 | ## - secure: "LtlUOzC8FtqgbqUTmU7EU281NSCb58UFdvnz8lelNIDltBdP4eayN/TsgNIePB4jXg2d2R56ZA6j/grhE/md6jdUkulV355H3GrH/hIZmmQ+F9+87agnwLzb9+MJbqXoiE7VvjY3zGIO09G897SUfsfu6JWEcscYFlsH6KcXM6M=" 21 | 22 | before_script: 23 | ## Packages 24 | - sudo apt-get -qq update > /dev/null 25 | - sudo apt-get -qq install graphviz > /dev/null 26 | ## Composer 27 | - composer self-update 28 | - composer install --prefer-source --dev 29 | ## PHPDocumentor 30 | - mkdir -p build/docs 31 | - mkdir -p build/coverage 32 | 33 | script: 34 | ## PHP_CodeSniffer 35 | - ./vendor/bin/phpcs src/ tests/ --standard=PSR2 -n 36 | ## PHP Copy/Paste Detector 37 | # - ./vendor/bin/phpcpd src/ 38 | ## PHP Mess Detector 39 | - ./vendor/bin/phpmd src/,tests/ text ./phpmd.xml.dist 40 | ## PHPUnit 41 | - ./vendor/bin/phpunit -c ./ --coverage-text --coverage-html ./build/coverage 42 | ## PHPLOC 43 | - ./vendor/bin/phploc src/ 44 | ## PHPDocumentor 45 | - ./vendor/bin/phpdoc -q -d ./src -t ./build/docs --template="responsive-twig" 46 | 47 | after_script: 48 | ## PHPDocumentor 49 | ## - bash .travis_shell_after_success.sh 50 | ## Scrutinizer 51 | - wget https://scrutinizer-ci.com/ocular.phar 52 | - php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml 53 | 54 | notifications: 55 | webhooks: 56 | urls: 57 | - https://webhooks.gitter.im/e/e019b92a7793d27e080c 58 | on_success: change # options: [always|never|change] default: always 59 | on_failure: always # options: [always|never|change] default: always 60 | on_start: false # default: false -------------------------------------------------------------------------------- /vendor/phpoffice/common/.travis_shell_after_success.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "--DEBUG--" 4 | echo "TRAVIS_REPO_SLUG: $TRAVIS_REPO_SLUG" 5 | echo "TRAVIS_PHP_VERSION: $TRAVIS_PHP_VERSION" 6 | echo "TRAVIS_PULL_REQUEST: $TRAVIS_PULL_REQUEST" 7 | 8 | if [ "$TRAVIS_REPO_SLUG" == "PHPOffice/Common" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_PHP_VERSION" == "5.5" ]; then 9 | 10 | echo -e "Publishing PHPDoc...\n" 11 | 12 | cp -R build/docs $HOME/docs-latest 13 | cp -R build/coverage $HOME/coverage-latest 14 | 15 | cd $HOME 16 | git config --global user.email "travis@travis-ci.org" 17 | git config --global user.name "travis-ci" 18 | git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/PHPOffice/Common gh-pages > /dev/null 19 | 20 | cd gh-pages 21 | echo "--DEBUG : Suppression" 22 | git rm -rf ./docs/$TRAVIS_BRANCH 23 | 24 | echo "--DEBUG : Dossier" 25 | mkdir -p docs/$TRAVIS_BRANCH 26 | mkdir -p coverage/$TRAVIS_BRANCH 27 | 28 | echo "--DEBUG : Copie" 29 | cp -Rf $HOME/docs-latest/* ./docs/$TRAVIS_BRANCH/ 30 | cp -Rf $HOME/coverage-latest/* ./coverage/$TRAVIS_BRANCH/ 31 | 32 | echo "--DEBUG : Git" 33 | git add -f . 34 | git commit -m "PHPDocumentor (Travis Build: $TRAVIS_BUILD_NUMBER - Branch: $TRAVIS_BRANCH)" 35 | git push -fq origin gh-pages > /dev/null 36 | 37 | echo -e "Published PHPDoc to gh-pages.\n" 38 | 39 | fi 40 | -------------------------------------------------------------------------------- /vendor/phpoffice/common/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | ## 0.1.0 3 | 4 | ### Features 5 | - Initial Release 6 | 7 | ## 0.1.1 8 | 9 | ### Features 10 | - Added String::chr for suppporting Unicode Characters 11 | 12 | ## 0.2.0 13 | 14 | ### Changes 15 | - Renamed String class in Text class for supporting PHP7 16 | 17 | ## 0.2.1 18 | 19 | ### Features 20 | - Added XMLReader from PHPWord 21 | 22 | ## 0.2.2 23 | 24 | ### BugFix 25 | - Fixed "Class 'PhpOffice\Common\ZipArchive' not found in /src/Common/XMLReader.php on line 54" 26 | 27 | ## 0.2.3 28 | 29 | ### Features 30 | - Added missing features for supporting PHPWord 31 | 32 | ## 0.2.4 33 | 34 | ### Changes 35 | - XMLWriter : Refactoring for improving performances 36 | 37 | ## 0.2.5 38 | 39 | ### Features 40 | - Added Zip Adapters (PclZip & ZipArchive) 41 | 42 | ## 0.2.6 43 | 44 | ### Changes 45 | - `\PhpOffice\Common\Text::utf8ToUnicode()` became `public`. 46 | 47 | ## 0.2.7 48 | 49 | ### Features 50 | - Added `\PhpOffice\Common\File::fileGetContents()` (with support of zip://) 51 | - Added Support for PHP 7.1 52 | 53 | ## 0.2.8 54 | 55 | ### Features 56 | - Added possibility to register namespaces to DOMXpath 57 | - Added Utility to get an Office compatible hash of a password 58 | - Write attribute's value of type float independently of locale 59 | 60 | ## 0.2.9 61 | - Fix XML Entity injection vulnerability -------------------------------------------------------------------------------- /vendor/phpoffice/common/LICENSE: -------------------------------------------------------------------------------- 1 | PHPOffice Common, a shared PHP library for PHPOffice Libraries 2 | 3 | Copyright (c) 2015-2015 PHPOffice. 4 | 5 | PHPOffice Common is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU Lesser General Public License version 3 as published by 7 | the Free Software Foundation. 8 | 9 | PHPOffice Common is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License version 3 for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License version 3 15 | along with PHPOffice Common. If not, see . 16 | -------------------------------------------------------------------------------- /vendor/phpoffice/common/VERSION: -------------------------------------------------------------------------------- 1 | 0.2.9 -------------------------------------------------------------------------------- /vendor/phpoffice/common/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "phpoffice/common", 3 | "description": "PHPOffice Common", 4 | "keywords": ["PHP","Office","Common","component"], 5 | "homepage": "http://phpoffice.github.io", 6 | "type": "library", 7 | "license": "LGPL", 8 | "authors": [ 9 | { 10 | "name": "Mark Baker" 11 | }, 12 | { 13 | "name": "Franck Lefevre", 14 | "homepage": "http://rootslabs.net" 15 | } 16 | ], 17 | "require": { 18 | "php": ">=5.3.0", 19 | "pclzip/pclzip": "^2.8" 20 | }, 21 | "require-dev": { 22 | "phpunit/phpunit": "^4.8.36 || ^7.0", 23 | "phpdocumentor/phpdocumentor":"2.*", 24 | "phpmd/phpmd": "2.*", 25 | "sebastian/phpcpd": "2.*", 26 | "phploc/phploc": "2.*", 27 | "squizlabs/php_codesniffer": "2.*" 28 | }, 29 | "autoload": { 30 | "psr-4": { 31 | "PhpOffice\\Common\\": "src/Common/" 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/phpoffice/common/phpmd.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /vendor/phpoffice/common/phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | ./tests/Common 13 | 14 | 15 | 16 | 17 | ./src 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /vendor/phpoffice/common/src/Common/Adapter/Zip/PclZipAdapter.php: -------------------------------------------------------------------------------- 1 | oPclZip = new PclZip($filename); 21 | $this->tmpDir = sys_get_temp_dir(); 22 | return $this; 23 | } 24 | 25 | public function close() 26 | { 27 | return $this; 28 | } 29 | 30 | public function addFromString($localname, $contents) 31 | { 32 | $pathData = pathinfo($localname); 33 | 34 | $hFile = fopen($this->tmpDir.'/'.$pathData['basename'], "wb"); 35 | fwrite($hFile, $contents); 36 | fclose($hFile); 37 | 38 | $res = $this->oPclZip->add($this->tmpDir.'/'.$pathData['basename'], PCLZIP_OPT_REMOVE_PATH, $this->tmpDir, PCLZIP_OPT_ADD_PATH, $pathData['dirname']); 39 | if ($res == 0) { 40 | throw new \Exception("Error zipping files : " . $this->oPclZip->errorInfo(true)); 41 | } 42 | unlink($this->tmpDir.'/'.$pathData['basename']); 43 | return $this; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /vendor/phpoffice/common/src/Common/Adapter/Zip/ZipArchiveAdapter.php: -------------------------------------------------------------------------------- 1 | filename = $filename; 22 | $this->oZipArchive = new ZipArchive(); 23 | 24 | if ($this->oZipArchive->open($this->filename, ZipArchive::OVERWRITE) === true) { 25 | return $this; 26 | } 27 | if ($this->oZipArchive->open($this->filename, ZipArchive::CREATE) === true) { 28 | return $this; 29 | } 30 | throw new \Exception("Could not open $this->filename for writing."); 31 | } 32 | 33 | public function close() 34 | { 35 | if ($this->oZipArchive->close() === false) { 36 | throw new \Exception("Could not close zip file $this->filename."); 37 | } 38 | return $this; 39 | } 40 | 41 | public function addFromString($localname, $contents) 42 | { 43 | if ($this->oZipArchive->addFromString($localname, $contents) === false) { 44 | throw new \Exception("Error zipping files : " . $localname); 45 | } 46 | 47 | return $this; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /vendor/phpoffice/common/src/Common/Adapter/Zip/ZipInterface.php: -------------------------------------------------------------------------------- 1 | zipTest = tempnam(sys_get_temp_dir(), 'PhpOfficeCommon'); 23 | copy($pathResources.'Sample_01_Simple.pptx', $this->zipTest); 24 | } 25 | 26 | public function tearDown() 27 | { 28 | parent::tearDown(); 29 | 30 | if (is_file($this->zipTest)) { 31 | unlink($this->zipTest); 32 | } 33 | } 34 | 35 | public function testOpen() 36 | { 37 | $adapter = $this->createAdapter(); 38 | $this->assertSame($adapter, $adapter->open($this->zipTest)); 39 | } 40 | 41 | public function testClose() 42 | { 43 | $adapter = $this->createAdapter(); 44 | $adapter->open($this->zipTest); 45 | $this->assertSame($adapter, $adapter->close()); 46 | } 47 | 48 | public function testAddFromString() 49 | { 50 | $expectedPath = 'file.test'; 51 | $expectedContent = 'Content'; 52 | 53 | $adapter = $this->createAdapter(); 54 | $adapter->open($this->zipTest); 55 | $this->assertSame($adapter, $adapter->addFromString($expectedPath, $expectedContent)); 56 | $adapter->close(); 57 | 58 | $this->assertTrue(TestHelperZip::assertFileExists($this->zipTest, $expectedPath)); 59 | $this->assertTrue(TestHelperZip::assertFileContent($this->zipTest, $expectedPath, $expectedContent)); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /vendor/phpoffice/common/tests/Common/Tests/Adapter/Zip/PclZipAdapterTest.php: -------------------------------------------------------------------------------- 1 | assertContains( 33 | array('PhpOffice\\Common\\Autoloader', 'autoload'), 34 | spl_autoload_functions() 35 | ); 36 | } 37 | 38 | /** 39 | * Autoload 40 | */ 41 | public function testAutoload() 42 | { 43 | $declared = get_declared_classes(); 44 | $declaredCount = count($declared); 45 | Autoloader::autoload('Foo'); 46 | $this->assertEquals( 47 | $declaredCount, 48 | count(get_declared_classes()), 49 | 'PhpOffice\\Common\\Autoloader::autoload() is trying to load ' . 50 | 'classes outside of the PhpOffice\\Common namespace' 51 | ); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /vendor/phpoffice/common/tests/Common/Tests/FontTest.php: -------------------------------------------------------------------------------- 1 | assertEquals(16, Font::fontSizeToPixels()); 34 | $this->assertEquals((16 / 12) * $value, Font::fontSizeToPixels($value)); 35 | $this->assertEquals(96, Font::inchSizeToPixels()); 36 | $this->assertEquals(96 * $value, Font::inchSizeToPixels($value)); 37 | $this->assertEquals(37.795275591, Font::centimeterSizeToPixels()); 38 | $this->assertEquals(37.795275591 * $value, Font::centimeterSizeToPixels($value)); 39 | $this->assertEquals($value / 2.54 * 1440, Font::centimeterSizeToTwips($value)); 40 | $this->assertEquals($value * 1440, Font::inchSizeToTwips($value)); 41 | $this->assertEquals($value / 96 * 1440, Font::pixelSizeToTwips($value)); 42 | $this->assertEquals($value / 72 * 1440, Font::pointSizeToTwips($value)); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vendor/phpoffice/common/tests/Common/Tests/_includes/TestHelperZip.php: -------------------------------------------------------------------------------- 1 | open($fileZip) !== true) { 10 | return false; 11 | } 12 | if ($oZip->statName($path) === false) { 13 | return false; 14 | } 15 | return true; 16 | } 17 | 18 | public static function assertFileContent($fileZip, $path, $content) 19 | { 20 | $oZip = new \ZipArchive; 21 | if ($oZip->open($fileZip) !== true) { 22 | return false; 23 | } 24 | $zipFileContent = $oZip->getFromName($path); 25 | if ($zipFileContent === false) { 26 | return false; 27 | } 28 | if ($zipFileContent != $content) { 29 | return false; 30 | } 31 | return true; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/phpoffice/common/tests/bootstrap.php: -------------------------------------------------------------------------------- 1 | . 16 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/bootstrap.php: -------------------------------------------------------------------------------- 1 | value = $value; 40 | TblWidthSimpleType::validate($type); 41 | $this->type = $type; 42 | } 43 | 44 | /** 45 | * @return string 46 | */ 47 | public function getType() 48 | { 49 | return $this->type; 50 | } 51 | 52 | /** 53 | * @return int 54 | */ 55 | public function getValue() 56 | { 57 | return $this->value; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Element/Bookmark.php: -------------------------------------------------------------------------------- 1 | name = CommonText::toUTF8($name); 49 | } 50 | 51 | /** 52 | * Get Bookmark name 53 | * 54 | * @return string 55 | */ 56 | public function getName() 57 | { 58 | return $this->name; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Element/Cell.php: -------------------------------------------------------------------------------- 1 | width = $width; 55 | $this->style = $this->setNewStyle(new CellStyle(), $style, true); 56 | } 57 | 58 | /** 59 | * Get cell style 60 | * 61 | * @return \PhpOffice\PhpWord\Style\Cell 62 | */ 63 | public function getStyle() 64 | { 65 | return $this->style; 66 | } 67 | 68 | /** 69 | * Get cell width 70 | * 71 | * @return int 72 | */ 73 | public function getWidth() 74 | { 75 | return $this->width; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Element/CheckBox.php: -------------------------------------------------------------------------------- 1 | setName($name); 47 | parent::__construct($text, $fontStyle, $paragraphStyle); 48 | } 49 | 50 | /** 51 | * Set name content 52 | * 53 | * @param string $name 54 | * @return self 55 | */ 56 | public function setName($name) 57 | { 58 | $this->name = CommonText::toUTF8($name); 59 | 60 | return $this; 61 | } 62 | 63 | /** 64 | * Get name content 65 | * 66 | * @return string 67 | */ 68 | public function getName() 69 | { 70 | return $this->name; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Element/Endnote.php: -------------------------------------------------------------------------------- 1 | addImage($src, $style, true); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Element/Line.php: -------------------------------------------------------------------------------- 1 | style = $this->setNewStyle(new LineStyle(), $style); 42 | } 43 | 44 | /** 45 | * Get line style 46 | * 47 | * @return \PhpOffice\PhpWord\Style\Line 48 | */ 49 | public function getStyle() 50 | { 51 | return $this->style; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Element/PageBreak.php: -------------------------------------------------------------------------------- 1 | style = $this->setNewStyle(new TextBoxStyle(), $style); 49 | } 50 | 51 | /** 52 | * Get textbox style 53 | * 54 | * @return \PhpOffice\PhpWord\Style\TextBox 55 | */ 56 | public function getStyle() 57 | { 58 | return $this->style; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Escaper/AbstractEscaper.php: -------------------------------------------------------------------------------- 1 | escapeSingleValue($item); 39 | } 40 | } else { 41 | $input = $this->escapeSingleValue($input); 42 | } 43 | 44 | return $input; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Escaper/EscaperInterface.php: -------------------------------------------------------------------------------- 1 | ooxmlVersion; 48 | } 49 | 50 | /** 51 | * Set OOXML version 52 | * 53 | * @param int $value 54 | * @return self 55 | */ 56 | public function setOoxmlVersion($value) 57 | { 58 | $this->ooxmlVersion = $value; 59 | 60 | return $this; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Reader/HTML.php: -------------------------------------------------------------------------------- 1 | canRead($docFile)) { 44 | $section = $phpWord->addSection(); 45 | HTMLParser::addHtml($section, file_get_contents($docFile), true); 46 | } else { 47 | throw new \Exception("Cannot read {$docFile}."); 48 | } 49 | 50 | return $phpWord; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Reader/ODText/AbstractPart.php: -------------------------------------------------------------------------------- 1 | canRead($docFile)) { 44 | $doc = new Document(); 45 | $doc->rtf = file_get_contents($docFile); 46 | $doc->read($phpWord); 47 | } else { 48 | throw new \Exception("Cannot read {$docFile}."); 49 | } 50 | 51 | return $phpWord; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Reader/ReaderInterface.php: -------------------------------------------------------------------------------- 1 | 'setCompany', 'Manager' => 'setManager'); 33 | 34 | /** 35 | * Callback functions 36 | * 37 | * @var array 38 | */ 39 | protected $callbacks = array(); 40 | } 41 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Reader/Word2007/DocPropsCustom.php: -------------------------------------------------------------------------------- 1 | getDomFromZip($this->docFile, $this->xmlFile); 40 | $docProps = $phpWord->getDocInfo(); 41 | 42 | $nodes = $xmlReader->getElements('*'); 43 | if ($nodes->length > 0) { 44 | foreach ($nodes as $node) { 45 | $propertyName = $xmlReader->getAttribute('name', $node); 46 | $attributeNode = $xmlReader->getElement('*', $node); 47 | $attributeType = $attributeNode->nodeName; 48 | $attributeValue = $attributeNode->nodeValue; 49 | $attributeValue = DocInfo::convertProperty($attributeValue, $attributeType); 50 | $attributeType = DocInfo::convertPropertyType($attributeType); 51 | $docProps->setCustomProperty($propertyName, $attributeValue, $attributeType); 52 | } 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Reader/Word2007/Endnotes.php: -------------------------------------------------------------------------------- 1 | setStyleByArray($style); 45 | } 46 | 47 | /** 48 | * Get color 49 | * 50 | * @return string 51 | */ 52 | public function getColor() 53 | { 54 | return $this->color; 55 | } 56 | 57 | /** 58 | * Set color 59 | * 60 | * @param string $value 61 | * @return self 62 | */ 63 | public function setColor($value = null) 64 | { 65 | $this->color = $value; 66 | 67 | return $this; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Template.php: -------------------------------------------------------------------------------- 1 | element instanceof \PhpOffice\PhpWord\Element\Bookmark) { 35 | return ''; 36 | } 37 | 38 | $content = ''; 39 | $content .= $this->writeOpening(); 40 | $content .= "element->getName()}\"/>"; 41 | $content .= $this->writeClosing(); 42 | 43 | return $content; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/HTML/Element/Endnote.php: -------------------------------------------------------------------------------- 1 | element instanceof \PhpOffice\PhpWord\Element\Footnote) { 42 | return ''; 43 | } 44 | /** @var \PhpOffice\PhpWord\Writer\HTML $parentWriter Type hint */ 45 | $parentWriter = $this->parentWriter; 46 | 47 | $noteId = count($parentWriter->getNotes()) + 1; 48 | $noteMark = $this->noteType . '-' . $this->element->getRelationId(); 49 | $content = "{$noteId}"; 50 | 51 | $parentWriter->addNote($noteId, $noteMark); 52 | 53 | return $content; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/HTML/Element/Image.php: -------------------------------------------------------------------------------- 1 | element instanceof ImageElement) { 38 | return ''; 39 | } 40 | $content = ''; 41 | $imageData = $this->element->getImageStringData(true); 42 | if ($imageData !== null) { 43 | $styleWriter = new ImageStyleWriter($this->element->getStyle()); 44 | $style = $styleWriter->write(); 45 | $imageData = 'data:' . $this->element->getImageType() . ';base64,' . $imageData; 46 | 47 | $content .= $this->writeOpening(); 48 | $content .= ""; 49 | $content .= $this->writeClosing(); 50 | } 51 | 52 | return $content; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/HTML/Element/Link.php: -------------------------------------------------------------------------------- 1 | element instanceof \PhpOffice\PhpWord\Element\Link) { 37 | return ''; 38 | } 39 | 40 | $prefix = $this->element->isInternal() ? '#' : ''; 41 | $content = $this->writeOpening(); 42 | if (Settings::isOutputEscapingEnabled()) { 43 | $content .= "escaper->escapeHtmlAttr($this->element->getSource())}\">{$this->escaper->escapeHtml($this->element->getText())}"; 44 | } else { 45 | $content .= "element->getSource()}\">{$this->element->getText()}"; 46 | } 47 | $content .= $this->writeClosing(); 48 | 49 | return $content; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/HTML/Element/ListItem.php: -------------------------------------------------------------------------------- 1 | element instanceof \PhpOffice\PhpWord\Element\ListItem) { 37 | return ''; 38 | } 39 | 40 | if (Settings::isOutputEscapingEnabled()) { 41 | $content = '

' . $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 ''; 40 | } 41 | 42 | return ''; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vendor/phpoffice/phpword/src/PhpWord/Writer/HTML/Element/TextBreak.php: -------------------------------------------------------------------------------- 1 | withoutP) { 35 | $content = '
' . PHP_EOL; 36 | } else { 37 | $content = '

 

' . 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}" . 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 |