├── LICENSE ├── README.md ├── Readme.txt ├── check.php ├── classes ├── AutoLoader.php ├── CleanTemp.php ├── CreateAreaChart.php ├── CreateBarChart.php ├── CreateBubbleChart.php ├── CreateBubbleXlsx.php ├── CreateChartFactory.php ├── CreateChartRels.php ├── CreateCompletedXlsx.php ├── CreateDocument.php ├── CreateDocx.php ├── CreateDocxFromTemplate.php ├── CreateDoughnutChart.php ├── CreateElement.php ├── CreateEndnote.php ├── CreateFactory.php ├── CreateFooter.php ├── CreateFootnote.php ├── CreateFormElement.php ├── CreateGraphic.php ├── CreateGraphicImg.php ├── CreateHeader.php ├── CreateImage.php ├── CreateImageCaption.php ├── CreateLineChart.php ├── CreateLink.php ├── CreateList.php ├── CreateListStyle.php ├── CreateMath.php ├── CreateOfPieChart.php ├── CreatePage.php ├── CreateParagraphStyle.php ├── CreatePieChart.php ├── CreateProperties.php ├── CreateRadarChart.php ├── CreateScatterChart.php ├── CreateScatterXlsx.php ├── CreateShape.php ├── CreateSimpleXlsx.php ├── CreateStructuredDocumentTag.php ├── CreateStyleTable.php ├── CreateSurfaceChart.php ├── CreateTable.php ├── CreateTableContents.php ├── CreateTemplate.php ├── CreateText.php ├── CreateTextBox.php ├── CreateTheme1.php ├── CreateWebSettings.php ├── CreateXML.php ├── CreateXlsx.php ├── DOCXStructure.php ├── DOMPDF_lib.php ├── Docx2Text.php ├── EmbedDOCX.php ├── EmbedDocument.php ├── EmbedHTML.php ├── EmbedMHT.php ├── EmbedRTF.php ├── EmbedWordML.php ├── GenerateDocx.php ├── HTML2WordML.php ├── Helpers.php ├── InterfaceGraphic.php ├── InterfaceXlsx.php ├── MSWordInterface.php ├── OOXMLResources.php ├── PhpdocxLogger.php ├── PhpdocxUtilities.php ├── Phpdocx_Phpdocx.php ├── Phpdocx_config.php ├── PrepareTemplate.php ├── Repair.php ├── SearchAndReplaceTextWordDocument.php ├── StructureDocx.php ├── TCPDF_lib.php ├── TemplateProcessing.php ├── Text2Docx.php ├── WordFragment.php ├── WordML.php └── WordMLFragment.php ├── composer.json ├── config └── phpdocxconfig.ini ├── examples ├── Core │ ├── addBookmark │ │ ├── sample_1.php │ │ └── sample_2.php │ ├── addBreak │ │ ├── sample_1.php │ │ └── sample_2.php │ ├── addChart │ │ ├── sample_1.php │ │ ├── sample_10.php │ │ ├── sample_11.php │ │ ├── sample_12.php │ │ ├── sample_13.php │ │ ├── sample_14.php │ │ ├── sample_15.php │ │ ├── sample_16.php │ │ ├── sample_2.php │ │ ├── sample_3.php │ │ ├── sample_4.php │ │ ├── sample_5.php │ │ ├── sample_6.php │ │ ├── sample_7.php │ │ ├── sample_8.php │ │ └── sample_9.php │ ├── addComment │ │ ├── sample_1.php │ │ └── sample_2.php │ ├── addCrossReference │ │ └── sample_1.php │ ├── addDateAndHour │ │ ├── sample_1.php │ │ └── sample_2.php │ ├── addEndnote │ │ ├── sample_1.php │ │ └── sample_2.php │ ├── addExternalFile │ │ ├── sample_1.php │ │ ├── sample_2.php │ │ └── sample_3.php │ ├── addFootnote │ │ ├── sample_1.php │ │ └── sample_2.php │ ├── addFormElement │ │ └── sample_1.php │ ├── addHeading │ │ └── sample_1.php │ ├── addImage │ │ ├── sample_1.php │ │ ├── sample_2.php │ │ ├── sample_3.php │ │ ├── sample_4.php │ │ └── sample_5.php │ ├── addLink │ │ ├── sample_1.php │ │ └── sample_2.php │ ├── addList │ │ ├── sample_1.php │ │ ├── sample_2.php │ │ ├── sample_3.php │ │ ├── sample_4.php │ │ ├── sample_5.php │ │ └── sample_6.php │ ├── addMathEquation │ │ ├── sample_1.php │ │ ├── sample_2.php │ │ ├── sample_3.php │ │ └── sample_4.php │ ├── addMergeField │ │ └── sample_1.php │ ├── addPageNumber │ │ ├── sample_1.php │ │ └── sample_2.php │ ├── addShape │ │ └── sample_1.php │ ├── addSimpleField │ │ └── sample_1.php │ ├── addStructuredDocumentTag │ │ └── sample_1.php │ ├── addTable │ │ ├── sample_1.php │ │ ├── sample_2.php │ │ ├── sample_3.php │ │ └── sample_4.php │ ├── addTableContents │ │ ├── sample_1.php │ │ └── sample_2.php │ ├── addText │ │ ├── sample_1.php │ │ ├── sample_2.php │ │ ├── sample_3.php │ │ ├── sample_4.php │ │ └── sample_5.php │ ├── addTextBox │ │ ├── sample_1.php │ │ ├── sample_2.php │ │ └── sample_3.php │ ├── addWordML │ │ └── sample_1.php │ └── embedHTML │ │ ├── sample_1.php │ │ └── sample_2.php ├── FormatConversion │ ├── docx2txt │ │ └── sample_1.php │ ├── transformDocxUsingMSWord │ │ └── sample_1.php │ ├── transformOMMLToMathML │ │ └── sample_1.php │ └── txt2docx │ │ └── sample_1.php ├── LayoutAndGeneral │ ├── addBackgroundImage │ │ └── sample_1.php │ ├── addFooter │ │ ├── sample_1.php │ │ └── sample_2.php │ ├── addHeader │ │ ├── sample_1.php │ │ └── sample_2.php │ ├── addLineNumbering │ │ └── sample_1.php │ ├── addMacroFromDoc │ │ └── sample_1.php │ ├── addPageBorders │ │ └── sample_1.php │ ├── addProperties │ │ ├── sample_1.php │ │ └── sample_2.php │ ├── addSection │ │ └── sample_1.php │ ├── createCharacterStyle │ │ └── sample_1.php │ ├── createListStyle │ │ ├── sample_1.php │ │ └── sample_2.php │ ├── createParagraphStyle │ │ ├── sample_1.php │ │ └── sample_2.php │ ├── docxSettings │ │ ├── sample_1.php │ │ └── sample_2.php │ ├── importHeadersAndFooters │ │ └── sample_1.php │ ├── importListStyle │ │ └── sample_1.php │ ├── importStyles │ │ ├── sample_1.php │ │ └── sample_2.php │ ├── modifyPageLayout │ │ ├── sample_1.php │ │ └── sample_2.php │ ├── parseStyles │ │ ├── sample_1.php │ │ ├── sample_2.php │ │ ├── sample_3.php │ │ └── sample_4.php │ ├── removeFooters │ │ └── sample_1.php │ ├── removeHeaders │ │ └── sample_1.php │ ├── setBackgroundColor │ │ └── sample_1.php │ ├── setDefaultFont │ │ └── sample_1.php │ ├── setDocumentDefaultStyles │ │ └── sample_1.php │ ├── setEncodeUTF-8 │ │ └── sample_1.php │ ├── setLanguage │ │ └── sample_1.php │ └── setMarkAsFinal │ │ └── sample_1.php ├── Templates │ ├── clearBlocks │ │ └── sample_1.php │ ├── deleteTemplateBlock │ │ └── sample_1.php │ ├── getTemplateVariables │ │ └── sample_1.php │ ├── modifyInputFields │ │ └── sample_1.php │ ├── processTemplate │ │ └── sample_1.php │ ├── removeTemplateVariable │ │ └── sample_1.php │ ├── replaceListVariable │ │ ├── sample_1.php │ │ ├── sample_2.php │ │ └── sample_3.php │ ├── replacePlaceholderImage │ │ ├── sample_1.php │ │ ├── sample_2.php │ │ └── sample_3.php │ ├── replaceTableVariable │ │ ├── sample_1.php │ │ ├── sample_2.php │ │ ├── sample_3.php │ │ └── sample_4.php │ ├── replaceVariableByExternalFile │ │ └── sample_1.php │ ├── replaceVariableByHTML │ │ └── sample_1.php │ ├── replaceVariableByText │ │ └── sample_1.php │ ├── replaceVariableByWordFragment │ │ ├── sample_1.php │ │ ├── sample_2.php │ │ ├── sample_3.php │ │ ├── sample_4.php │ │ └── sample_5.php │ ├── replaceVariableByWordML │ │ └── sample_1.php │ ├── setTemplateBlockSymbol │ │ └── sample_1.php │ ├── setTemplateSymbol │ │ └── sample_1.php │ └── tickCheckboxes │ │ └── sample_1.php ├── files │ ├── Book.xlsx │ ├── Checkbox.docx │ ├── DOCXPathBlocks.docx │ ├── DOCXPathBlocks_2.docx │ ├── DOCXPathTemplate.docx │ ├── External.docx │ ├── Heading_First.docx │ ├── MultipleSections.docx │ ├── SimpleExample.docx │ ├── TemplateBlocks.docx │ ├── TemplateBlocksCustomSymbol.docx │ ├── TemplateBlocks_2.docx │ ├── TemplateCharacterStyles.docx │ ├── TemplateComplexTable.docx │ ├── TemplateExternalFile.docx │ ├── TemplateHTML.docx │ ├── TemplateHeaderAndFooter.docx │ ├── TemplateList.docx │ ├── TemplateList_header_footer.docx │ ├── TemplatePipeSymbol.docx │ ├── TemplateSimpleTable.docx │ ├── TemplateSimpleTable_header_footer.docx │ ├── TemplateSimpleText.docx │ ├── TemplateStyleList.docx │ ├── TemplateStyles.docx │ ├── TemplateVariables.docx │ ├── TemplateWordFragment_1.docx │ ├── TemplateWordFragment_2.docx │ ├── TemplateWordFragment_3.docx │ ├── TemplateWordFragmentsTarget.docx │ ├── TemplateWordML.docx │ ├── Test.mht │ ├── Test.pdf │ ├── Test.pem │ ├── Test.rtf │ ├── Test2.pdf │ ├── Test3.pdf │ ├── Text.docx │ ├── Text.txt │ ├── Watermark.docx │ ├── WatermarkImage.docx │ ├── crazyTOC.docx │ ├── document_sections.docx │ ├── document_test.pdf │ ├── docxpath │ │ ├── bookmarks.docx │ │ ├── breaks.docx │ │ ├── charts.docx │ │ ├── endnotes.docx │ │ ├── footnotes.docx │ │ ├── headings.docx │ │ ├── images.docx │ │ ├── links.docx │ │ ├── lists.docx │ │ ├── paragraphs.docx │ │ ├── paragraphs_2.docx │ │ ├── sections.docx │ │ ├── shapes.docx │ │ └── tables.docx │ ├── example_area_chart.docx │ ├── fileMacros.docm │ ├── headings.docx │ ├── image.png │ ├── indexer.docx │ ├── inputFields.docx │ ├── insert.docx │ ├── linked_image.docx │ ├── math.docx │ ├── object_doc.doc │ ├── object_docx.docx │ ├── object_pdf.pdf │ ├── object_ppt.ppt │ ├── object_pptx.pptx │ ├── object_xls.xls │ ├── object_xlsx.xlsx │ ├── placeholderImage.docx │ ├── placeholderImageFootnote.docx │ ├── protectedDocument.docx │ ├── second.docx │ ├── simpleRTF.rtf │ ├── simpleTemplate.docx │ ├── stylesTemplate.docx │ └── template_not_optimized.docx └── img │ ├── image.jpg │ ├── image.png │ ├── imageP1.png │ ├── imageP2.png │ ├── imageP3.png │ ├── imagebg.jpg │ ├── logo_header.jpg │ └── logo_phpdocx.gif ├── excel ├── [Content_Types].xml ├── _rels │ └── .rels ├── docProps │ ├── app.xml │ └── core.xml ├── excel.xlsx └── xl │ ├── _rels │ └── workbook.xml.rels │ ├── printerSettings │ └── printerSettings1.bin │ ├── sharedStrings.xml │ ├── styles.xml │ ├── tables │ └── table1.xml │ ├── theme │ └── theme1.xml │ ├── workbook.xml │ └── worksheets │ ├── _rels │ └── sheet1.xml.rels │ └── sheet1.xml ├── plugins └── wysiwyg │ └── config.js ├── templates ├── README.txt ├── comments.xml ├── comments.xml.rels ├── directory ├── endnotes.xml ├── endnotes.xml.rels ├── footnotes.xml ├── footnotes.xml.rels ├── header ├── html.css ├── phpdocxBaseTemplate.docm ├── phpdocxBaseTemplate.docx ├── phpdocxBaseTemplateNumberedHeadings.docx └── xmls │ ├── [Content_Types].xml │ ├── app.xml │ ├── comments.xml │ ├── comments.xml.rels │ ├── core.xml │ ├── document.xml │ ├── document.xml.rels │ ├── endnotes.xml │ ├── endnotes.xml.rels │ ├── footnotes.xml │ ├── footnotes.xml.rels │ ├── numbering.xml │ ├── settings.xml │ └── styles.xml └── xsl ├── MML2OMML.XSL ├── MML2OMML_n.XSL ├── OMML2MML.XSL └── docx2html.xsl /README.md: -------------------------------------------------------------------------------- 1 | # phpdocx 2 | PHP Docx generator free 3 | 4 | # Using (composer.json) 5 | ``` 6 | "require": { 7 | "lpkapil/phpdocx": "1.0.0" 8 | }, 9 | "repositories": [ 10 | { 11 | "type": "package", 12 | "package": { 13 | "name": "lpkapil/phpdocx", 14 | "version": "1.0.0", 15 | "source": { 16 | "url": "https://github.com/lpkapil/phpdocx.git", 17 | "type": "git", 18 | "reference": "master" 19 | } 20 | } 21 | } 22 | ] 23 | ``` 24 | -------------------------------------------------------------------------------- /classes/AutoLoader.php: -------------------------------------------------------------------------------- 1 | open($file); 15 | $this->_docxContent = array(); 16 | for ($i = 0; $i < $fileRepaired->numFiles; $i++) { 17 | $this->_docxContent[$fileRepaired->getNameIndex($i)] = $fileRepaired->getFromName($fileRepaired->getNameIndex($i)); 18 | } 19 | foreach ($this->_docxContent as $key => $value) { 20 | $fileRepaired->addFromString($key, $value); 21 | } 22 | // close DOCX to save all files 23 | $fileRepaired->close(); 24 | } 25 | -------------------------------------------------------------------------------- /classes/InterfaceGraphic.php: -------------------------------------------------------------------------------- 1 | nZAxa8MwEIV3/YobEw92kqW0XQomlEAaAsmQVTlfbDW2JaRz7VD63yspbih0KESLpHd33zueEFmSCEhg1TLZk0SCk7aAlbTsvB5KLyiZSm0vALCtTKFxiLKReJYleRWopobaOOHbtblYVVYMkN+eE5zCRlokCVuriw5R6ZYcvHU1q4YKJWGXrtMA+H0mFbN5yrK+79NFU2CKuplGl1ohtS66m+tSsF7ly81uGcsfZJ13COXFbP6Qzh7T+XwcbM8jPcDdSB8hwcC3ZULdArlF82qlqRSKTyHCdEwunARySz4joOZIRUEFDE19zXBs+Ol7kYjkHJju6Pcf1SzeVwlOXYscFseIXI7EQ1PngTeZPv8xt8SdbYErApalg74iS/FbSJagvGIVM7X3LxNAe1n+466P74QMfDH+fYrSULvhftuS+OABew8M1l/iGw== -------------------------------------------------------------------------------- /classes/InterfaceXlsx.php: -------------------------------------------------------------------------------- 1 | tZExb8IwEIX3/IobOkCGBFiqtgsSYkCiCCkduprLJbFI7Mi+lKCq/722caMubK2XRO/O33t6TpI8TRNIYaeYTCWQoNIGxtaOTvWDNQqmWpsrABybvtQ4BrkXeBY1ORWopY4U29u67q9G1g0DbKbfGc7hIAySgKPR5YAotSILr0PLsqNSCiiyfeYBv8+sYe6f8/xyuWSrrsQMdTcPLq1EUja497dQsN9ttodiG8YfZKxz8OPVYvmYLZ6y5TJeVOdI93Ab6RHiDdxansipjqmYd9/JZ5L4q6E0f1LYGHIFgQAakVqwDRHH2c/KWiCStdAPJ5c7qnn43iSoBoXsA2OgbT2q8KTZQynYzl/u29pGGCrBspGqhkq27gWN7oAbis/4J1m8SRE87N1MhngwymVicfIx/ifLm4dPGb6Sbw== -------------------------------------------------------------------------------- /classes/MSWordInterface.php: -------------------------------------------------------------------------------- 1 | tVVta9tIEP7uXzFXCpaD45dAL3cXYhLslgby4tbh0qOUslmNLGF5V+yuIpuS/36zu7IsyzqO46g+JPLsPjPPPPOiTmd4ctKBE7iJYP5xPpP8CyQaEqENS1MM6Q0YaFQvqKBITEy/CqlWiVgCl9kWZARPUoVwNhqdg1QgsKCbW5nDmm2t41wjJAaMhFBCJNWaGUIK8qcTKfTA3lnkWSaVoXD+gu7D7GH6BZgI7YsFz2cf+vD5kf58fLy73Z0Q2OKvODO4lGoLAPM4CyXfOHPG+IotkaxlSENRPYC4q2QZG4Bp9RrwHtwzxZHBXMkw55wYooa7PDXJGsOEwWJw6xjXnyA2JvtjOCyKYnC2DvmAy3XPRUkTjkK7+JmnBbc30/f3i/fuuNTAHp+NxueD0e+D8bgEilXp3TrXpffSiQ1A14YdnjJN9Ba2AjeCkosYx86PTscCXWHt89OK653/e4H9vf9RZO/ginGOlG+WP5OwlTVjiq3hLQmzkDkVD/4ifjqWeRo6biZGiPI0hadEhLIgPKNMKZo9cDUJFK5x/UypkRU1ZxnCM7WOJnlj1L2WUDPUJhHM2PL9tHAKTa4EvMgkLG1D998LQFEEdwSMYkJbUT84YYO9Fv0mWe/8R2fXu2+5DBEugSnFtkFltk+XkF24nMCof2jPwsjZx+eNA2X8wa8Ne2zWqTv47fig1W42xtnfVebeRfU6HD4hCFkAj5GvnKy4MTRnrhZRM+N9qtWta5ssJY2bLKX0g+6geyzURQuQMNooI1NJcxA4zb5nMgsarnsErtBJBMEv/uoKt99xk2ija4i+r0GvV6uKfeiiCbqPMQ2s9n29p0E2IQ3o3UR1a2xfa0LR3LuuqzUrZZmvURjwRKBAoHaUL3aGDzhHSYoV24Y2Ta5XubAb6+henVWN1i1SYNpBytDCcQvGrSRBu6vSfLfUvJ2Ep90D04e74A1tqHDAsoxGwEV507Oryct13b6/CuYFi2ROK8VOjJPVLb5uvViut8ph3rUXrTMr4m5Zk8+7Rclaw/jMBo/p84HqQL5GAqeTP0v85JJATQFdXEPfL9oIMkPhIpZl31XsANBWIT/yR8VpkfN0Miud6tPJA8Wr4y8O0K+AKW21Y5de8HLlWip7hbtNH41c72l4qe80e/HrkjphiaY90X9m/nX87XSyIB/XRw1aztTX/ZR9a1CqSPBUUno2xH8JO7WooN7fbTLtRvigeVznlC32jLaBguob29s3U/tIH9H6lFOIege3DA59jLwvGsLXzt8= -------------------------------------------------------------------------------- /classes/PhpdocxLogger.php: -------------------------------------------------------------------------------- 1 | vVTfa9swEH73X3EPgSbFc9ruYSOjo6PLQyEtpWHPRZXPjqgsGUmOG0b/9+mXPcdNoBQ2vcg+3d333XcnJcn89DSBU1jJskRlv9zPFSUGS6l2AHC/qXNJX4JZ1jvFyo0BuO4/p3QGd0RRJHCvZN5QyqRADbcNN6zCnBFYZ6vMJRiu6caYejGft22bXVQ5zaisZh6FM4pCo3OqAzisbq6Xd+ulP96i0hbBHV+cnX/Nzs6z8y8xUDzH7C65jtljEgdg3eYJ5UTrrq5Y9+/ERXkt3Oo2uCKUovWuFdtaTXqzNsQw2v9uiQJtFBNlNM39HqMgeMPkMWeaPHEMoHAJRjX4Lfk/2FyWFvHu12r1BhHWNpqjkSIFhaZRApiwgYIiyAK8YMfINU98QKYmilQwqewRKRFu424kaBS52y2N0qJBYR2xlep5HMtxixx+cC5bzGFLeIN6YZUiFFPI8akpU8uukCm0RFnCqJRUKRTEEH5YoyiIZ9rpUTSCGjdG3Pdi2lFOI4GZjwlj4VawaqsgUYrspv2BWyee1km6b3QkxzYhLTiOra4Qq8nY7CsbG32dA+MsdtN3dG7Lk3V/bVgRZAFPvnez5mmU+fKyyzgbFOuW2SjZgsAWli8Ua6dVL5LF7Nxek720GnmxWLwZdAtTEK5xDGIJS8F3oGWFEBUmCl3XWb7n6ZIz8RjED+S7VunZOK1bk3AnVqFMd0OMdCOlYvSghkMF2LE4lNWtgcun70OYQ/r81enwX/h6fXMjfwYBbRswjmj2vhv4/snf69F0PPBHOhmfrMOkl+Jfc0bxAcp+9I5xXqMBArSxF6fqWMONgcpaoJDuGfIF3a8fPkPsr35nXeFFq9iLfcgmITdcD5E+oIBGE8uPGY+pEN776NRV/5r8AQ== -------------------------------------------------------------------------------- /classes/PhpdocxUtilities.php: -------------------------------------------------------------------------------- 1 | zVRtT9swEP6eX3EDpCaIJW2ZRFuEBiuJhMQQGuPTiiLjOKlFmmS2A0Wo/51z4kR9YQKVL7NkOTnf89xzZ58ty9vft2AfrqdFlNP5reIpV5xJtGnzKSWKJbl4BmhcKnNB6ANJGFqhXIKgf148C55MFcC4/bSpA1dEUEbgWuRRSSnPMybhZ5kqPmMRJ3DjXrqaYHnYU6WKkec9PT25/VlEXZrPnCpKyinLZBW+qFXB5cXYv7rxq+1HJiRG0Nv9bu/I7Q7dXs8AswfDrsmlYTckOgC6eRZNiZSbNXmxLI2sSqZHs8ApoZQhoijvUVprlYqopd9HIoBnWE8mjM2r1kLwRywz1O6wFxo54zyLeXK8HhTGU0YfgMcIEDxLgEu4/R0Mmu13RBVEkFkD3TPrTb2oHKgm/1cGgqlSZHCf5ykj2WoSVZQmh7jMqNJHwOWtige2iRPyrCiVUwFerOacGxEnsOJmEl/1KARLQsGKlFBm7+z+mcy7Q5xnOM8n837362R+5N/t7hzADk6Dc44/xDTuI/o8uMPPgSb6EWxDNJn7XWQ4MwyfI0O030O0P8bp41whfOkvthN43pAMP59toLMdbma7nTgkCHTCweEK1+F2iQbfGpLB+9paQnPL7Zb4BD3hOyhRMhhBTFLJTPzFRnP+qsEEyoz/LRmPdFPdMygli7D7QZFEbvV6GFW1po+0Hja6ZPUbYq+3HD4e9hcuJVO2ZGk8Gq09Oo6z5KzHm1665DoI9isPY54yO+IiIzNmh2FwcemHoQMudDzX9WgF8Ay8/nMR1jmoyrp0nIv1c3gz9P9f/lrARbRR+71W2knlxCO7Y3ILO2/cw9a/zXlhvQI= -------------------------------------------------------------------------------- /classes/Phpdocx_Phpdocx.php: -------------------------------------------------------------------------------- 1 | TZAxb4MwEIV3/4rbAgwmZKnaLpEIVSPRCClLN2QdJ7ACNrVNSVT1v9cmqK0XW3ffe896jKVJwiCBvBfWgtMwWYLqtTpofIdZuk4qEKDEQHYUSB4N9B6Fo1abGwBU3dhovC5jj1xES34KHfUjmTusx5uRbecA8t9nhDGchEESUBndTIhSK7LwNvVODtRIAWde8mDw/0Sdc+NTms7zzHdDgxz1EC8pvURSdske71+C8pgXp3OxrD/JWJ8Q1rtt9sC3jzzLVqG6rO7B3K7uq0kI8FjKDH1M0lCtFRI00oROorp+OZZFXcfAYZPmhnwvh6Dy6s0zY7jUulZUrzfQ1ZFqLPzx7IuFfPbNfgA= -------------------------------------------------------------------------------- /classes/PrepareTemplate.php: -------------------------------------------------------------------------------- 1 | tVZRT+M4EH7Pr5iHSk3R0iz7ctquQKyAOyEVFl05ad8q40wTiyTO2Q6li/jvO3ackjZpF47bvCSxZ+b7vpnxJEEQHRwEcAA3CkumUINJEQzmZcYMvS2kcitcFg+otJAFlFmViIJ8rNspJ7NEqhUA3KRlLPmjWy4Zv2cJ0ipQWI2qNpblSokkNQBn68eQj+CaKY6MSMi44pxQCPqqyozIMRYMZuPp2AZoX2FqTDmJouVyOf6Ux3zMZT5yKJngWOgau6YE08uzi+vZhdtudND16ePRH+OPn8dHR96xuPfRbXDto/sgFoDMooBnTOsmYbc+VcFTEFhHl057NTc4ZZwjOZRKPFjDZvmBKdBGiSLxS5G7ezPaYkZwGMxFQY8FRziG63+m0y//BYcpxVa9MIP5Y55RaGcRjjrRqVCErypuXgW3GXxRFdzYXM/nvAkTjpzJU9AU0j08d3DPcT9sdUd13kR1S23QGN+GecUSCpCjSWX8ARSaShUaeKUUFga+X01fQwZOa0dfXPi7futG2cXayJnz7LD2cQcmFfrwxBbuyw4hM3LP0MiiUQHrLpILcA38JilnCqmet/ho1jt1f/ZJ8Z27VpSgufToHUliAaHGbDGZtBu97vRRy85eXTsocEn5LZlQtnUbw+ftjG177krbX2gMqtcWur9+pJb831O7/4GErkkMCGabSIsBJXCwh0jvJwG0BGHAKFZo+jjkdgDIElW2IjMlqyTd9b2og/6i3wiQ5QA/RPlV8VQ80ICi2btXa7k5iM/WyDcOOLQBtpMQRRePJIEbR1bhv5VQGMNCZKgnLStyrXI6tWNKU2tZmxUZ2kX73klt40UlsCmm18MTaos/lcyvWY7hcClVvBF72OreJkoNsj/GC5FhM7prhlPJYqstp4PvNJ5/u9rJk/b8WaKnc78Y9qhps5Slzf5FYYRZWTRq2WPIxB1xmcdCs7sM5+h255nbDmkUY4/OFovDE2vqOncv+F6YHmY7s7tf+boCv0X3mkFXdR/wOzRH0cwwVfd6fVqYPznSncGNJo6iG9pPFCtTvc3ZH7UXg7D+bRg2ZRrC8UlfYUcfurI3CN5aUbq1cJnT76PeMZlu2T2NJU5U7OfMyWoo+XFkxPogH8Byoul/9OVH65VDyCdVb06f7V+bbk4GjXBNqmu5u/4/noOf -------------------------------------------------------------------------------- /classes/Repair.php: -------------------------------------------------------------------------------- 1 | rVZRT+M4EH7Pr5iHSk0RNMu+nOiyLHvAnVZqu9XBSUjLqXLtaWJtEke204JW/PcdO0nJkpYDFj80rj3zzTeez5MEQbS3F8Ae/IMFkxqE4rewlCka4CmyXObxPmjM1IpmoDQwIdyMq9xibsnTOZ9yZjFW+g4AZknhQPxywfh3FiOtQsG0QV0Zq+JOyzixAGebacgHMGWaI4OZVqLkXKqcWEzK1MoMhWRwORwPHUB7hIm1xSiK1uv18H0m+JCrbOCjpJJjbqrYFSUYfzm7mF5e+O0VakMR3Pb7d4d/DN8dDQ8Pa8f8e43uwE2NXoO4AGQWBTxlxtTHFvwIAmfvz9KN5gGnjHMku0LLFZ3RZnnFNBir6Sjrpcg/azPaYlZy6M1lTtOcI3yE6b/j8YfXxGFas7utYXrz2ywlaG8RDjroVB+Kr0tunxXuV/BlmXPrjng+5w1MOPAmP4Kmfn5y34l7jk+HLRdU3l+j+qV2UIEvizlhMQFkaBMlnOZtqXO6BaXWJHS4noyfQwZOK8e6uKQP/6+Lsou1VZfes8O6xu3ZRJqDE1e4DzsSuST3FK3KmyxgoyK1BK/bF6VyppHqeYW3drNT6XNbKrVyNxnFaL/U0TspySWEBtPlaNQWeqX0QcvOja4d5Liu75+TbmN4//jEHnvuOra/0VrUzy309vpRtuT/O7V7AxKmItGjMI+JtBjQAfaeIPJZCGCua7NYsyIBqwAZTwBTzJySZU7bli1SBJswS8VAYUBaYLmABdo1IuYNmLdrRAf/ozoXMyOqBbMJ/EWvInCzJzOml9KMvArH9CIr7N2VD3jFYtOpRRQ5c59Z0WR2vB5ZfnIc+ceOwyo0xnONRcpIyf2ocvl2Y/7b+3R8U3lG/X3o11jrUQFRA0nrLbCmz+5k45wW6Qv53NRe2yg1gG9Bqnq8jlT1Zyun6l+H03ZxTpSQS0lfBzZBOP96dj1zWqGLjl4PxhFmKyUFrFgqBfMikcaULxXh+dfJVAl6Ueb0+4rup317ahiGHqYryKydDpFmll4Bi9L6fu3W1sWIvj1mmi5S/JBbodwnmGSp+xpbUnhrHsri7R134y66i3twQt3porq+5k+6IvGUZVQlb9lvddCl0v6qh20QZlqYj5vzw87BCXWfzw3/sC8FlVRTTwiP/NiHo3oMnurZnvCm+vfBTw== -------------------------------------------------------------------------------- /classes/StructureDocx.php: -------------------------------------------------------------------------------- 1 | rZRfa9swFMXf/SnuIFA7MLvJy1jLRiF/WCFtA3nY3oImX8eisWQkOU4o+e6TZDl4dWkfXL04Pjr6Hd+bawdBMh4HMIb50+wPTGE9X5o7K9xRonEn5AkA1nmZCnp0cknoM9mhUUFLwlUmZNH4RXmSbJdrgNnlZ0gjeCSSIoG1FGlFKRMcFTxUe80KTBmBTbyKLaC7wlzr8iZJ6rqOp0VKYyqKyKXsGUWuXHzZPBWs7meLx83CbR9QKpNgt6fXk2/x9fd4MvEH+bOnW7jydA+xAcaWBHRPlIKNlhXVlcS5LfslCOwx1ym7xvBbyPRhBSmWyFPklKFqt+4ORAKRkpwuCqEUDbSU7GB66uXEXb0Go22XddsLXPCUCz08BT2nn7AURpeDA7IG8zb/U0rIWlA/4xeS9BNqyBtMn39fmMkfjGeO0qdvkGozu4P5ynP6CTOjusluhR64+mtesP+5ToKs4o4K2y1tKWHkHC+N36yRzpn6+vMyZfCjef4wuu15/KB8ZPmQ4/+s9yxNw99ztC177Tn3Wvhk3lL3sYwH9FAYiP2yhKOM7XFNdP66kyyD8Ivd3OKRKa06zqhjs0vnUtTAsYbFkWJpA8KrpXGD6R00x686NZ/bys7BPw== -------------------------------------------------------------------------------- /classes/WordFragment.php: -------------------------------------------------------------------------------- 1 | rVdtb9s2EP7uX3EwgtkuYjvJh6JwardDXtYBTlYkKRZgGAJaOltCJFEjKSve0v++44tkybJdt5s+2OS9PHc8Ho/HVmv45k0L3sCFQKZQAoPfufBhLtgixkSB4jBDCBOJQqEPGEnMAxRIOlrto0daCy5WAPA5SH3uvRhyyrxntkCikgpqJGnFeboS4SJQABflsOv14JYJDxl8FtzPPC/kCflyk0UqjNEPGdwPpgMNUP26gVLpaDjM83xwFvvewONxz1iJQg/JYy2UWqdg+uvF1e39lWEvUUiyoNlnJ6fvBieng7O3TjF5dugaXDp0B6INkNiw5UVMShOo6yJO+KIw8aWL46WOwz8tjWPiq7/iDz4yz0PST7MZOVpSl0yAVCJMFo40NP9WCo5ysnYzPW9tgFIYE9LKPLVpJWWCxRV/4MjuTo1tDcKRYmKBCkgiM8vp+jhnFH5YsijD3jG4+SdkPopjmIdClhNcYlKMndw156qUKyZarmTQf0JDoia+HVB0te29YarFZJ4lntIb+fTkFVHomlXCGG6/TKfH5cLG0CnW1ukZDLs7+jtSQSj7ExtgLdk53+SVKA5vLRDOwZmkM6JY4iGfV4P++gp72NeCxw8YpxHNexWXKqaf/g7TS7skA7SmnG8Vp0hQJqqHVYoPFZ0qebuiXv8dne9LFyc9riJs5e+GunYb3MBYMw5Q3uZEnbkb5MomVkO/pH9bdZv5Gm83xIXN5oZ6Sf+26jbrNd5uiNssnqE+2lr/pyrAmrNb+16tIhu3mqoj79FDpQi54XRJX6t+bdnfzXJ2idur2fcUA99hdDdP+g6bN2xBADGqgPvHIFBlIpHgZULoUvh4Mz2sgFvFoqTe2VkTZZfXit8bzYbXDrdWps53LOVn39d3uBdkdJFRqREsN/fUoWuo3wo+U2yv18z371huDXSN+P7iOhhb0F3u/0KJggJskf3xFCDlBwPxjVhWi3nTmSIReBKtQAUIItOzObhaSneYAKTT5PvrS/v/jW+YUEeCLr6N0CYsRkmdFrVKdGu9xFEiR0sct11fJL0AYyYHPMWEmORtzBRNxWIYM/GcpX26cVOmwlkYhWo1PDs5edsGC8PHbVr7yEH049ATXPK50iojPp9Tg+X+Cg1xiF2rUtwgxuJQIN1+tFgZhKks0OIfRSNmUIAs9y1iGUeFXJ4eYs2ns0S7FkfWkM7oVHC9yUS9tMwS8fTkgABqiFLjEBfqNgtPYhYmJUzS3P/Stu5fXdAM1HohOhbVrmfdC73/QMDgOuZx+3Rw0qaOzeM65cftLw/X/Xdt0J2NzyKuja+QNvHD5H0+EnRPQwcGtUQdQGdiaM1qVrdcjEjh/dCCTZouXphCN4YEc7j87abIhW6vIslTnV5XiaIkn3LdppJCFM5oYU9+KNkswic03KfIsLt0e2Bvu63+RMs86nJnqRW5vZhb3GiaeKTjGKyX8/iZpt2q+R0q/YnARSipdt4Woe528s4xdP5LUnW+x1p8mLVdZ7Zm668M6UVJ2TfUO/8HtVtd3TpLxcVolI8CamKFeapRAV4zliNFr7AZf6mT89E88u9DarKx9ye8gsZcI9j5jPNnXRPv6UZQGzTq9xzFPVDuWLLAqmSVXkjTIb/Re2klSg9qGSxuuW9qdz24ZvVdG4RqVGYR954vImQJPcTrzxSKMDIvoKdIAcokHTsaNV4VmninbepBf8KpYohiO/oTyZZoktvobnR6NQcGDuJus6fTX3HNVjXKa/Zr618= -------------------------------------------------------------------------------- /classes/WordML.php: -------------------------------------------------------------------------------- 1 | rVZtb+I4EP7OrxihSoRqSaAf9m5pYStBT1qJchXd1fUbMs5AoiZ2znZI0Wr/+42dl8JReuh2+RK/zDzPM+PxmFYruLxswSX8JVV4P6ORndxyZnAj1Q4AHqIslPzFLWeMP7MN0ipggikKo0tzme1UvIkMwKQZerwLc6Y4MnhQMsw5j6VADfd5YuIUw5jBoz/zLcD+z4uMyYZBUBSFf5WG3Ocy7TqWJOYotGPPSlEw+zK5mz/eue0tKk0MdvuqP/jN73/yB4PKUTxX6BZcV+gViCUgs6DFE6Z1lQjAF4Mi1DBRSLm4K6NtfW+1LIrLmf3VH7hlnCN5Zyrekn2zvGUKtFGx2FRLgftWZnCxLBzd9S/G1YaZmBN8LGgoOMII5t9mxzx0XmShcm5OEecryvshiVuCdS64sQlfLnkN4nWdxfdWfZoXJop1b7wMcZVvSMTUfofDDZovlTKve+2sfxxJm+LPKwvxhLATnPdsQwApmkiGH0ChyZXQwHOl6Pjhyd6Q/xYDt6VjdUKwKGfHKKdUG/noPI9UV7h1VuvieTuWsnRBsaK53edoz5hiaS39ImSGvauWO5YFK0oOz3mcKoNSMNWBV+J3S4JTESyq/EuR7MBEFEtuZ2uggjM2lWupANMVhuHrTfi14cWCugdWsR2FVcYziXJqMCMQWMD0z/up5LntFnVlO0vBUtTUP6kBjqDzkiZCD7c4alfdTvMIU6Z9maGgTYorZYamahOkTD3nWY+6VEaXehUnsdkFV/3+xzaUMHLUpiwNK4heGnMltVwb6zKU6zW1zepTe6hzeEuXOhjHGChMmE2LjuJM12jp/0WjzagG2b4XxDZNarsiO4ctpKKn802TksgeU6akLQdanZabDeKgf0YCLUTjcY6EQ85aScpi0cCI4/NvuO2rVCXNQb0GYnPRuf53DdqquvlMwFC9g6P2wO+3AQWX9nKM2t++/tH7vW2fBhGyRFryHdIhfh7fFEMlpYEO+AeF6kNn7NbeaDeH1PWIPG6CEm28r1FmtmruhKHanUkWoiKnJF6R3mUYa7ZKcIlud5m4bY+6NnaPqNxN642tzZPtNeXqnt27mG/IOKZ4olsWvV7mpweaevv0J1x6Y4WbWBtU8zqDXqfofIDOz9RKZ5/t7xzpLxkddGBzfFADai5D11oOJTkPr3TcR1olkj9PEmQCQwu4h0W6kPEIvAaUaaoKGnX3Ol/Z02hxYTntoDeWVNCqvuG9sWZbdIfkfK8PXQ8E+BXE4tWoegvsr37z9l2aB+NH6x8= -------------------------------------------------------------------------------- /classes/WordMLFragment.php: -------------------------------------------------------------------------------- 1 | rVZRb+I4EH7nV4xQJUK1BNqHvTta2J7arrQSdKv2VlfpdELGHkjUxM7ZDina2/++YyehYSkVd11ekoxnvu+b8XhMq9U/Pm7BMVxqZBYNMPhTaTGdwEKzZYrSglUwR4ilQW1RACYGiwg1UpQLvOAUt1R6DQC3USYUf/LmjPFHtkSyUgg6JFO6q2yt42VkAS43rwHvwg3THBncaiVyzmMlSc00T2ycoogZ3IeT0AE0f0FkbTbs94uiCE9TwUOu0q5nSWKOpNg5ZaUomHy6vL65v/bLK9SGGNzy6eDkl3DwW3hyUgXKxwrdgZsKvQJxBOTWb/GEGVOV6mNdKXyyKIWpanldZt362mo5NF9n96sfcME4R0LJdLwi/415xTQYq2O5rEx9/6zc4GhWeNqzn4xrLLMxJ3jaasskRxjBzZfJLg/tG3nonNt9xPmc6r9N4k2wyCW3rvCzGa9Bgq73+Nqqd/XIRrHpjWcC5/mSRFy553C4RPupUhZ0z7z3tx1pV/h2ZQL3CNvDOWVLAkjRRkq8A40219IAz7V2TfEwnRwiBi7KwGqH4K782kXZp9qqex+5o7rCrataN8/LufwuhJsBPMrpGKgFaFZUXX5YEhnTLK1zOBLMsldlMyHuWFESBN59XzOUsiEclaj79NfVVzJZg40QdO6+FkDtZl0hF0oDpnMU4vkc/NycYkkzBKucdtIp87j09R2BxAKuPk+vFM/drKj72ntKlqKhKUpjcASdpzSRZrjCUbuaeYZHmDITqgwlLVJeKbP0qZf9lOnHPOvRrMroSM/jJLbr/ulg8L4NJYwatalKwwqil8ZcK6MW1oUM1WJBw7N61BH6EN4ypE7GM/Y1JsyVxURxZmq09P+i0WJUg6xeS2KVJrVfkR3CJqjTaX/TpCRy25Rp5dqBrFfl4gbxZHBAAR3EJuIQCductZKUxXIDI3f3f8Pt7qaqaB7qORFXi87Zjz3ouur8AwFDdRuO2ifhoA0ouXKHY9T+8sfH3q9tdzFIwRLlyNdIm/hhfF4MtVIWOhBuNWoInbG3vTBstqnrN4o475do46ZGlbmuuZaWeneimEBNQUk8J70zERs2T3CGfnWW+OWAZjZ2d6j8SeuNnc+DmzGlteH3KuYLMnYpHuiURc+H+eGWPoMm/Z6Q3ljjMjYW9U1dwaBTdN5B5y290vkvbOnb2Gy0xfZPjvQ3kNqq73b0L6ls4G5rY5UeDothtM5Qu/9X3b/hX3A+G0v1PVfq0Q2ve8u0/cF2LUVloT53E+GOySU2PZv22ptO49TJbNZE3yjhh+p2ebz6oEyimdU8UfzxMkEm6d8vJdfAohoh4xEEG1Bm6DzQW7cx88tpTsY7x+leemNFR1nXs603NmyFvj197Nl26JaAsIK4e3aqbkH3q+/6ZsjmqvzW+g4= -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lpkapil/phpdocx", 3 | "description": "phpdocx free", 4 | "type": "library" 5 | } 6 | -------------------------------------------------------------------------------- /config/phpdocxconfig.ini: -------------------------------------------------------------------------------- 1 | [settings] 2 | ; absolute path to the temp dir. If empty the default system tmp directory will be used 3 | temp_path = "" 4 | 5 | ; if set to true: detects if the contents are UTF-8 encoded and if not encodes them 6 | ; if set to false do nothing 7 | encode_to_UTF8 = "false" 8 | 9 | ; default document language 10 | language = "en-US" 11 | 12 | ; default paper size 13 | paper_size = "A4" 14 | 15 | ; right to left languages config 16 | ;bidi = "true" 17 | ;rtl = "true" 18 | 19 | ; if true, generate the DOCX as stream instead of saving if to the file system. Only available for Premium licenses 20 | ;stream="true" 21 | 22 | [license] 23 | ; PHPDocX license code 24 | code = "" 25 | ; subdomain (Basic license), domain (Advanced license) or IP (Premium license) 26 | value = "" 27 | 28 | [transform] 29 | ; transform options. Only available for Advanced and Premium licenses. OpenOffice by default 30 | 31 | ; libreoffice or openoffice 32 | ;method = "libreoffice" 33 | 34 | ; libreoffice installation path, absolute path 35 | ;path = "/opt/libreoffice/program/soffice" -------------------------------------------------------------------------------- /examples/Core/addBookmark/sample_1.php: -------------------------------------------------------------------------------- 1 | addBookmark(array('type' => 'start', 'name' => 'bookmark_name')); 8 | $docx->addText('Text that has been bookmarked.'); 9 | $docx->addBookmark(array('type' => 'end', 'name' => 'bookmark_name')); 10 | 11 | $docx->createDocx('example_addBookmark_1'); -------------------------------------------------------------------------------- /examples/Core/addBookmark/sample_2.php: -------------------------------------------------------------------------------- 1 | addBookmark(array('type' => 'start', 'name' => 'bookmark_name')); 9 | $bookmarkEnd = new WordFragment($docx); 10 | $bookmarkEnd->addBookmark(array('type' => 'end', 'name' => 'bookmark_name')); 11 | 12 | $textRuns = array(); 13 | $textRuns[] = array('text' => 'We are only going to bookmark: '); 14 | $textRuns[] = $bookmarkStart; 15 | $textRuns[] = array('text' => 'this words.'); 16 | $textRuns[] = $bookmarkEnd; 17 | 18 | $docx->addText($textRuns); 19 | 20 | $docx->createDocx('example_addBookmark_2'); -------------------------------------------------------------------------------- /examples/Core/addBreak/sample_1.php: -------------------------------------------------------------------------------- 1 | addText($text); 14 | 15 | $docx->addText($text); 16 | 17 | $docx->addBreak(array('type' => 'line')); 18 | 19 | $docx->addText($text); 20 | 21 | $docx->addBreak(array('type' => 'line', 'number' => 2)); 22 | 23 | $docx->addText($text); 24 | 25 | $docx->addBreak(array('type' => 'page')); 26 | 27 | $docx->addText($text); 28 | 29 | $docx->createDocx('example_addBreak_1'); -------------------------------------------------------------------------------- /examples/Core/addBreak/sample_2.php: -------------------------------------------------------------------------------- 1 | addBreak(); 16 | 17 | $runs = array(); 18 | $runs[] = array('text' => $text_1); 19 | $runs[] = $break; 20 | $runs[] = array('text' => $text_2); 21 | 22 | $docx->addText($runs); 23 | 24 | $docx->createDocx('example_addBreak_2'); 25 | -------------------------------------------------------------------------------- /examples/Core/addChart/sample_10.php: -------------------------------------------------------------------------------- 1 | addText('We will now add a dot scattered chart to the Word document:'); 8 | 9 | $data = array( 10 | 'data' => array( 11 | array( 12 | 'values' => array(10, 0), 13 | ), 14 | array( 15 | 'values' => array(17, 2), 16 | ), 17 | array( 18 | 'values' => array(18, 4), 19 | ), 20 | array( 21 | 'values' => array(25, 6), 22 | ), 23 | ), 24 | ); 25 | 26 | $paramsChart = array( 27 | 'data' => $data, 28 | 'type' => 'scatterChart', 29 | 'border' => 0, 30 | 'color' => 5, 31 | 'jc' => 'center', 32 | 'legendPos' => 'r', 33 | 'legendOverlay' => true, 34 | 'haxLabel' => 'vertical label', 35 | 'vaxLabel' => 'horizontal label', 36 | 'haxLabelDisplay' => 'horizontal', 37 | 'vaxLabelDisplay' => 'rotated', 38 | 'hgrid' => 2, 39 | 'vgrid' => 2, 40 | 'symbol' => 'dot',//dot, line 41 | 'showTable' => true 42 | ); 43 | $docx->addChart($paramsChart); 44 | 45 | $docx->createDocx('example_addChart_10'); -------------------------------------------------------------------------------- /examples/Core/addChart/sample_11.php: -------------------------------------------------------------------------------- 1 | addText('We will now add a surface chart to the Word document:'); 8 | 9 | $data = array( 10 | 'legend' => array('Series 1', 'Series 2', 'Series 3'), 11 | 'data' => array( 12 | array( 13 | 'name' => 'Value1', 14 | 'values' => array(4.3, 2.4, 2), 15 | ), 16 | array( 17 | 'name' => 'Value2', 18 | 'values' => array(2.5, 4.4, 2), 19 | ), 20 | array( 21 | 'name' => 'Value3', 22 | 'values' => array(3.5, 1.8, 3), 23 | ), 24 | array( 25 | 'name' => 'Value4', 26 | 'values' => array(4.5, 2.8, 5), 27 | ), 28 | array( 29 | 'name' => 'Value5', 30 | 'values' => array(5, 2, 3), 31 | ), 32 | ), 33 | ); 34 | 35 | $paramsChart = array( 36 | 'data' => $data, 37 | 'type' => 'surfaceChart', 38 | 'legendpos' => 't', 39 | 'legendoverlay' => false, 40 | 'sizeX' => 12, 41 | 'sizeY' => 8, 42 | 'chartAlign' => 'center', 43 | 'color' => 2, 44 | ); 45 | $docx->addChart($paramsChart); 46 | 47 | $docx->createDocx('example_addChart_11'); -------------------------------------------------------------------------------- /examples/Core/addChart/sample_12.php: -------------------------------------------------------------------------------- 1 | addText('We will now add a 3D pie chart with a title styled to the Word document:'); 8 | 9 | $data = array( 10 | 'data' => array( 11 | array( 12 | 'name' => 'data 1', 13 | 'values' => array(10), 14 | ), 15 | array( 16 | 'name' => 'data 2', 17 | 'values' => array(20), 18 | ), 19 | array( 20 | 'name' => 'data 3', 21 | 'values' => array(50), 22 | ), 23 | array( 24 | 'name' => 'data 4', 25 | 'values' => array(25), 26 | ), 27 | ), 28 | ); 29 | 30 | $paramsChart = array( 31 | 'data' => $data, 32 | 'title' => 'My title', 33 | 'type' => 'pie3DChart', 34 | 'perspective' => 30, 35 | 'color' => 2, 36 | 'sizeX' => 10, 37 | 'sizeY' => 5, 38 | 'chartAlign' => 'center', 39 | 'showPercent' => 1, 40 | 'vgrid' => 0, 41 | 'legendPos' => 'r', 42 | 'font' => 'Arial', 43 | 'stylesTitle' => array( 44 | 'bold' => true, 45 | 'color' => 'ff0000', 46 | 'font' => 'Times New Roman', 47 | 'fontSize' => 3600, 48 | 'italic' => true, 49 | ), 50 | ); 51 | $docx->addChart($paramsChart); 52 | 53 | $docx->createDocx('example_addChart_12'); -------------------------------------------------------------------------------- /examples/Core/addChart/sample_13.php: -------------------------------------------------------------------------------- 1 | addText('We will now add a line chart with trendlines to the Word document:'); 8 | 9 | $data = array( 10 | 'legend' => array('Series 1', 'Series 2', 'Series 3'), 11 | 'trendline' => array( 12 | array( 13 | 'color' => '0000ff', 14 | 'type' => 'log', 15 | 'display_equation' => true, 16 | 'display_rSquared' => true, 17 | ), 18 | array(), 19 | array( 20 | 'color' => '0000ff', 21 | 'type' => 'power', 22 | 'line_style' => 'dot', 23 | ), 24 | ), 25 | 'data' => array( 26 | array( 27 | 'name' => 'data 1', 28 | 'values' => array(10, 7, 5), 29 | 30 | ), 31 | array( 32 | 'name' => 'data 2', 33 | 'values' => array(20, 60, 3), 34 | 35 | ), 36 | array( 37 | 'name' => 'data 3', 38 | 'values' => array(50, 33, 7), 39 | ), 40 | array( 41 | 'name' => 'data 4', 42 | 'values' => array(25, 0, 14), 43 | ), 44 | ), 45 | ); 46 | 47 | $paramsChart = array( 48 | 'data' => $data, 49 | 'type' => 'lineChart', 50 | 'color' => '5', 51 | 'chartAlign' => 'center', 52 | 'showTable' => 0, 53 | 'sizeX' => '12', 54 | 'sizeY' => '10', 55 | 'legendPos' => 'b', 56 | 'legendOverlay' => '0', 57 | 'haxLabel' => 'X Axis', 58 | 'vaxLabel' => 'Y Axis', 59 | 'haxLabelDisplay' => 'horizontal', 60 | 'vaxLabelDisplay' => 'vertical', 61 | 'vgrid' => 0, 62 | 'hgrid' => 0, 63 | ); 64 | $docx->addChart($paramsChart); 65 | 66 | $docx->createDocx('example_addChart_13'); -------------------------------------------------------------------------------- /examples/Core/addChart/sample_15.php: -------------------------------------------------------------------------------- 1 | addText('We will now add a chart from a XLSX:'); 8 | 9 | $paramsChart = array( 10 | 'externalXLSX' => array( 11 | 'src' => '../../files/Book.xlsx', 12 | ), 13 | 'sizeX' => 10, 14 | 'sizeY' => 5, 15 | ); 16 | $docx->addChart($paramsChart); 17 | 18 | $docx->createDocx('example_addChart_15'); -------------------------------------------------------------------------------- /examples/Core/addChart/sample_16.php: -------------------------------------------------------------------------------- 1 | addText('Add a chart in 2D with a color scheme, the table data and a number format:'); 8 | 9 | $data = array( 10 | 'legend' => array('Legend 1', 'Legend 2', 'Legend 3'), 11 | 'data' => array( 12 | array( 13 | 'name' => 'data 1', 14 | 'values' => array(10, 20, 5), 15 | ), 16 | array( 17 | 'name' => 'data 2', 18 | 'values' => array(20, 60, 3), 19 | ), 20 | array( 21 | 'name' => 'data 3', 22 | 'values' => array(50, 33, 7), 23 | ), 24 | ), 25 | ); 26 | $paramsChart = array( 27 | 'data' => $data, 28 | 'type' => 'barChart', 29 | 'color' => 5, 30 | 'sizeX' => 15, 31 | 'sizeY' => 10, 32 | 'chartAlign' => 'center', 33 | 'legendPos' => 'none', 34 | 'legendOverlay' => '0', 35 | 'border' => '1', 36 | 'hgrid' => '1', 37 | 'vgrid' => '0', 38 | 'showTable' => '1', 39 | 'formatCode' => '#,##0.00', 40 | ); 41 | $docx->addChart($paramsChart); 42 | 43 | $docx->createDocx('example_addChart_16'); -------------------------------------------------------------------------------- /examples/Core/addChart/sample_8.php: -------------------------------------------------------------------------------- 1 | addText('We will now add a bubble chart to the Word document:'); 8 | 9 | $data = array( 10 | 'legend' => array('', 'values', ''), 11 | 'data' => array( 12 | array( 13 | 'name' => 'data 1', 14 | 'values' => array(10, 8, 6), 15 | ), 16 | array( 17 | 'name' => 'data 2', 18 | 'values' => array(15, 2, 2), 19 | ), 20 | array( 21 | 'name' => 'data 3', 22 | 'values' => array(20, 10, 5), 23 | ), 24 | array( 25 | 'name' => 'data 4', 26 | 'values' => array(25, 6, 4), 27 | ), 28 | ), 29 | ); 30 | 31 | $paramsChart = array( 32 | 'data' => $data, 33 | 'type' => 'bubbleChart', 34 | 'legendPos' => 't', 35 | 'color' => 28, 36 | 'chartAlign' => 'center', 37 | 'sizeX' => '13', 38 | 'sizeY' => '8', 39 | 'showtable' => 1, 40 | 'hgrid' => '1', 41 | 'vgrid' => '1', 42 | 'showValue' => true, 43 | 'showCategory' => true, 44 | ); 45 | $docx->addChart($paramsChart); 46 | 47 | $docx->createDocx('example_addChart_8'); -------------------------------------------------------------------------------- /examples/Core/addChart/sample_9.php: -------------------------------------------------------------------------------- 1 | addText('We will now add a doughnut chart to the Word document:'); 8 | 9 | $data = array( 10 | 'data' => array( 11 | array( 12 | 'name' => 'data 1', 13 | 'values' => array(20), 14 | ), 15 | array( 16 | 'name' => 'data 2', 17 | 'values' => array(20), 18 | ), 19 | array( 20 | 'name' => 'data 3', 21 | 'values' => array(50), 22 | ), 23 | array( 24 | 'name' => 'data 4', 25 | 'values' => array(25), 26 | ), 27 | array( 28 | 'name' => 'data 5', 29 | 'values' => array(5), 30 | ), 31 | ), 32 | ); 33 | 34 | $paramsChart = array( 35 | 'data' => $data, 36 | 'type' => 'doughnutChart', 37 | 'showPercent' => true, 38 | 'explosion' => 10, 39 | 'holeSize' => 25, 40 | 'sizeX' => 12, 41 | 'sizeY' => 10, 42 | 'chartAlign' => 'center', 43 | 'color' => '2', 44 | 'legendPos' => 'r', 45 | 'legendOverlay' => true, 46 | 'showTable' => true, 47 | ); 48 | $docx->addChart($paramsChart); 49 | 50 | $docx->createDocx('example_addChart_9'); -------------------------------------------------------------------------------- /examples/Core/addComment/sample_1.php: -------------------------------------------------------------------------------- 1 | addComment( 10 | array( 11 | 'textDocument' => 'comment', 12 | 'textComment' => 'The comment we want to insert.', 13 | 'initials' => 'PT', 14 | 'author' => 'PHPDocX Team', 15 | 'date' => '10 September 2000' 16 | ) 17 | ); 18 | 19 | $text = array(); 20 | $text[] = array('text' => 'Here comes the '); 21 | $text[] = $comment; 22 | $text[] = array('text' => ' and some other text.'); 23 | 24 | $docx->addText($text); 25 | 26 | $docx->createDocx('example_addComment_1'); -------------------------------------------------------------------------------- /examples/Core/addComment/sample_2.php: -------------------------------------------------------------------------------- 1 | This is some HTML code with a link to 2mdc.com and a random image: 12 |

'; 13 | 14 | $html->embedHTML($htmlCode, array('downloadImages' => true)); 15 | 16 | $comment->addComment( 17 | array( 18 | 'textDocument' => 'comment', 19 | 'textComment' => $html, 20 | 'initials' => 'PT', 21 | 'author' => 'PHPDocX Team', 22 | 'date' => '10 September 2000' 23 | ) 24 | ); 25 | 26 | $text = array(); 27 | $text[] = array('text' => 'Here comes the '); 28 | $text[] = $comment; 29 | $text[] = array('text' => ' and some other text.'); 30 | 31 | $docx->addText($text); 32 | 33 | $docx->createDocx('example_addComment_2'); 34 | 35 | -------------------------------------------------------------------------------- /examples/Core/addCrossReference/sample_1.php: -------------------------------------------------------------------------------- 1 | addBookmark(array('type' => 'start', 'name' => 'bookmark_name')); 8 | $docx->addText('Text that has been bookmarked.'); 9 | $docx->addBookmark(array('type' => 'end', 'name' => 'bookmark_name')); 10 | 11 | $docx->addBreak(array('type' => 'page')); 12 | 13 | $docx->addCrossReference('Page-1', array('type' => 'bookmark', 'referenceName'=> 'bookmark_name')); 14 | 15 | $docx->createDocx('example_addCrossReference_1'); -------------------------------------------------------------------------------- /examples/Core/addDateAndHour/sample_1.php: -------------------------------------------------------------------------------- 1 | true, 10 | 'fontSize' => 12, 11 | 'color' => 'b70000', 12 | 'dateFormat' => 'dd/MM/yyyy H:mm:ss', 13 | ); 14 | $date = new WordFragment($docx); 15 | 16 | $date->addDateAndHour($options_1); 17 | 18 | $docx->addHeader(array('default' => $date)); 19 | 20 | $docx->addText('Let us include now different examples of the addDateAndHour with different date formatting:'); 21 | 22 | $options_2 = array( 23 | 'textAlign' => 'center', 24 | 'bold' => true, 25 | 'fontSize' => 14, 26 | 'color' => '333333', 27 | 'dateFormat' => "dd' of 'MMMM' of 'yyyy' at 'H:mm" 28 | ); 29 | 30 | $docx->addDateAndHour($options_2); 31 | 32 | $options_3 = array( 33 | 'bold' => true, 34 | 'fontSize' => 11, 35 | 'color' => '0000FF', 36 | 'dateFormat' => "MM'-'dd'-'yy" 37 | ); 38 | 39 | $docx->addDateAndHour($options_3); 40 | 41 | $docx->createDocx('example_addDateAndHour_1'); -------------------------------------------------------------------------------- /examples/Core/addDateAndHour/sample_2.php: -------------------------------------------------------------------------------- 1 | true, 10 | 'color' => 'b70000', 11 | 'dateFormat' => "dd' of 'MMMM' of 'yyyy", 12 | ); 13 | 14 | $date = new WordFragment($docx); 15 | $date->addDateAndHour($dateOptions); 16 | 17 | $text = array(); 18 | $text[] = array('text' => 'Today is the '); 19 | $text[] = $date; 20 | $text[] = array('text' => ' and it is a beautiful day.'); 21 | 22 | $docx->addText($text); 23 | 24 | $docx->createDocx('example_addDateAndHour_2'); -------------------------------------------------------------------------------- /examples/Core/addEndnote/sample_1.php: -------------------------------------------------------------------------------- 1 | addEndnote( 10 | array( 11 | 'textDocument' => 'endnote', 12 | 'textEndnote' => 'The endnote we want to insert.', 13 | ) 14 | ); 15 | 16 | $text = array(); 17 | $text[] = array('text' => 'Here comes the '); 18 | $text[] = $endnote; 19 | $text[] = array('text' => ' and some other text.'); 20 | 21 | $docx->addText($text); 22 | $docx->addText('Some other text.'); 23 | 24 | $docx->createDocx('example_addEndnote_1'); -------------------------------------------------------------------------------- /examples/Core/addEndnote/sample_2.php: -------------------------------------------------------------------------------- 1 | This is some HTML code with a link to 2mdc.com and a random image: 12 |

'; 13 | 14 | $html->embedHTML($htmlCode, array('downloadImages' => true)); 15 | 16 | $endnote->addEndnote( 17 | array( 18 | 'textDocument' => 'endnote', 19 | 'textEndnote' => $html, 20 | 'endnoteMark' => array('customMark' => '*') 21 | ) 22 | ); 23 | 24 | $text = array(); 25 | $text[] = array('text' => 'Here comes the '); 26 | $text[] = $endnote; 27 | $text[] = array('text' => ' and some other text.'); 28 | 29 | $docx->addText($text); 30 | $docx->addText('Some other text.'); 31 | 32 | $docx->createDocx('example_addEndnote_2'); -------------------------------------------------------------------------------- /examples/Core/addExternalFile/sample_1.php: -------------------------------------------------------------------------------- 1 | addText('We are going to insert now a full Word document. Beware that this method is not compatible with legacy versions of Word running the docx compatibility pack.'); 8 | $docx->addExternalFile(array('src' => '../../files/Text.docx')); 9 | $docx->addText('A new paragraph.'); 10 | 11 | $docx->createDocx('example_addDOCX'); -------------------------------------------------------------------------------- /examples/Core/addExternalFile/sample_2.php: -------------------------------------------------------------------------------- 1 | addText('We are going to insert now a full MHT document. Beware that this method is not compatible with legacy versions of Word running the docx compatibility pack.'); 8 | $docx->addExternalFile(array('src' => '../../files/Test.mht')); 9 | $docx->addText('A new paragraph.'); 10 | 11 | $docx->createDocx('example_addMHT'); -------------------------------------------------------------------------------- /examples/Core/addExternalFile/sample_3.php: -------------------------------------------------------------------------------- 1 | addText('We are going to insert now a RTF document. Beware that this method is not compatible with legacy versions of Word running the docx compatibility pack.'); 8 | $docx->addExternalFile(array('src' => '../../files/Test.rtf')); 9 | $docx->addText('A new paragraph.'); 10 | 11 | $docx->createDocx('example_addRTF'); -------------------------------------------------------------------------------- /examples/Core/addFootnote/sample_1.php: -------------------------------------------------------------------------------- 1 | addFootnote( 10 | array( 11 | 'textDocument' => 'footnote', 12 | 'textFootnote' => 'The footnote we want to insert.', 13 | ) 14 | ); 15 | 16 | $text = array(); 17 | $text[] = array('text' => 'Here comes the '); 18 | $text[] = $footnote; 19 | $text[] = array('text' => ' and some other text.'); 20 | 21 | $docx->addText($text); 22 | $docx->addText('Some other text.'); 23 | 24 | $docx->createDocx('example_addFootnote_1'); -------------------------------------------------------------------------------- /examples/Core/addFootnote/sample_2.php: -------------------------------------------------------------------------------- 1 | This is some HTML code with a link to 2mdc.com and a random image: 12 |

'; 13 | 14 | $html->embedHTML($htmlCode, array('downloadImages' => true)); 15 | 16 | 17 | $footnote->addFootnote( 18 | array( 19 | 'textDocument' => 'footnote', 20 | 'textFootnote' => $html, 21 | 'footnoteMark' => array('customMark' => '*') 22 | ) 23 | ); 24 | 25 | 26 | $text = array(); 27 | $text[] = array('text' => 'Here comes the '); 28 | $text[] = $footnote; 29 | $text[] = array('text' => ' and some other text.'); 30 | 31 | $docx->addText($text); 32 | $docx->addText('Some other text.'); 33 | 34 | $docx->createDocx('example_addFootnote_2'); -------------------------------------------------------------------------------- /examples/Core/addFormElement/sample_1.php: -------------------------------------------------------------------------------- 1 | 12, 9 | 'italic' => true, 10 | 'color' => '0000CC', 11 | 'bold' => true, 12 | 'font' => 'Arial', 13 | 'defaultValue' => 'This is a test'); 14 | $docx->addFormElement('textfield', $textFieldOptions); 15 | // add a Checkbox 16 | $checkboxOptions = array('fontSize' => 12, 'defaultValue' => true); 17 | $docx->addFormElement('checkbox', $checkboxOptions); 18 | // add a Select 19 | $selectOptions = array('selectOptions' => array('One', 'Two (selected)', 'Three', 'Four'), 20 | 'fontSize' => 14, 21 | 'color' => 'C90000', 22 | 'bold' => true, 23 | 'underline' => 'double', 24 | 'font' => 'Algerian', 25 | 'defaultValue' => 1);//0-based array 26 | $docx->addFormElement('select', $selectOptions); 27 | 28 | $docx->createDocx('example_addFormElement_1'); -------------------------------------------------------------------------------- /examples/Core/addHeading/sample_1.php: -------------------------------------------------------------------------------- 1 | addHeading('First level title', 0); 8 | 9 | $text = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, ' . 10 | 'sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.'; 11 | $docx->addText($text); 12 | 13 | $docx->addHeading('Second level title', 1); 14 | $docx->addText($text); 15 | 16 | $options = array( 17 | 'color' => 'FF0000', 18 | 'textAlign' => 'center', 19 | 'fontSize' => 13 20 | ); 21 | 22 | $docx->addHeading('Third level title with additional custom formatting', 2, $options); 23 | $docx->addText($text); 24 | 25 | $docx->createDocx('example_addHeading_1'); -------------------------------------------------------------------------------- /examples/Core/addImage/sample_1.php: -------------------------------------------------------------------------------- 1 | addText('In this first example we just add an image with a dashed border:'); 8 | $options = array( 9 | 'src' => '../../img/image.png', 10 | 'imageAlign' => 'center', 11 | 'scaling' => 50, 12 | 'spacingTop' => 10, 13 | 'spacingBottom' => 0, 14 | 'spacingLeft' => 0, 15 | 'spacingRight' => 20, 16 | 'textWrap' => 0, 17 | 'borderStyle' => 'lgDash', 18 | 'borderWidth' => 6, 19 | 'borderColor' => 'FF0000', 20 | 'caption' => array('show_label' => true, 'text' => ' Sample Image') 21 | ); 22 | 23 | $docx->addImage($options); 24 | 25 | $docx->addText('This is a closing paragraph.'); 26 | 27 | $docx->createDocx('example_addImage_1'); -------------------------------------------------------------------------------- /examples/Core/addImage/sample_2.php: -------------------------------------------------------------------------------- 1 | '../../img/image.png', 9 | 'scaling' => 40, 10 | 'spacingTop' => 0, 11 | 'spacingBottom' => 0, 12 | 'spacingLeft' => 0, 13 | 'spacingRight' => 20, 14 | 'textWrap' => 1, 15 | ); 16 | 17 | $docx->addImage($options); 18 | 19 | $text = 'There is more than one way to make that the text wraps around an image. '; 20 | $text .= 'Maybe the simplest is the one used here with the option textWrap = 1. '; 21 | $text.= 'You may also placed it on the right using the float option.'; 22 | 23 | 24 | $docx->addText($text); 25 | 26 | $docx->addBreak(array('type' => 'line')); 27 | 28 | $text = 'Although you can have a little more control using Word fragments. '; 29 | $text .= 'This si so because in the first example the image is in a paragraph of its own '; 30 | $text.= 'while here it is inserted in the same paragraph as this text.'; 31 | 32 | $image = new WordFragment($docx); 33 | $options = array( 34 | 'src' => '../../img/image.png', 35 | 'scaling' => 40, 36 | 'spacingTop' => 0, 37 | 'spacingBottom' => 0, 38 | 'spacingLeft' => 20, 39 | 'spacingRight' => 0, 40 | 'textWrap' => 1, 41 | 'float' => 'right', 42 | ); 43 | $image->addImage($options); 44 | 45 | $runs = array(); 46 | $runs[] = $image; 47 | $runs[] = array('text' => $text); 48 | $docx->addText($runs); 49 | 50 | $docx->createDocx('example_addImage_2'); -------------------------------------------------------------------------------- /examples/Core/addImage/sample_3.php: -------------------------------------------------------------------------------- 1 | '../../img/image.png', 9 | 'scaling' => 50, 10 | 'spacingTop' => 10, 11 | 'spacingBottom' => 0, 12 | 'spacingLeft' => 0, 13 | 'spacingRight' => 20, 14 | 'hyperlink' => 'http://www.google.es', 15 | ); 16 | 17 | $docx->addImage($options); 18 | 19 | $docx->createDocx('example_addImage_3'); -------------------------------------------------------------------------------- /examples/Core/addImage/sample_4.php: -------------------------------------------------------------------------------- 1 | 'https://www.phpdocx.com/img/logo_badge.png', 9 | 'imageAlign' => 'center', 10 | 'streamMode' => true, 11 | ); 12 | 13 | $docx->addImage($options); 14 | 15 | $docx->createDocx('example_addImage_4'); -------------------------------------------------------------------------------- /examples/Core/addImage/sample_5.php: -------------------------------------------------------------------------------- 1 | addText('Image with relativeToHorizontal and relativeToVertical values.'); 8 | 9 | $options = array( 10 | 'src' => '../../img/image.png', 11 | 'scaling' => 50, 12 | 'relativeToHorizontal' => 'page', 13 | 'relativeToVertical' => 'page', 14 | 'textWrap' => 2, 15 | 'float' => 'right', 16 | 'verticalAlign' => 'top', 17 | ); 18 | 19 | $docx->addImage($options); 20 | 21 | $docx->createDocx('example_addImage_5'); -------------------------------------------------------------------------------- /examples/Core/addLink/sample_1.php: -------------------------------------------------------------------------------- 1 | addLink('Link to Google', array('url'=> 'http://www.google.es')); 8 | 9 | $docx->addText('And now the same link with some additional formatting:'); 10 | 11 | $linkOptions = array('url'=> 'http://www.google.es', 12 | 'color' => 'B70000', 13 | 'underline' => 'none' 14 | ); 15 | $docx->addLink('Link to Google in red color and not underlined', $linkOptions); 16 | 17 | $docx->createDocx('example_addLink_1'); -------------------------------------------------------------------------------- /examples/Core/addLink/sample_2.php: -------------------------------------------------------------------------------- 1 | addLink('Google', array('url'=> 'http://www.google.es')); 9 | 10 | $runs = array(); 11 | $runs[] = array('text' => 'Now we include a link to '); 12 | $runs[] = $link; 13 | $runs[] = array('text' => ' in the middle of a pragraph of plain text.'); 14 | 15 | $docx->addText($runs); 16 | 17 | $docx->createDocx('example_addLink_2'); -------------------------------------------------------------------------------- /examples/Core/addList/sample_1.php: -------------------------------------------------------------------------------- 1 | addList($itemList, 1); 17 | 18 | $docx->createDocx('example_addList_1'); -------------------------------------------------------------------------------- /examples/Core/addList/sample_2.php: -------------------------------------------------------------------------------- 1 | addList($itemList, 2); 20 | 21 | $docx->createDocx('example_addList_2'); -------------------------------------------------------------------------------- /examples/Core/addList/sample_3.php: -------------------------------------------------------------------------------- 1 | 'We insert some '); 11 | $text[] = array('text' => 'bold text', 'b' => 'on'); 12 | $textData->addText($text); 13 | 14 | // and also some simple HTML to illustrate the fexibility of the method 15 | $htmlData = new WordFragment($docx); 16 | $html = 'Some HTML code with a link'; 17 | $htmlData->embedHTML($html); 18 | 19 | 20 | $itemList= array( 21 | 'In this example we use a custom list (val = 5) that comes bundled with the default PHPdocX template.', 22 | array( 23 | $textData, 24 | 'Line B', 25 | 'Line C' 26 | ), 27 | $htmlData, 28 | 'Line 3', 29 | ); 30 | 31 | // set the style type to 5: other predefined Word list style 32 | $docx->addList($itemList, 5); 33 | 34 | $docx->createDocx('example_addList_3'); -------------------------------------------------------------------------------- /examples/Core/addList/sample_4.php: -------------------------------------------------------------------------------- 1 | 'Arial', 18 | 'italic' => true, 19 | 'fontSize' => 14, 20 | 'color' => 'b70000' 21 | ); 22 | 23 | // set the style type to 1: unordered list 24 | $docx->addList($itemList, 1, $options); 25 | 26 | $docx->createDocx('example_addList_4'); -------------------------------------------------------------------------------- /examples/Core/addList/sample_5.php: -------------------------------------------------------------------------------- 1 | addText('Line 1', array('pStyle' => 'Heading1PHPDOCX')); 9 | $item2 = new WordFragment($docx); 10 | $item2->addText('Line 2', array('pStyle' => 'Heading2PHPDOCX')); 11 | $item3 = new WordFragment($docx); 12 | $item3->addText('Line 3', array('pStyle' => 'Heading3PHPDOCX')); 13 | 14 | $itemList = array( 15 | $item1, 16 | $item2, 17 | $item3, 18 | ); 19 | 20 | $docx->addList($itemList, 1, array('useWordFragmentStyles' => true)); 21 | 22 | $docx->createDocx('example_addList_5'); -------------------------------------------------------------------------------- /examples/Core/addList/sample_6.php: -------------------------------------------------------------------------------- 1 | addList($itemList, 2); 16 | 17 | $docx->addText('Some content.'); 18 | 19 | $itemList = array( 20 | 'Line 1', 21 | 'Line 2', 22 | 'Line 3', 23 | 'Line 4', 24 | 'Line 5' 25 | ); 26 | 27 | // CreateDocx::$numOL returns the numId of the previous list generated with addList 28 | $docx->addList($itemList, 2, array('numId' => CreateDocx::$numOL)); 29 | 30 | $docx->createDocx('example_addList_6'); -------------------------------------------------------------------------------- /examples/Core/addMathEquation/sample_1.php: -------------------------------------------------------------------------------- 1 | addText('We extract a math equation from an external Word file:'); 8 | 9 | $docx->addMathEquation('../../files/math.docx', 'docx'); 10 | 11 | $docx->createDocx('example_addMathDocx_1'); -------------------------------------------------------------------------------- /examples/Core/addMathEquation/sample_2.php: -------------------------------------------------------------------------------- 1 | addText('We write a math equation using OMML (the native Word XML standard for math equations):'); 8 | 9 | $docx->addMathEquation( 10 | ' 11 | ∪±∞=~× 12 | ', 'omml' 13 | ); 14 | 15 | $text = array(); 16 | $text[] = array('text' => 'The same equation inline: '); 17 | $math = new WordFragment($docx); 18 | $math->addMathEquation( 19 | ' 20 | ∪±∞=~× 21 | ', 'omml' 22 | ); 23 | $text[] = $math; 24 | 25 | $docx->addText($text); 26 | 27 | $docx->createDocx('example_addMathEq_1'); -------------------------------------------------------------------------------- /examples/Core/addMathEquation/sample_3.php: -------------------------------------------------------------------------------- 1 | addText('We write a math equation using MathMML:'); 8 | 9 | $mathML = ' 10 | 11 | A 12 | = 13 | 14 | 15 | 16 | 17 | x 18 | 19 | 20 | 2 21 | 22 | 23 | 24 | 25 | 3 26 | 27 | 28 | w 29 | 30 | 31 | 32 | 33 | 34 | '; 35 | 36 | $docx->addMathEquation($mathML, 'mathml'); 37 | 38 | $text = array(); 39 | $text[] = array('text' => 'The same equation inline: '); 40 | $math = new WordFragment($docx); 41 | $math->addMathEquation($mathML, 'mathml'); 42 | $text[] = $math; 43 | 44 | $docx->addText($text); 45 | 46 | $docx->createDocx('example_addMathML_1'); -------------------------------------------------------------------------------- /examples/Core/addMathEquation/sample_4.php: -------------------------------------------------------------------------------- 1 | addText('We write a math equation using MathMML:'); 8 | 9 | $mathML = ' 10 | 11 | A 12 | = 13 | 14 | 15 | 16 | 17 | x 18 | 19 | 20 | 2 21 | 22 | 23 | 24 | 25 | 3 26 | 27 | 28 | w 29 | 30 | 31 | 32 | 33 | 34 | '; 35 | 36 | $docx->addMathEquation($mathML, 'mathml', array('align' => 'left')); 37 | 38 | $docx->addMathEquation($mathML, 'mathml', array('align' => 'center')); 39 | 40 | $docx->addMathEquation($mathML, 'mathml', array('align' => 'right')); 41 | 42 | $docx->addText($text); 43 | 44 | $docx->createDocx('example_addMathML_4'); -------------------------------------------------------------------------------- /examples/Core/addMergeField/sample_1.php: -------------------------------------------------------------------------------- 1 | addText('This example illustrates how to add a mergefield to a Word document.'); 8 | 9 | $mergeParameters = array( 10 | 'format' => 'Upper', 11 | 'textBefore' => 'A mergefield example: ', 12 | 'textAfter' => ' and some text afterwards.' 13 | ); 14 | $options = array('color' => 'B70000'); 15 | $docx->addMergeField('MyMergeField example', $mergeParameters, $options); 16 | 17 | // remove the shading from the mergeField data 18 | $docx->docxSettings(array('doNotShadeFormData' => 0)); 19 | 20 | $docx->createDocx('example_addMergeField_1'); -------------------------------------------------------------------------------- /examples/Core/addPageNumber/sample_1.php: -------------------------------------------------------------------------------- 1 | 'right', 12 | 'bold' => true, 13 | 'sz' => 14, 14 | 'color' => 'B70000', 15 | ); 16 | $numbering->addPageNumber('numerical', $options); 17 | 18 | $docx->addHeader(array('default' => $numbering)); 19 | 20 | // include a couple of pages to better illustrate the example 21 | $docx->addText('This is the first page.'); 22 | $docx->addBreak(array('type' => 'page')); 23 | $docx->addText('This is the second page.'); 24 | $docx->addBreak(array('type' => 'page')); 25 | $docx->addText('This is the third page.'); 26 | 27 | $docx->createDocx('example_addPageNumber_1'); -------------------------------------------------------------------------------- /examples/Core/addPageNumber/sample_2.php: -------------------------------------------------------------------------------- 1 | true, 9 | 'color' => 'B70000', 10 | 'sz' => 30, 11 | ); 12 | 13 | // create a custom style 14 | $docx->createParagraphStyle('pgStyle', $style); 15 | 16 | // create a Word fragment to insert in the footer 17 | $numbering = new WordFragment($docx, 'defaultFooter'); 18 | // set some formatting options 19 | $options = array( 20 | 'textAlign' => 'right', 21 | 'pStyle' => 'pgStyle', 22 | ); 23 | $numbering->addPageNumber('page-of', $options); 24 | 25 | $docx->addFooter(array('default' => $numbering)); 26 | 27 | // include some pages to better illustrate the example 28 | $docx->addText('This is the first page.'); 29 | $docx->addBreak(array('type' => 'page')); 30 | $docx->addText('This is the second page.'); 31 | $docx->addBreak(array('type' => 'page')); 32 | $docx->addText('This is the third page.'); 33 | $docx->addBreak(array('type' => 'page')); 34 | $docx->addText('This is the fourth page.'); 35 | 36 | $docx->createDocx('example_addPageNumber_2'); -------------------------------------------------------------------------------- /examples/Core/addSimpleField/sample_1.php: -------------------------------------------------------------------------------- 1 | 'The title of the document.', 10 | 'creator' => 'The autor of the document.', 11 | 'description' => 'A description of the document.', 12 | ); 13 | 14 | $docx->addProperties($properties); 15 | 16 | $docx->addText('We add a few simple fields that render the above properties:'); 17 | 18 | $options = array( 19 | 'pStyle'=>'Heading1PHPDOCX' 20 | ); 21 | 22 | $docx->addSimpleField('TITLE','','', $options); 23 | 24 | $docx->addSimpleField('AUTHOR'); 25 | $docx->addSimpleField('NUMPAGES'); 26 | $docx->addSimpleField('COMMENTS'); 27 | 28 | // prompt the user to update the fields on opening 29 | $docx->docxSettings(array('updateFields'=>'true')); 30 | 31 | $docx->createDocx('example_addSimpleField_1'); -------------------------------------------------------------------------------- /examples/Core/addStructuredDocumentTag/sample_1.php: -------------------------------------------------------------------------------- 1 | $list, 13 | 'placeholderText' => 'Choose a value or write it down', 14 | 'alias' => 'Combo Box', 15 | 'fontSize' => 12, 16 | 'italic' => true, 17 | 'color' => 'FF0000', 18 | 'bold' => true, 19 | 'underline' => 'single', 20 | 'font' => 'Algerian'); 21 | $docx->addStructuredDocumentTag('comboBox', $options ); 22 | 23 | // date 24 | $options = array('placeholderText' => 'Choose a date', 25 | 'alias' => 'Date picker', 26 | 'fontSize' => 14, 27 | 'italic' => true, 28 | 'color' => '777777', 29 | 'bold' => true, 30 | 'font' => 'Calibri'); 31 | $docx->addStructuredDocumentTag('date', $options); 32 | 33 | // dropdown 34 | $list = array(array('One', 1), 35 | array('Two', 2), 36 | array('Three', 3) 37 | ); 38 | $options = array('listItems' => $list, 39 | 'placeholderText' => 'Choose a value', 40 | 'alias' => 'Dropdown menu', 41 | 'fontSize' => 12 42 | ); 43 | $docx->addStructuredDocumentTag('comboBox', $options); 44 | 45 | // richText 46 | $options = array('placeholderText' => 'This text is locked', 47 | 'alias' => 'Rich text', 48 | 'lock' => 'contentLocked' 49 | ); 50 | $docx->addStructuredDocumentTag('richText', $options ); 51 | 52 | $docx->createDocx('example_addStructuredDocumentTag_1'); -------------------------------------------------------------------------------- /examples/Core/addTable/sample_1.php: -------------------------------------------------------------------------------- 1 | 'single', 31 | 'tableAlign' => 'center', 32 | 'borderWidth' => 10, 33 | 'borderColor' => 'B70000', 34 | 'textProperties' => array('bold' => true, 'font' => 'Algerian', 'fontSize' => 18), 35 | ); 36 | 37 | $docx->addTable($valuesTable, $paramsTable); 38 | 39 | $docx->createDocx('example_addTable_1'); -------------------------------------------------------------------------------- /examples/Core/addTable/sample_2.php: -------------------------------------------------------------------------------- 1 | 'http://www.google.es' 12 | ); 13 | 14 | $link->addLink('Link to Google', $options); 15 | 16 | $image = new WordFragment($docx); 17 | $options = array( 18 | 'src' => '../../img/image.png' 19 | ); 20 | 21 | $image->addImage($options); 22 | 23 | $valuesTable = array( 24 | array( 25 | 'Title A', 26 | 'Title B', 27 | 'Title C' 28 | ), 29 | array( 30 | 'Line A', 31 | $link, 32 | $image 33 | ) 34 | ); 35 | 36 | 37 | $paramsTable = array( 38 | 'tableStyle' => 'LightListAccent1PHPDOCX', 39 | 'tableAlign' => 'center', 40 | 'columnWidths' => array(1000, 2500, 3000), 41 | ); 42 | 43 | $docx->addTable($valuesTable, $paramsTable); 44 | 45 | $docx->createDocx('example_addTable_2'); -------------------------------------------------------------------------------- /examples/Core/addTableContents/sample_1.php: -------------------------------------------------------------------------------- 1 | addText('Table of Contents', array('bold' => true, 'fontSize' => 14)); 8 | $legend = array('text' => 'Click here to update the TOC', 9 | 'color' => 'B70000', 10 | 'bold' => true, 11 | 'fontSize' => 12); 12 | $docx->addTableContents(array('autoUpdate' => true), $legend, '../../files/crazyTOC.docx'); 13 | 14 | // add some headings so they show up in the TOC 15 | $docx->addText('Chapter 1', array('pStyle' => 'Heading1PHPDOCX')); 16 | $docx->addText('Section', array('pStyle' => 'Heading2PHPDOCX')); 17 | $docx->addText('Another TOC entry', array('pStyle' => 'Heading3PHPDOCX')); 18 | 19 | $docx->createDocx('example_addTableContents_1'); -------------------------------------------------------------------------------- /examples/Core/addTableContents/sample_2.php: -------------------------------------------------------------------------------- 1 | addText('Table of Contents', array('bold' => true, 'fontSize' => 14)); 10 | 11 | $legend = array( 12 | 'text' => 'Click here to update the TOC', 13 | 'color' => 'B70000', 14 | 'bold' => true, 15 | 'fontSize' => 12, 16 | ); 17 | $toc = new WordFragment($docx); 18 | $toc->addTableContents(array('autoUpdate' => true), $legend, '../../files/crazyTOC.docx'); 19 | 20 | $text = array(); 21 | 22 | $text[] = array( 23 | 'text' => 'Write a text string: ', 24 | 'bold' => true 25 | ); 26 | $text[] = $text; 27 | $text[] = $toc; 28 | 29 | $docx->addText($text); 30 | 31 | // add some headings so they show up in the TOC 32 | $docx->addText('Chapter 1', array('pStyle' => 'Heading1PHPDOCX')); 33 | $docx->addText('Section', array('pStyle' => 'Heading2PHPDOCX')); 34 | $docx->addText('Another TOC entry', array('pStyle' => 'Heading3PHPDOCX')); 35 | 36 | $docx->createDocx('example_addTableContents_2'); -------------------------------------------------------------------------------- /examples/Core/addText/sample_1.php: -------------------------------------------------------------------------------- 1 | true, 16 | 'font' => 'Arial' 17 | ); 18 | 19 | $docx->addText($text, $paragraphOptions); 20 | 21 | $docx->createDocx('example_addText_1'); -------------------------------------------------------------------------------- /examples/Core/addText/sample_2.php: -------------------------------------------------------------------------------- 1 | 'We know this looks ugly', 12 | 'underline' => 'single' 13 | ); 14 | $text[] = 15 | array( 16 | 'text' => ' but we only want to illustrate some of the functionality of the addText method.', 17 | 'bold' => true 18 | ); 19 | // add some borders to the paragraph to illustrate that functionality 20 | $paragraphOptions = array( 'border' => 'double', 21 | 'borderColor' => 'b70000', 22 | 'borderWidth' => 12, 23 | 'borderSpacing' => 8, 24 | 'borderTopColor' => '000000', 25 | ); 26 | $docx->addText($text, $paragraphOptions); 27 | 28 | $docx->createDocx('example_addText_2'); -------------------------------------------------------------------------------- /examples/Core/addText/sample_3.php: -------------------------------------------------------------------------------- 1 | '../../img/image.png', 11 | 'scaling' => 50, 12 | 'float' => 'right', 13 | 'textWrap' => 1, 14 | ); 15 | $image->addImage($imageOptions); 16 | 17 | // create a Word fragment with a link 18 | $link = new WordFragment($docx); 19 | $linkOptions = array( 20 | 'url' => 'http://www.google.es', 21 | 'color' => '0000FF', 22 | 'underline' => 'single', 23 | ); 24 | $link->addLink('link to Google', $linkOptions); 25 | 26 | // create a Word fragment with a footnote 27 | $footnote = new WordFragment($docx); 28 | $footnote->addFootnote( 29 | array( 30 | 'textDocument' => 'here it is', 31 | 'textFootnote' => 'This is the footnote text.', 32 | ) 33 | ); 34 | 35 | // insert the different runs of text with created content and some text 36 | $text = array(); 37 | 38 | $text[] = $image; 39 | $text[] = array( 40 | 'text' => 'I am going to write a link: ', 41 | 'bold' => true 42 | ); 43 | $text[] = $link; 44 | $text[] = array( 45 | 'text' => ' to illustrate how to include links. ' 46 | ); 47 | $text[] = array( 48 | 'text' => ' As you may see it is extremely simple to do so and it can be done with any other Word element. For example to include a footnote is also as simple as this: ', 49 | ); 50 | $text[] = $footnote; 51 | $text[] = array( 52 | 'text' => ' , as you may check there is a footnote at the bottom of the page. ', 53 | 'color' => 'B70000' 54 | ); 55 | 56 | $docx->addText($text); 57 | 58 | $docx->createDocx('example_addText_3'); -------------------------------------------------------------------------------- /examples/Core/addText/sample_4.php: -------------------------------------------------------------------------------- 1 | addText('Some examples that illustrate how to include tabbed text in your Word document:'); 8 | 9 | // first example 10 | $tabs = array(); 11 | $tabs[] = array('position' => 2000); 12 | $tabs[] = array('position' => 4000); 13 | $tabs[] = array('position' => 6000); 14 | 15 | $options = array('tabPositions' => $tabs); 16 | 17 | $text = array(); 18 | $text[] = array('text' => 'one'); 19 | $text[] = array('text' => 'two', 'tab' => true); 20 | $text[] = array('text' => 'three', 'tab' => true); 21 | 22 | $docx->addText($text, $options); 23 | 24 | // second example 25 | $tabs = array(); 26 | $tabs[] = array('position' => 1000); 27 | $tabs[] = array('position' => 3000); 28 | $tabs[] = array('type' => 'center', 'leader' => 'dot', 'position' => 4000); 29 | 30 | $options = array('tabPositions' => $tabs); 31 | 32 | $text = array(); 33 | $text[] = array('text' => 'one'); 34 | $text[] = array('text' => 'two', 'tab' => true); 35 | $text[] = array('text' => 'three', 'tab' => true); 36 | 37 | $docx->addText($text, $options); 38 | 39 | // third example 40 | $tabs = array(); 41 | $tabs[] = array('position' => 1500); 42 | $tabs[] = array('position' => 5000); 43 | $tabs[] = array('type' => 'center', 'leader' => 'dot', 'position' => 7000); 44 | 45 | $options = array('tabPositions' => $tabs); 46 | 47 | $text = array(); 48 | $text[] = array('text' => 'one', 'tab' => true); 49 | $text[] = array('text' => 'two', 'tab' => true); 50 | $text[] = array('text' => 'three', 'tab' => true); 51 | 52 | $docx->addText($text, $options); 53 | 54 | $docx->createDocx('example_addText_4'); -------------------------------------------------------------------------------- /examples/Core/addText/sample_5.php: -------------------------------------------------------------------------------- 1 | importStyles('../../files/TemplateCharacterStyles.docx', 'merge', array('MyStyle1', 'MyStyle2'), 'styleID'); 8 | 9 | $text = array(); 10 | $text[] = 11 | array( 12 | 'text' => 'Text MyStyle', 13 | 'rStyle' => 'MyStyle1' 14 | ); 15 | $text[] = 16 | array( 17 | 'text' => ' text MyStyle2.', 18 | 'rStyle' => 'MyStyle2' 19 | ); 20 | 21 | $docx->addText($text); 22 | 23 | $docx->createDocx('example_addText_5'); -------------------------------------------------------------------------------- /examples/Core/addTextBox/sample_1.php: -------------------------------------------------------------------------------- 1 | 'right', 15 | 'paddingLeft' => 10, 16 | 'borderColor' => '#b70000', 17 | 'borderWidth' => 4, 18 | 'fillColor' => '#dddddd', 19 | 'width' => 240 20 | ); 21 | 22 | $docx->addTextBox($text, $textBoxOptions); 23 | 24 | $docx->createDocx('example_addTextBox_1'); -------------------------------------------------------------------------------- /examples/Core/addTextBox/sample_2.php: -------------------------------------------------------------------------------- 1 | 'right', 17 | 'paddingLeft' => 5, 18 | 'border' => false, 19 | 'fillColor' => '#ddddff', 20 | 'width' => 200, 21 | 'margin_top' => 10, 22 | 'margin_left' => 10, 23 | ); 24 | 25 | $txtbx->addTextBox($text, $textBoxOptions); 26 | 27 | $documentText = 'Text in the main document flow. Lorem ipsum dolor sit amet, consectetur adipisicing elit, ' . 28 | 'sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut ' . 29 | 'enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut' . 30 | 'aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit ' . 31 | 'sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut ' . 32 | 'enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut' . 33 | 'aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit ' . 34 | 'in voluptate velit esse cillum dolore eu fugiat nulla pariatur.'; 35 | 36 | 37 | $textRuns = array(); 38 | 39 | $textRuns[] = $txtbx; 40 | $textRuns[] = array('text' => $documentText); 41 | 42 | $docx->addText($textRuns); 43 | 44 | $docx->createDocx('example_addTextBox_2'); -------------------------------------------------------------------------------- /examples/Core/addTextBox/sample_3.php: -------------------------------------------------------------------------------- 1 | 'This text is normal.'); 13 | $runs[] = array('text' => ' And this text is red.', 'color' => 'FF0000'); 14 | 15 | $txtboxContent->addText($runs); 16 | 17 | $textBoxOptions = array( 18 | 'align' => 'right', 19 | 'paddingLeft' => 5, 20 | 'width' => 140, 21 | 'height' => 140, 22 | 'contentVerticalAlign' => 'bottom' 23 | ); 24 | 25 | $txtbx = new WordFragment($docx); 26 | 27 | $txtbx->addTextBox($txtboxContent, $textBoxOptions); 28 | 29 | $documentText = 'Text in the main document flow. Lorem ipsum dolor sit amet, consectetur adipisicing elit, ' . 30 | 'sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut ' . 31 | 'enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut' . 32 | 'aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit ' . 33 | 'sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut ' . 34 | 'enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut' . 35 | 'aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit ' . 36 | 'in voluptate velit esse cillum dolore eu fugiat nulla pariatur.'; 37 | 38 | 39 | $textRuns = array(); 40 | 41 | $textRuns[] = $txtbx; 42 | $textRuns[] = array('text' => $documentText); 43 | 44 | $docx->addText($textRuns); 45 | 46 | 47 | $docx->createDocx('example_addTextBox_3'); -------------------------------------------------------------------------------- /examples/Core/addWordML/sample_1.php: -------------------------------------------------------------------------------- 1 | addText('We are now going to add a paragraph by inserting a chunk of WordML code.'); 7 | 8 | $wordML = 'A very simple paragraph with only text.'; 9 | $docx->addWordML($wordML); 10 | 11 | $docx->addText('Beware that this is not, in general, a recommendable practice unless you are truly familiar with the OOXML standard.'); 12 | 13 | $docx->createDocx('example_addWordML_1'); -------------------------------------------------------------------------------- /examples/Core/embedHTML/sample_1.php: -------------------------------------------------------------------------------- 1 | An embedHTML() example'; 8 | $html .= '

We draw a table with border and rawspans and colspans:

'; 9 | $html .= ' 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
1_11_2
Some random text.
20 |
    21 |
  • One
  • 22 |
  • Two and a half
  • 23 |
24 |
3_23_33_3
'; 33 | $docx->embedHTML($html); 34 | 35 | $docx->createDocx('example_embedHTML_1'); -------------------------------------------------------------------------------- /examples/Core/embedHTML/sample_2.php: -------------------------------------------------------------------------------- 1 | createListStyle('latin', $latinListOptions); 13 | 14 | $html = ' 15 | '; 25 | $docx->embedHTML($html, array('customListStyles' => true)); 26 | 27 | $docx->createDocx('example_embedHTML_2'); -------------------------------------------------------------------------------- /examples/FormatConversion/docx2txt/sample_1.php: -------------------------------------------------------------------------------- 1 | true, 'list' => true,'table' => true, 'footnote' => true, 'endnote' => true, 'chart' => 0); 6 | CreateDocx::DOCX2TXT('../../files/Text.docx', 'document_1.txt', $options); -------------------------------------------------------------------------------- /examples/FormatConversion/transformDocxUsingMSWord/sample_1.php: -------------------------------------------------------------------------------- 1 | transformDocxUsingMSWord('../../files/Test.docx', $targetPath.'test.pdf'); 14 | $docx->transformDocxUsingMSWord('../../files/Test.docx', $targetPath.'test.txt'); 15 | $docx->transformDocxUsingMSWord('../../files/Test.docx', $targetPath.'test.doc'); 16 | $docx->transformDocxUsingMSWord('../../files/Test.docx', $targetPath.'test.rtf'); 17 | $docx->transformDocxUsingMSWord('../../files/Test.docx', $targetPath.'test.html'); -------------------------------------------------------------------------------- /examples/FormatConversion/transformOMMLToMathML/sample_1.php: -------------------------------------------------------------------------------- 1 | transformOMMLToMathML(' 8 | 9 | ∪±∞=~× 10 | '); -------------------------------------------------------------------------------- /examples/FormatConversion/txt2docx/sample_1.php: -------------------------------------------------------------------------------- 1 | txt2docx('../../files/Text.txt'); 8 | 9 | $docx->createDocx('example_txt2docx'); -------------------------------------------------------------------------------- /examples/LayoutAndGeneral/addBackgroundImage/sample_1.php: -------------------------------------------------------------------------------- 1 | addBackgroundImage('../../img/image.jpg'); 8 | // add a paragraph of text 9 | $docx->addText('Please, use a discrete background image so the text is easily readable.'); 10 | $docx->addText('This one is pretty annoying but it illustrates well the functionality :-)'); 11 | 12 | $docx->createDocx('example_addBackgroundImage_1'); 13 | -------------------------------------------------------------------------------- /examples/LayoutAndGeneral/addFooter/sample_1.php: -------------------------------------------------------------------------------- 1 | '../../img/image.png', 10 | 'dpi' => 300, 11 | ); 12 | 13 | $footerImage = new WordFragment($docx, 'defaultFooter'); 14 | $footerImage->addImage($imageOptions); 15 | 16 | $docx->addFooter(array('default' => $footerImage)); 17 | // add some text 18 | $docx->addText('This document has a footer with just one image.'); 19 | 20 | $docx->createDocx('example_addFooter_1'); -------------------------------------------------------------------------------- /examples/LayoutAndGeneral/addFooter/sample_2.php: -------------------------------------------------------------------------------- 1 | '../../img/image.png', 10 | 'dpi' => 300, 11 | ); 12 | 13 | $default = new WordFragment($docx, 'defaultFooter'); 14 | $default->addImage($imageOptions); 15 | $first = new WordFragment($docx, 'firstFooter'); 16 | $first->addText('first page footer.'); 17 | $even = new WordFragment($docx, 'evenFooter'); 18 | $even->addText('even page footer.'); 19 | 20 | $docx->addFooter(array('default' => $default, 'first' => $first, 'even' => $even)); 21 | // add some text 22 | $docx->addText('This is the first page of a document with different footers for the first and even pages.'); 23 | $docx->addBreak(array('type' => 'page')); 24 | $docx->addText('This is the second page.'); 25 | $docx->addBreak(array('type' => 'page')); 26 | $docx->addText('This is the third page.'); 27 | 28 | $docx->createDocx('example_addFooter_2'); -------------------------------------------------------------------------------- /examples/LayoutAndGeneral/addHeader/sample_1.php: -------------------------------------------------------------------------------- 1 | '../../img/image.png', 10 | 'dpi' => 300, 11 | ); 12 | 13 | $headerImage = new WordFragment($docx, 'defaultHeader'); 14 | $headerImage->addImage($imageOptions); 15 | 16 | $docx->addHeader(array('default' => $headerImage)); 17 | // add some text 18 | $docx->addText('This document has a header with just one image.'); 19 | 20 | $docx->createDocx('example_addHeader_1'); -------------------------------------------------------------------------------- /examples/LayoutAndGeneral/addLineNumbering/sample_1.php: -------------------------------------------------------------------------------- 1 | addLineNumbering(); 8 | $text = 'This is just a chunk of text that we will repeat couple of times to fill up some space. '; 9 | $text .= $text; 10 | $docx->addText($text); 11 | $docx->addText('Another chunk of text'); 12 | $docx->addText($text); 13 | 14 | $docx->createDocx('example_addLineNumbering_1'); -------------------------------------------------------------------------------- /examples/LayoutAndGeneral/addMacroFromDoc/sample_1.php: -------------------------------------------------------------------------------- 1 | addMacroFromDoc('../../files/fileMacros.docm'); 8 | 9 | $docx->createDocx('example_addMacroFromDoc_1'); 10 | rename('example_addMacroFromDoc_1.docx', 'example_addMacroFromDoc_1.docm'); -------------------------------------------------------------------------------- /examples/LayoutAndGeneral/addPageBorders/sample_1.php: -------------------------------------------------------------------------------- 1 | 12, 9 | 'borderTopColor' => 'FF0000', 10 | ); 11 | $docx->addPageBorders($options); 12 | $text = 'This is just a chunk of text that we will repeat couple of times to fill up some space. '; 13 | $text .= $text; 14 | $docx->addText($text); 15 | $docx->addText('Another chunk of text'); 16 | $docx->addText($text); 17 | 18 | $docx->createDocx('example_addPageBorders_1'); -------------------------------------------------------------------------------- /examples/LayoutAndGeneral/addProperties/sample_1.php: -------------------------------------------------------------------------------- 1 | 'My title', 9 | 'subject' => 'My subject', 10 | 'creator' => 'The creator', 11 | 'keywords' => 'keyword 1, keyword 2, keyword 3', 12 | 'description' => 'The description could be much longer than this', 13 | 'category' => 'My category', 14 | 'contentStatus' => 'Draft', 15 | 'Manager' => 'The boss', 16 | 'Company' => 'My company', 17 | 'custom' => array( 18 | 'My custom text' => array('text' => 'This is a reasonably large text'), 19 | 'My custom number' => array('number' => '4567'), 20 | 'My custom date' => array('date' => '1962-01-27T23:00:00Z'), 21 | 'My custom boolean' => array('boolean' => true) 22 | ) 23 | ); 24 | $docx->addProperties($properties); 25 | 26 | $text = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, ' . 27 | 'sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut ' . 28 | 'enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut' . 29 | 'aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit ' . 30 | 'in voluptate velit esse cillum dolore eu fugiat nulla pariatur. ' . 31 | 'Excepteur sint occaecat cupidatat non proident, sunt in culpa qui ' . 32 | 'officia deserunt mollit anim id est laborum.'; 33 | 34 | $paramsText = array( 35 | 'b' => 'single', 36 | 'font' => 'Arial' 37 | ); 38 | 39 | $docx->addText($text, $paramsText); 40 | 41 | $docx->createDocx('example_addProperties_1'); -------------------------------------------------------------------------------- /examples/LayoutAndGeneral/addProperties/sample_2.php: -------------------------------------------------------------------------------- 1 | 'single', 17 | 'font' => 'Arial' 18 | ); 19 | 20 | $docx->addText($text, $paramsText); 21 | 22 | $properties = array( 23 | 'created' => '2016-11-21T09:00:00Z', // force a value 24 | 'modified' => substr(date(DATE_W3C), 0, 19) . 'Z', // dynamic value 25 | 'lastModifiedBy' => 'phpdocxuser', 26 | ); 27 | $docx->addProperties($properties); 28 | 29 | $docx->createDocx('example_addProperties_2'); -------------------------------------------------------------------------------- /examples/LayoutAndGeneral/addSection/sample_1.php: -------------------------------------------------------------------------------- 1 | addText($text); 16 | 17 | $paramsText = array( 18 | 'b' => true 19 | ); 20 | 21 | $docx->addText($text, $paramsText); 22 | 23 | $docx->addSection('nextPage', 'A3'); 24 | 25 | $docx->addText($text); 26 | 27 | $paramsText = array( 28 | 'b' => true 29 | ); 30 | 31 | $docx->addText($text, $paramsText); 32 | 33 | $docx->createDocx('example_addSection_1'); -------------------------------------------------------------------------------- /examples/LayoutAndGeneral/createCharacterStyle/sample_1.php: -------------------------------------------------------------------------------- 1 | true, 9 | 'color' => 'ff0000', 10 | 'font' => 'Arial', 11 | 'fontSize' => 18, 12 | 'italic' => true, 13 | 'position' => 6, 14 | 'underline' => 'single', 15 | ); 16 | 17 | $docx->createCharacterStyle('myStyle', $style); 18 | 19 | $text = array(); 20 | $text[] = 21 | array( 22 | 'text' => 'A text in red color with the character style', 23 | 'rStyle' => 'myStyle', 24 | ); 25 | $text[] = 26 | array( 27 | 'text' => ' other text set as bold but without the character style.', 28 | 'bold' => true, 29 | ); 30 | 31 | $docx->addText($text); 32 | 33 | $docx->createDocx('example_createCharacterStyle_1'); -------------------------------------------------------------------------------- /examples/LayoutAndGeneral/createListStyle/sample_1.php: -------------------------------------------------------------------------------- 1 | createListStyle('latin', $latinListOptions); 15 | 16 | // list items 17 | $myList = array('item 1', array('subitem 1.1', 'subitem 1.2'), 'item 2'); 18 | // insert the custom list into the Word document 19 | $docx->addList($myList, 'latin'); 20 | 21 | $docx->createDocx('example_createListStyle_1'); -------------------------------------------------------------------------------- /examples/LayoutAndGeneral/createListStyle/sample_2.php: -------------------------------------------------------------------------------- 1 | createListStyle('myList', $latinListOptions); 21 | 22 | // list items 23 | $myList = array('item 1', array('subitem 1.1', 'subitem 1.2'), 'item 2'); 24 | // insert custom list into the Word document 25 | $docx->addList($myList, 'myList'); 26 | 27 | $docx->createDocx('example_createListStyle_2'); -------------------------------------------------------------------------------- /examples/LayoutAndGeneral/createParagraphStyle/sample_1.php: -------------------------------------------------------------------------------- 1 | '999999', 10 | 'border' => 'single', 11 | 'borderLeft' => 'double', 12 | 'borderColor' => '990000', 13 | 'borderRightColor' => '000099', 14 | 'borderWidth' => 12, 15 | 'borderTopWidth' => 24, 16 | 'indentLeft' => 920, 17 | ); 18 | // create custom style 19 | $docx->createParagraphStyle('myStyle', $style); 20 | 21 | // insert a paragraph with that style 22 | $text = 'A paragraph in grey color with borders. All borders are red but the right one that is blue. '; 23 | $text .= 'The general border style is single but the left border that is double. The top border is also thicker. '; 24 | $text .= 'We also include big left indentation.'; 25 | $docx->addText($text, array('pStyle' => 'myStyle')); 26 | 27 | $docx->createDocx('example_createParagraphStyle_1'); -------------------------------------------------------------------------------- /examples/LayoutAndGeneral/createParagraphStyle/sample_2.php: -------------------------------------------------------------------------------- 1 | 'b70000', 10 | 'fontSize' => 26, 11 | 'tabPositions' => array(array('type' => 'clear', 'position' => 1600), 12 | array('type' => 'clear', 'leader' => 'dot', 'position' => 2800), 13 | array('type' => 'clear', 'leader' => 'dot', 'position' => 4000), 14 | ) 15 | ); 16 | // create custom style 17 | $docx->createParagraphStyle('myStyle', $style); 18 | 19 | // insert a paragraph with that style 20 | $text[] = array('text' => 'Tabbed text:'); 21 | $text[] = array('text' => 'One', 'tab' => true); 22 | $text[] = array('text' => 'Two', 'tab' => true); 23 | $text[] = array('text' => 'Three', 'tab' => true); 24 | 25 | $docx->addText($text, array('pStyle' => 'myStyle')); 26 | 27 | $docx->createDocx('example_createParagraphStyle_2'); -------------------------------------------------------------------------------- /examples/LayoutAndGeneral/docxSettings/sample_1.php: -------------------------------------------------------------------------------- 1 | 'outline', 9 | 'zoom' => 70, 10 | ); 11 | $text = 'In this case we set the view mode as "outline" and ' . 12 | 'the default zoom on openning to 70%.'; 13 | $docx->addText($text); 14 | 15 | $docx->docxSettings($settings); 16 | 17 | $docx->createDocx('example_docxSettings_1'); -------------------------------------------------------------------------------- /examples/LayoutAndGeneral/docxSettings/sample_2.php: -------------------------------------------------------------------------------- 1 | addText($text); 9 | 10 | $settings = array( 11 | 'customSetting' => array( 12 | 'tag' => 'proofState', 13 | 'values' => array('w:grammar' => 'dirty', 'w:spelling' => 'dirty'), 14 | ) 15 | ); 16 | $docx->docxSettings($settings); 17 | 18 | $docx->createDocx('example_docxSettings_2'); -------------------------------------------------------------------------------- /examples/LayoutAndGeneral/importHeadersAndFooters/sample_1.php: -------------------------------------------------------------------------------- 1 | importHeadersAndFooters('../../files/TemplateHeaderAndFooter.docx'); 8 | $docx->addText('This is the resulting word document with imported header and footer.'); 9 | //You may import only the header with 10 | //$docx->importHeadersAndFooters('TemplateHeaderAndFooter.docx', 'header'); 11 | //and only the footer with 12 | //$docx->importHeadersAndFooters('TemplateHeaderAndFooter.docx', 'footer'); 13 | 14 | $docx->createDocx('example_importHeadersAndFooters_1'); -------------------------------------------------------------------------------- /examples/LayoutAndGeneral/importListStyle/sample_1.php: -------------------------------------------------------------------------------- 1 | importListStyle('../../files/TemplateStyleList.docx', '1', 'myliststyle'); 8 | 9 | $itemList = array( 10 | 'Line 1', 11 | 'Line 2', 12 | 'Line 3', 13 | 'Line 4', 14 | 'Line 5' 15 | ); 16 | 17 | $docx->addList($itemList, 'myliststyle'); 18 | 19 | $docx->createDocx('example_importListStyle_1'); -------------------------------------------------------------------------------- /examples/LayoutAndGeneral/importStyles/sample_1.php: -------------------------------------------------------------------------------- 1 | importStyles('../../files/TemplateStyles.docx', 'merge', array('crazyStyle')); 9 | 10 | $docx->addText('This is the resulting paragraph with the "CrazyStyle".', array('pStyle' => 'crazyStyle')); 11 | 12 | //You may also import a complete XML style sheet by 13 | //$docx->importStyles('../files/TemplateStyles.docx', 'replace'); 14 | 15 | $docx->createDocx('example_importStyles_1'); -------------------------------------------------------------------------------- /examples/LayoutAndGeneral/importStyles/sample_2.php: -------------------------------------------------------------------------------- 1 | importStyles('../../files/stylesTemplate.docx', 'merge', array('heading 1')); 9 | 10 | $docx->addText('This is the resulting paragraph with a standard heading style.', array('pStyle' => 'Heading1')); 11 | 12 | //You may also import a complete XML style sheet by 13 | //$docx->importStyles('../files/TemplateStyles.docx', 'replace'); 14 | 15 | $docx->createDocx('example_importStyles_2'); -------------------------------------------------------------------------------- /examples/LayoutAndGeneral/modifyPageLayout/sample_1.php: -------------------------------------------------------------------------------- 1 | addText($text); 18 | } 19 | 20 | $docx->modifyPageLayout('A3-landscape', array('numberCols' => '3')); 21 | 22 | $docx->createDocx('example_modifyPageLayout_1'); -------------------------------------------------------------------------------- /examples/LayoutAndGeneral/modifyPageLayout/sample_2.php: -------------------------------------------------------------------------------- 1 | modifyPageLayout('A4-landscape', array('numberCols' => '2', 'sectionNumbers' => array(2))); 9 | 10 | $docx->createDocx('example_modifyPageLayout_2'); -------------------------------------------------------------------------------- /examples/LayoutAndGeneral/parseStyles/sample_1.php: -------------------------------------------------------------------------------- 1 | parseStyles(); 9 | 10 | $docx->createDocx('example_parseStyles_1'); -------------------------------------------------------------------------------- /examples/LayoutAndGeneral/parseStyles/sample_2.php: -------------------------------------------------------------------------------- 1 | parseStyles(); 10 | 11 | $docx->createDocx('example_parseStyles_2'); 12 | -------------------------------------------------------------------------------- /examples/LayoutAndGeneral/parseStyles/sample_3.php: -------------------------------------------------------------------------------- 1 | parseStyles('../../files/stylesTemplate.docx'); 9 | 10 | $docx->createDocx('example_parseStyles_3'); -------------------------------------------------------------------------------- /examples/LayoutAndGeneral/parseStyles/sample_4.php: -------------------------------------------------------------------------------- 1 | parseStyles('../../files/TemplateCharacterStyles.docx'); 8 | 9 | $docx->createDocx('example_parseStyles_4'); -------------------------------------------------------------------------------- /examples/LayoutAndGeneral/removeFooters/sample_1.php: -------------------------------------------------------------------------------- 1 | removeFooters(); 8 | 9 | $docx->createDocx('example_removeFooters_1'); -------------------------------------------------------------------------------- /examples/LayoutAndGeneral/removeHeaders/sample_1.php: -------------------------------------------------------------------------------- 1 | removeHeaders(); 8 | 9 | $docx->createDocx('example_removeHeaders_1'); -------------------------------------------------------------------------------- /examples/LayoutAndGeneral/setBackgroundColor/sample_1.php: -------------------------------------------------------------------------------- 1 | setBackgroundColor('FFFFCC'); 9 | // include a paragraph of plain text 10 | $docx->addText('This document should have a pale yellow background color.'); 11 | 12 | $docx->createDocx('example_setBackgroundColor_1'); -------------------------------------------------------------------------------- /examples/LayoutAndGeneral/setDefaultFont/sample_1.php: -------------------------------------------------------------------------------- 1 | setDefaultFont('Arial Narrow'); 9 | 10 | // include some paragraphs of plain text 11 | $docx->addText('This text is going to show in Arial Narrow font because it is the chosen default font.'); 12 | $docx->addText('The standard default font is usually Calibri.'); 13 | 14 | $docx->createDocx('example_setDefaultFont_1'); -------------------------------------------------------------------------------- /examples/LayoutAndGeneral/setDocumentDefaultStyles/sample_1.php: -------------------------------------------------------------------------------- 1 | 'ff0000', 10 | 'fontSize' => 14, 11 | 'backgroundColor' => 'CCCCCC', 12 | 'spacingBottom' => 10, 13 | 'spacingTop' => 10, 14 | 'underline' => 'dash', 15 | 'textAlign' => 'right', 16 | 'pageBreakBefore' => true, 17 | ); 18 | 19 | // set document default styles 20 | $docx->setDocumentDefaultStyles($style); 21 | 22 | $text = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, ' . 23 | 'sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut ' . 24 | 'enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut' . 25 | 'aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit ' . 26 | 'in voluptate velit esse cillum dolore eu fugiat nulla pariatur. ' . 27 | 'Excepteur sint occaecat cupidatat non proident, sunt in culpa qui ' . 28 | 'officia deserunt mollit anim id est laborum.'; 29 | 30 | $docx->addText($text); 31 | 32 | $docx->addText($text); 33 | 34 | $docx->createDocx('example_setDocumentDefaultStyles_1'); -------------------------------------------------------------------------------- /examples/LayoutAndGeneral/setEncodeUTF-8/sample_1.php: -------------------------------------------------------------------------------- 1 | setEncodeUTF8(); 8 | 9 | $docx->createDocx('example_setEncodeUTF8_1'); -------------------------------------------------------------------------------- /examples/LayoutAndGeneral/setLanguage/sample_1.php: -------------------------------------------------------------------------------- 1 | setLanguage('es-ES'); 9 | // add a couple of paragraphs, one in spanish and the other in English 10 | $docx->addText('Este texto está en español y no debería estar marcado si se utiliza el corrector ortográfico.'); 11 | // whenever you start editing the file the following text will be underline by the spell checker. 12 | $docx->addText('Now in english.'); 13 | 14 | $docx->createDocx('example_setLanguage_1'); -------------------------------------------------------------------------------- /examples/LayoutAndGeneral/setMarkAsFinal/sample_1.php: -------------------------------------------------------------------------------- 1 | addText('This is just a simple text to help illustrate how to mark a document as final.'); 8 | $docx->addText('Beware that this \'protection\' can be easily removed by an expert user.'); 9 | 10 | $docx->setMarkAsFinal(); 11 | 12 | $docx->createDocx('example_setMarkAsFinal_1'); -------------------------------------------------------------------------------- /examples/Templates/clearBlocks/sample_1.php: -------------------------------------------------------------------------------- 1 | clearBlocks(); 8 | 9 | $docx->createDocx('example_clearBlocks_1'); -------------------------------------------------------------------------------- /examples/Templates/deleteTemplateBlock/sample_1.php: -------------------------------------------------------------------------------- 1 | deleteTemplateBlock('FIRST'); 8 | 9 | $docx->createDocx('example_deleteTemplateBlock_1'); -------------------------------------------------------------------------------- /examples/Templates/getTemplateVariables/sample_1.php: -------------------------------------------------------------------------------- 1 | getTemplateVariables()); -------------------------------------------------------------------------------- /examples/Templates/modifyInputFields/sample_1.php: -------------------------------------------------------------------------------- 1 | 'first', 9 | 'textfield_2' => 'second', 10 | 'sdt_1' => 'third', 11 | 'sdt_2' => 'fourth' 12 | ); 13 | 14 | $docx->modifyInputFields($data); 15 | 16 | $docx->createDocx('example_modifyInputFields_1'); -------------------------------------------------------------------------------- /examples/Templates/processTemplate/sample_1.php: -------------------------------------------------------------------------------- 1 | getTemplateVariables(); 10 | $docx->processTemplate($variables); 11 | 12 | $docx->createDocx('example_processTemplate_1'); -------------------------------------------------------------------------------- /examples/Templates/removeTemplateVariable/sample_1.php: -------------------------------------------------------------------------------- 1 | removeTemplateVariable('FOOTERVAR', 'block', 'footer'); 9 | //now we only remove the 'OTHERVAR' variable value 10 | $docx->removeTemplateVariable('OTHERVAR', 'inline'); 11 | //and to finish remove the line containing the FOOTNOTEVAR variable in the footnote 12 | $docx->removeTemplateVariable('FOOTNOTEVAR', 'block', 'footnote'); 13 | 14 | $docx->createDocx('example_removeTemplateVariable_1'); -------------------------------------------------------------------------------- /examples/Templates/replaceListVariable/sample_1.php: -------------------------------------------------------------------------------- 1 | replaceListVariable('LISTVAR', $items); 10 | 11 | $docx->createDocx('example_replaceListVariable_1'); -------------------------------------------------------------------------------- /examples/Templates/replaceListVariable/sample_2.php: -------------------------------------------------------------------------------- 1 | 'http://www.google.es', 9 | 'color' => '0000FF', 10 | 'underline' => 'single', 11 | ); 12 | $link->addLink('link to Google', $linkOptions); 13 | 14 | $image = new WordFragment($docx); 15 | $imageOptions = array( 16 | 'src' => '../../img/image.png', 17 | 'scaling' => 50, 18 | ); 19 | $image->addImage($imageOptions); 20 | 21 | $footnote = new WordFragment($docx); 22 | $footnote->addFootnote( 23 | array( 24 | 'textDocument' => 'here it is', 25 | 'textFootnote' => 'This is the footnote text.', 26 | ) 27 | ); 28 | 29 | $items = array($link, $image, $footnote); 30 | 31 | $docx->replaceListVariable('LISTVAR', $items); 32 | 33 | $docx->createDocx('example_replaceListVariable_2'); -------------------------------------------------------------------------------- /examples/Templates/replaceListVariable/sample_3.php: -------------------------------------------------------------------------------- 1 | 'http://www.google.es', 9 | 'color' => '0000FF', 10 | 'underline' => 'single', 11 | ); 12 | $link->addLink('link to Google', $linkOptions); 13 | 14 | $image = new WordFragment($docx); 15 | $imageOptions = array( 16 | 'src' => '../../img/image.png', 17 | 'scaling' => 50, 18 | ); 19 | $image->addImage($imageOptions); 20 | 21 | $text = new WordFragment($docx); 22 | $textOptions = array( 23 | 'bold' => true, 24 | ); 25 | $text->addText('Lorem ipsum', $textOptions); 26 | 27 | $itemsHeader = array($link, $image, $text); 28 | $itemsBody = array('First item', 'Second item', 'Third item'); 29 | $itemsFooter = array($image, $text, $link); 30 | 31 | $docx->replaceListVariable('LISTVAR_HEADER', $itemsHeader, array('target' => 'header')); 32 | $docx->replaceListVariable('LISTVAR_BODY', $itemsBody); 33 | $docx->replaceListVariable('LISTVAR_FOOTER', $itemsFooter, array('target' => 'footer')); 34 | 35 | $docx->createDocx('example_replaceListVariable_3'); -------------------------------------------------------------------------------- /examples/Templates/replacePlaceholderImage/sample_1.php: -------------------------------------------------------------------------------- 1 | 3, 9 | 'width' => 3, 10 | 'target' => 'header', 11 | ); 12 | 13 | $docx->replacePlaceholderImage('HEADERIMG','../../img/logo_header.jpg', $image_1); 14 | $docx->replacePlaceholderImage('LOGO','../../img/imageP3.png'); 15 | 16 | $docx->createDocx('example_replacePlaceholderImages_1'); -------------------------------------------------------------------------------- /examples/Templates/replacePlaceholderImage/sample_2.php: -------------------------------------------------------------------------------- 1 | 2, 9 | 'width' => 2, 10 | 'target' => 'footnote', 11 | ); 12 | 13 | $docx->replacePlaceholderImage('FOOTNOTEIMG','../../img/logo_header.jpg', $image_1); 14 | 15 | $docx->createDocx('example_replacePlaceholderImages_2'); -------------------------------------------------------------------------------- /examples/Templates/replacePlaceholderImage/sample_3.php: -------------------------------------------------------------------------------- 1 | 'auto', 9 | 'streamMode' => true, 10 | 'width' => 'auto', 11 | 'target' => 'header', 12 | ); 13 | 14 | $docx->replacePlaceholderImage('HEADERIMG', 'https://www.phpdocx.com/img/logo_badge.png', $image_1); 15 | 16 | $docx->createDocx('example_replacePlaceholderImages_3'); -------------------------------------------------------------------------------- /examples/Templates/replaceTableVariable/sample_1.php: -------------------------------------------------------------------------------- 1 | 'Product A', 10 | 'REFERENCE' => '107AW3', 11 | ), 12 | array( 13 | 'ITEM' => 'Product B', 14 | 'REFERENCE' => '204RS67O', 15 | ), 16 | array( 17 | 'ITEM' => 'Product C', 18 | 'REFERENCE' => '25GTR56', 19 | ) 20 | ); 21 | 22 | $docx->replaceTableVariable($data, array('parseLineBreaks' => true)); 23 | 24 | $docx->createDocx('example_replaceTableVariable_1'); -------------------------------------------------------------------------------- /examples/Templates/replaceTableVariable/sample_2.php: -------------------------------------------------------------------------------- 1 | setTemplateSymbol('@'); 8 | $data = array( 9 | array( 10 | 'ITEM' => 'Product A', 11 | 'REFERENCE' => '107AW3', 12 | 'PRICE' => '5.45' 13 | ), 14 | array( 15 | 'ITEM' => 'Product B', 16 | 'REFERENCE' => '204RS67O', 17 | 'PRICE' => '30.12' 18 | ), 19 | array( 20 | 'ITEM' => 'Product C', 21 | 'REFERENCE' => '25GTR56', 22 | 'PRICE' => '7.00' 23 | ) 24 | ); 25 | 26 | $docx->replaceTableVariable($data); 27 | 28 | $docx->createDocx('example_replaceTableVariable_2'); -------------------------------------------------------------------------------- /examples/Templates/replaceTableVariable/sample_3.php: -------------------------------------------------------------------------------- 1 | 'http://www.google.es', 9 | 'color' => '0000FF', 10 | 'underline' => 'single', 11 | ); 12 | $link1->addLink('link to product A', $linkOptions); 13 | 14 | $link2 = new WordFragment($docx); 15 | $linkOptions = array('url'=> 'http://www.google.es', 16 | 'color' => '0000FF', 17 | 'underline' => 'single', 18 | ); 19 | $link2->addLink('link to product B', $linkOptions); 20 | 21 | $link3 = new WordFragment($docx); 22 | $linkOptions = array('url'=> 'http://www.google.es', 23 | 'color' => '0000FF', 24 | 'underline' => 'single', 25 | ); 26 | $link3->addLink('link to product C', $linkOptions); 27 | 28 | $image = new WordFragment($docx); 29 | $imageOptions = array( 30 | 'src' => '../../img/image.png', 31 | 'scaling' => 50, 32 | ); 33 | $image->addImage($imageOptions); 34 | 35 | $docx->setTemplateSymbol('@'); 36 | $data = array( 37 | array( 38 | 'ITEM' => $link1, 39 | 'REFERENCE' => $image, 40 | 'PRICE' => '5.45' 41 | ), 42 | array( 43 | 'ITEM' => $link2, 44 | 'REFERENCE' => $image, 45 | 'PRICE' => '30.12' 46 | ), 47 | array( 48 | 'ITEM' => $link3, 49 | 'REFERENCE' => $image, 50 | 'PRICE' => '7.00' 51 | ) 52 | ); 53 | 54 | $docx->replaceTableVariable($data); 55 | 56 | $docx->createDocx('example_replaceTableVariable_3'); -------------------------------------------------------------------------------- /examples/Templates/replaceVariableByExternalFile/sample_1.php: -------------------------------------------------------------------------------- 1 | replaceVariableByExternalFile(array('EXTERNAL' => '../../files/External.docx'), array('matchSource' => true)); 8 | 9 | $docx->createDocx('example_replaceVariableByExternalFile_1'); -------------------------------------------------------------------------------- /examples/Templates/replaceVariableByHTML/sample_1.php: -------------------------------------------------------------------------------- 1 | replaceVariableByHTML('ADDRESS', 'inline', '

C/ Matías Turrión 24, Madrid 28043 Spain

', array('isFile' => false, 'parseDivsAsPs' => true, 'downloadImages' => false)); 8 | $docx->replaceVariableByHTML('CHUNK_1', 'block', 'http://www.2mdc.com/PHPDOCX/example.html', array('isFile' => true, 'parseDivsAsPs' => true, 'filter' => '#capa_bg_bottom', 'downloadImages' => true)); 9 | $docx->replaceVariableByHTML('CHUNK_2', 'block', 'http://www.2mdc.com/PHPDOCX/example.html', array('isFile' => true, 'parseDivsAsPs' => false, 'filter' => '#lateral', 'downloadImages' => true)); 10 | 11 | $docx->createDocx('example_replaceTemplateVariableByHTML_1'); -------------------------------------------------------------------------------- /examples/Templates/replaceVariableByText/sample_1.php: -------------------------------------------------------------------------------- 1 | $first, 'MULTILINETEXT' => $multiline); 11 | $options = array('parseLineBreaks' => true); 12 | 13 | $docx->replaceVariableByText($variables, $options); 14 | 15 | $docx->createDocx('example_replaceVariableByText_1'); -------------------------------------------------------------------------------- /examples/Templates/replaceVariableByWordFragment/sample_1.php: -------------------------------------------------------------------------------- 1 | addImage(array('src' => '../../img/image.png' , 'scaling' => 50, 'float' => 'right', 'textWrap' => 1)); 13 | // and also a link fragment 14 | $link = new WordFragment($docx, 'document'); 15 | $link->addLink('link to Google', array('url'=> 'http://www.google.es', 'color' => '0000FF', 'u' => 'single')); 16 | // and a footnote fragment 17 | $footnote = new WordFragment($docx, 'document'); 18 | $footnote->addFootnote( 19 | array( 20 | 'textDocument' => 'here it is', 21 | 'textFootnote' => 'This is the footnote text.', 22 | ) 23 | ); 24 | // combine them to create a paragraph 25 | $text = array(); 26 | 27 | $text[] = $image; 28 | $text[] = array( 29 | 'text' => 'I am going to write a link: ', 30 | 'b' => 'on', 31 | ); 32 | $text[] = $link; 33 | $text[] = array( 34 | 'text' => ' to illustrate how to include links. ' 35 | ); 36 | $text[] = array( 37 | 'text' => ' As you may see is extremely simple to do so and can be done with any other Word element. For example to include a footnote is also as simple as this: ', 38 | ); 39 | $text[] = $footnote; 40 | $text[] = array( 41 | 'text' => ' , as you see there is a footnote at the bottom of the page. ', 42 | 'color' => 'B70000', 43 | ); 44 | // insert all the content in the Word fragment we are going to use for replacement 45 | $wf->addText($text); 46 | 47 | $docx->replaceVariableByWordFragment(array('WORDFRAGMENT' => $wf), array('type' => 'block')); 48 | 49 | $docx->createDocx('example_replaceVariableByWordFragment_1'); -------------------------------------------------------------------------------- /examples/Templates/replaceVariableByWordFragment/sample_2.php: -------------------------------------------------------------------------------- 1 | addImage(array('src' => '../../img/image.png' , 'scaling' => 10)); 15 | // and also a link fragment 16 | $link = new WordFragment($docx, 'footnote'); 17 | $link->addLink('link to Google', array('url'=> 'http://www.google.es', 'color' => '0000FF', 'u' => 'single')); 18 | 19 | // combine them to create a paragraph 20 | $text = array(); 21 | 22 | $text[] = $image; 23 | $text[] = array( 24 | 'text' => 'I am going to write a link: ', 25 | 'b' => 'on', 26 | ); 27 | $text[] = $link; 28 | $text[] = array( 29 | 'text' => ' to illustrate how to include links in a footnote. ' 30 | ); 31 | $text[] = array( 32 | 'text' => ' As you may see it is extremely simple to do so and can be done with any other Word element.', 33 | ); 34 | 35 | // insert all content in the Word fragment we are going to use for replacement 36 | $wf->addText($text); 37 | // we want to preserve the reference mark so we do an inline substitution to presereve the paragraph structure. 38 | // we also target the footnote that is where the placeholder variable is located 39 | $docx->replaceVariableByWordFragment(array('INLINEFRAGMENT' => $wf), array('type' => 'inline', 'target' => 'footnote')); 40 | 41 | $docx->createDocx('example_replaceVariableByWordFragment_2'); -------------------------------------------------------------------------------- /examples/Templates/replaceVariableByWordFragment/sample_3.php: -------------------------------------------------------------------------------- 1 | addImage(array('src' => '../../img/image.png' , 'scaling' => 50, 'float' => 'right', 'textWrap' => 1)); 13 | // and also a link fragment 14 | $link = new WordFragment($docx, 'document'); 15 | $link->addLink('link to Google', array('url'=> 'http://www.google.es', 'color' => '0000FF', 'u' => 'single')); 16 | 17 | // combine them to create a paragraph 18 | $text = array(); 19 | 20 | $text[] = $image; 21 | $text[] = array( 22 | 'text' => 'I am going to write a link: ', 23 | 'b' => 'on', 24 | ); 25 | $text[] = $link; 26 | $text[] = array( 27 | 'text' => ' to illustrate how to include links. ' 28 | ); 29 | $text[] = array( 30 | 'text' => ' As you may see is extremely simple to do so and can be done with any other Word element.', 31 | ); 32 | // insert all the content in the Word fragment we are going to use for replacement 33 | $wf->addText($text); 34 | 35 | $docx->replaceVariableByWordFragment(array('WORDFRAGMENT_HEADER' => $wf), array('type' => 'block', 'target' => 'header')); 36 | $docx->replaceVariableByWordFragment(array('WORDFRAGMENT_FOOTER' => $wf), array('type' => 'block', 'target' => 'footer')); 37 | $docx->replaceVariableByWordFragment(array('WORDFRAGMENT_BODY' => $wf), array('type' => 'block')); 38 | 39 | $docx->createDocx('example_replaceVariableByWordFragment_3'); -------------------------------------------------------------------------------- /examples/Templates/replaceVariableByWordFragment/sample_4.php: -------------------------------------------------------------------------------- 1 | addCrossReference('Page-3', array('type' => 'bookmark', 'referenceName'=> 'sample')); 9 | $docx->replaceVariableByWordFragment(array('link' => $link)); 10 | 11 | $docx->addCrossReference('Page-1', array('type' => 'heading', 'referenceName'=> 'Heading First')); 12 | 13 | $docx->createDocx('example_replaceVariableByWordFragment_4'); -------------------------------------------------------------------------------- /examples/Templates/replaceVariableByWordFragment/sample_5.php: -------------------------------------------------------------------------------- 1 | addImage(array('src' => '../../files/image.png', 'scaling' => 20)); 9 | 10 | $textHeader = new WordFragment($docx); 11 | $paragraphOptions = array( 12 | 'bold' => true, 13 | 'font' => 'Arial', 14 | ); 15 | $textHeader->addText('Lorem ipsum dolor sit amet', $paragraphOptions); 16 | 17 | $textOther = new WordFragment($docx); 18 | $textOther->addText('Other text'); 19 | 20 | $textBody1 = new WordFragment($docx); 21 | $textBody1->addText('Body text'); 22 | 23 | $textBody2 = new WordFragment($docx); 24 | $textBody2->addText('Body text 2'); 25 | 26 | $imageBody = new WordFragment($docx); 27 | $imageBody->addImage(array('src' => '../../files/image.png')); 28 | 29 | $imageFooter = new WordFragment($docx); 30 | $imageFooter->addImage(array('src' => '../../files/image.png', 'scaling' => 50)); 31 | 32 | $textFooter = new WordFragment($docx); 33 | $paragraphOptions = array( 34 | 'bold' => true, 35 | 'font' => 'Arial', 36 | ); 37 | $textFooter->addText('Text footer', $paragraphOptions); 38 | 39 | $docx->replaceVariableByWordFragment(array('VAR_HEADER_1' => $imageHeader, 'VAR_HEADER_2' => $textHeader, 'VAR_HEADER_3' => $textOther), array('type' => 'inline', 'target' => 'header')); 40 | $docx->replaceVariableByWordFragment(array('VAR_BODY_1' => $textBody1, 'VAR_BODY_2' => $textBody2, 'VAR_BODY_3' => $imageBody)); 41 | $docx->replaceVariableByWordFragment(array('VAR_FOOTER_1' => $textFooter, 'VAR_FOOTER_2' => $imageFooter), array('type' => 'inline', 'target' => 'footer')); 42 | 43 | $docx->createDocx('example_replaceVariableByWordFragment_5'); -------------------------------------------------------------------------------- /examples/Templates/replaceVariableByWordML/sample_1.php: -------------------------------------------------------------------------------- 1 | 11 | 12 | This is a simple paragraph with some 13 | 14 | 15 | 16 | 17 | 18 | bold 19 | 20 | 21 | text. 22 | 23 | '; 24 | 25 | $docx->replaceVariableByWordML(array('WORDML' => $wordML)); 26 | 27 | $docx->createDocx('example_replaceVariableByWordML_1'); -------------------------------------------------------------------------------- /examples/Templates/setTemplateBlockSymbol/sample_1.php: -------------------------------------------------------------------------------- 1 | setTemplateBlockSymbol('MYBLOCK'); 8 | 9 | $docx->deleteTemplateBlock('1'); 10 | 11 | $docx->createDocx('example_setTemplateBlockSymbol_1'); -------------------------------------------------------------------------------- /examples/Templates/setTemplateSymbol/sample_1.php: -------------------------------------------------------------------------------- 1 | setTemplateSymbol('|'); 8 | 9 | $docx->replaceVariableByText(array('FIRST' => 'Hello World!')); 10 | 11 | $docx->createDocx('example_setTemplateSymbol_1'); -------------------------------------------------------------------------------- /examples/Templates/tickCheckboxes/sample_1.php: -------------------------------------------------------------------------------- 1 | 1, 'check2' => 0, 'check3' => 1); 8 | $docx->tickCheckboxes($variables); 9 | 10 | $docx->createDocx('example_tickCheckboxes_1'); -------------------------------------------------------------------------------- /examples/files/Book.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/Book.xlsx -------------------------------------------------------------------------------- /examples/files/Checkbox.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/Checkbox.docx -------------------------------------------------------------------------------- /examples/files/DOCXPathBlocks.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/DOCXPathBlocks.docx -------------------------------------------------------------------------------- /examples/files/DOCXPathBlocks_2.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/DOCXPathBlocks_2.docx -------------------------------------------------------------------------------- /examples/files/DOCXPathTemplate.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/DOCXPathTemplate.docx -------------------------------------------------------------------------------- /examples/files/External.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/External.docx -------------------------------------------------------------------------------- /examples/files/Heading_First.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/Heading_First.docx -------------------------------------------------------------------------------- /examples/files/MultipleSections.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/MultipleSections.docx -------------------------------------------------------------------------------- /examples/files/SimpleExample.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/SimpleExample.docx -------------------------------------------------------------------------------- /examples/files/TemplateBlocks.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/TemplateBlocks.docx -------------------------------------------------------------------------------- /examples/files/TemplateBlocksCustomSymbol.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/TemplateBlocksCustomSymbol.docx -------------------------------------------------------------------------------- /examples/files/TemplateBlocks_2.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/TemplateBlocks_2.docx -------------------------------------------------------------------------------- /examples/files/TemplateCharacterStyles.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/TemplateCharacterStyles.docx -------------------------------------------------------------------------------- /examples/files/TemplateComplexTable.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/TemplateComplexTable.docx -------------------------------------------------------------------------------- /examples/files/TemplateExternalFile.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/TemplateExternalFile.docx -------------------------------------------------------------------------------- /examples/files/TemplateHTML.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/TemplateHTML.docx -------------------------------------------------------------------------------- /examples/files/TemplateHeaderAndFooter.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/TemplateHeaderAndFooter.docx -------------------------------------------------------------------------------- /examples/files/TemplateList.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/TemplateList.docx -------------------------------------------------------------------------------- /examples/files/TemplateList_header_footer.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/TemplateList_header_footer.docx -------------------------------------------------------------------------------- /examples/files/TemplatePipeSymbol.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/TemplatePipeSymbol.docx -------------------------------------------------------------------------------- /examples/files/TemplateSimpleTable.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/TemplateSimpleTable.docx -------------------------------------------------------------------------------- /examples/files/TemplateSimpleTable_header_footer.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/TemplateSimpleTable_header_footer.docx -------------------------------------------------------------------------------- /examples/files/TemplateSimpleText.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/TemplateSimpleText.docx -------------------------------------------------------------------------------- /examples/files/TemplateStyleList.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/TemplateStyleList.docx -------------------------------------------------------------------------------- /examples/files/TemplateStyles.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/TemplateStyles.docx -------------------------------------------------------------------------------- /examples/files/TemplateVariables.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/TemplateVariables.docx -------------------------------------------------------------------------------- /examples/files/TemplateWordFragment_1.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/TemplateWordFragment_1.docx -------------------------------------------------------------------------------- /examples/files/TemplateWordFragment_2.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/TemplateWordFragment_2.docx -------------------------------------------------------------------------------- /examples/files/TemplateWordFragment_3.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/TemplateWordFragment_3.docx -------------------------------------------------------------------------------- /examples/files/TemplateWordFragmentsTarget.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/TemplateWordFragmentsTarget.docx -------------------------------------------------------------------------------- /examples/files/TemplateWordML.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/TemplateWordML.docx -------------------------------------------------------------------------------- /examples/files/Test.mht: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/Test.mht -------------------------------------------------------------------------------- /examples/files/Test.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/Test.pdf -------------------------------------------------------------------------------- /examples/files/Test2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/Test2.pdf -------------------------------------------------------------------------------- /examples/files/Test3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/Test3.pdf -------------------------------------------------------------------------------- /examples/files/Text.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/Text.docx -------------------------------------------------------------------------------- /examples/files/Text.txt: -------------------------------------------------------------------------------- 1 | Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi utaliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 2 | -------------------------------------------------------------------------------- /examples/files/Watermark.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/Watermark.docx -------------------------------------------------------------------------------- /examples/files/WatermarkImage.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/WatermarkImage.docx -------------------------------------------------------------------------------- /examples/files/crazyTOC.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/crazyTOC.docx -------------------------------------------------------------------------------- /examples/files/document_sections.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/document_sections.docx -------------------------------------------------------------------------------- /examples/files/document_test.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/document_test.pdf -------------------------------------------------------------------------------- /examples/files/docxpath/bookmarks.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/docxpath/bookmarks.docx -------------------------------------------------------------------------------- /examples/files/docxpath/breaks.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/docxpath/breaks.docx -------------------------------------------------------------------------------- /examples/files/docxpath/charts.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/docxpath/charts.docx -------------------------------------------------------------------------------- /examples/files/docxpath/endnotes.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/docxpath/endnotes.docx -------------------------------------------------------------------------------- /examples/files/docxpath/footnotes.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/docxpath/footnotes.docx -------------------------------------------------------------------------------- /examples/files/docxpath/headings.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/docxpath/headings.docx -------------------------------------------------------------------------------- /examples/files/docxpath/images.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/docxpath/images.docx -------------------------------------------------------------------------------- /examples/files/docxpath/links.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/docxpath/links.docx -------------------------------------------------------------------------------- /examples/files/docxpath/lists.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/docxpath/lists.docx -------------------------------------------------------------------------------- /examples/files/docxpath/paragraphs.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/docxpath/paragraphs.docx -------------------------------------------------------------------------------- /examples/files/docxpath/paragraphs_2.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/docxpath/paragraphs_2.docx -------------------------------------------------------------------------------- /examples/files/docxpath/sections.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/docxpath/sections.docx -------------------------------------------------------------------------------- /examples/files/docxpath/shapes.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/docxpath/shapes.docx -------------------------------------------------------------------------------- /examples/files/docxpath/tables.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/docxpath/tables.docx -------------------------------------------------------------------------------- /examples/files/example_area_chart.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/example_area_chart.docx -------------------------------------------------------------------------------- /examples/files/fileMacros.docm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/fileMacros.docm -------------------------------------------------------------------------------- /examples/files/headings.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/headings.docx -------------------------------------------------------------------------------- /examples/files/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/image.png -------------------------------------------------------------------------------- /examples/files/indexer.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/indexer.docx -------------------------------------------------------------------------------- /examples/files/inputFields.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/inputFields.docx -------------------------------------------------------------------------------- /examples/files/insert.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/insert.docx -------------------------------------------------------------------------------- /examples/files/linked_image.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/linked_image.docx -------------------------------------------------------------------------------- /examples/files/math.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/math.docx -------------------------------------------------------------------------------- /examples/files/object_doc.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/object_doc.doc -------------------------------------------------------------------------------- /examples/files/object_docx.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/object_docx.docx -------------------------------------------------------------------------------- /examples/files/object_pdf.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/object_pdf.pdf -------------------------------------------------------------------------------- /examples/files/object_ppt.ppt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/object_ppt.ppt -------------------------------------------------------------------------------- /examples/files/object_pptx.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/object_pptx.pptx -------------------------------------------------------------------------------- /examples/files/object_xls.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/object_xls.xls -------------------------------------------------------------------------------- /examples/files/object_xlsx.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/object_xlsx.xlsx -------------------------------------------------------------------------------- /examples/files/placeholderImage.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/placeholderImage.docx -------------------------------------------------------------------------------- /examples/files/placeholderImageFootnote.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/placeholderImageFootnote.docx -------------------------------------------------------------------------------- /examples/files/protectedDocument.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/protectedDocument.docx -------------------------------------------------------------------------------- /examples/files/second.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/second.docx -------------------------------------------------------------------------------- /examples/files/simpleTemplate.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/simpleTemplate.docx -------------------------------------------------------------------------------- /examples/files/stylesTemplate.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/stylesTemplate.docx -------------------------------------------------------------------------------- /examples/files/template_not_optimized.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/files/template_not_optimized.docx -------------------------------------------------------------------------------- /examples/img/image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/img/image.jpg -------------------------------------------------------------------------------- /examples/img/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/img/image.png -------------------------------------------------------------------------------- /examples/img/imageP1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/img/imageP1.png -------------------------------------------------------------------------------- /examples/img/imageP2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/img/imageP2.png -------------------------------------------------------------------------------- /examples/img/imageP3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/img/imageP3.png -------------------------------------------------------------------------------- /examples/img/imagebg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/img/imagebg.jpg -------------------------------------------------------------------------------- /examples/img/logo_header.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/img/logo_header.jpg -------------------------------------------------------------------------------- /examples/img/logo_phpdocx.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/examples/img/logo_phpdocx.gif -------------------------------------------------------------------------------- /excel/[Content_Types].xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /excel/_rels/.rels: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /excel/docProps/app.xml: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Excel0falseHojas de cálculo1Hoja1falsefalsefalse12.0000 -------------------------------------------------------------------------------- /excel/docProps/core.xml: -------------------------------------------------------------------------------- 1 | 2 | usuariousuario2009-05-05T07:58:26Z2009-05-05T07:58:30Z -------------------------------------------------------------------------------- /excel/excel.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/excel/excel.xlsx -------------------------------------------------------------------------------- /excel/xl/_rels/workbook.xml.rels: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /excel/xl/printerSettings/printerSettings1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/excel/xl/printerSettings/printerSettings1.bin -------------------------------------------------------------------------------- /excel/xl/sharedStrings.xml: -------------------------------------------------------------------------------- 1 | 2 | Ventas1er trim.2º trim.3er trim.4º trim. Para cambiar el tamaño del rango de datos del gráfico, arrastre la esquina inferior derecha del rango. -------------------------------------------------------------------------------- /excel/xl/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /excel/xl/tables/table1.xml: -------------------------------------------------------------------------------- 1 | 2 |
-------------------------------------------------------------------------------- /excel/xl/workbook.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /excel/xl/worksheets/_rels/sheet1.xml.rels: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /excel/xl/worksheets/sheet1.xml: -------------------------------------------------------------------------------- 1 | 2 | 5018.199999999999999323.231.441.26 -------------------------------------------------------------------------------- /plugins/wysiwyg/config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. 3 | * For licensing, see LICENSE.md or http://ckeditor.com/license 4 | */ 5 | CKEDITOR.editorConfig = function( config ) { 6 | config.toolbarGroups = [ 7 | { name: 'document', groups: [ 'mode', 'document', 'doctools' ] }, 8 | { name: 'clipboard', groups: [ 'clipboard', 'undo' ] }, 9 | { name: 'editing', groups: [ 'find', 'selection', 'spellchecker', 'editing' ] }, 10 | { name: 'forms', groups: [ 'forms' ] }, 11 | '/', 12 | { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] }, 13 | { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi', 'paragraph' ] }, 14 | { name: 'links', groups: [ 'links' ] }, 15 | { name: 'insert', groups: [ 'insert' ] }, 16 | '/', 17 | { name: 'styles', groups: [ 'styles' ] }, 18 | { name: 'colors', groups: [ 'colors' ] }, 19 | { name: 'tools', groups: [ 'tools' ] }, 20 | { name: 'others', groups: [ 'others' ] }, 21 | { name: 'about', groups: [ 'about' ] } 22 | ]; 23 | 24 | config.removeButtons = 'Button,ImageButton,HiddenField,Superscript,Subscript,Blockquote,Flash,Smiley,Iframe,Styles,CreateDiv,Form,Textarea,NumberedList'; 25 | }; -------------------------------------------------------------------------------- /templates/README.txt: -------------------------------------------------------------------------------- 1 | This folder contains two base templates for PHPDocX. 2 | 3 | If you wish to create your own you may do so starting from scratch or modifying an existing one 4 | 5 | We do not recommend to modify an existing default template: 6 | 7 | - phpdocxBaseTemplate.docx 8 | - phpdocxBaseTemplateNumberedHeadings.docx 9 | 10 | Because the standard microsoft Word interface may change its structure behind the curtains and break a property that may be used by PHPDocX. 11 | 12 | Nevertheless if you still choose to do so, please, first of all do a backup of the file to make sure you may return to the original version. -------------------------------------------------------------------------------- /templates/comments.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /templates/comments.xml.rels: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /templates/directory: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/templates/directory -------------------------------------------------------------------------------- /templates/endnotes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /templates/endnotes.xml.rels: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /templates/footnotes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /templates/footnotes.xml.rels: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /templates/header: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/templates/header -------------------------------------------------------------------------------- /templates/phpdocxBaseTemplate.docm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/templates/phpdocxBaseTemplate.docm -------------------------------------------------------------------------------- /templates/phpdocxBaseTemplate.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/templates/phpdocxBaseTemplate.docx -------------------------------------------------------------------------------- /templates/phpdocxBaseTemplateNumberedHeadings.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpkapil/phpdocx/7760d654d7e65b236ba1bcf33f532e892aff4c05/templates/phpdocxBaseTemplateNumberedHeadings.docx -------------------------------------------------------------------------------- /templates/xmls/app.xml: -------------------------------------------------------------------------------- 1 | 2 | 43123071690Microsoft Office Word0143falseTítulo1false1994falsefalse12.0000 -------------------------------------------------------------------------------- /templates/xmls/comments.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /templates/xmls/comments.xml.rels: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /templates/xmls/core.xml: -------------------------------------------------------------------------------- 1 | 2 | PHPDocXPHPDocX62012-01-10T09:29:00Z2012-02-06T10:43:00Z -------------------------------------------------------------------------------- /templates/xmls/document.xml.rels: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /templates/xmls/endnotes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /templates/xmls/endnotes.xml.rels: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /templates/xmls/footnotes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /templates/xmls/footnotes.xml.rels: -------------------------------------------------------------------------------- 1 | 2 | --------------------------------------------------------------------------------