Class: CreateDocx
Source Location: /CreateDocx.inc
CreateDocument
|
--CreateDocx
Abstract class used for creating documents
Author(s):
Version:
Copyright:
- Copyright (c) 2009-2013 Narcea ProduCiones Multimedia S.L. (http://www.2mdc.com)
|
|
|
|
Class Details
Class Variables
Class Methods
static method docx2txt [line 4430]
static void docx2txt(
$from, array
$to, [
$options = array()], string
$path.)
|
|
Transform a word document to a text file
Tags:
Parameters:
static method getTempDir [line 6924]
static string getTempDir(
)
|
|
To add support of sys_get_temp_dir for PHP versions under 5.2.1
Tags:
constructor __construct [line 540]
CreateDocx __construct(
[
$baseTemplatePath = PHPDOCX_BASE_TEMPLATE], [
$tempDir = null], string
$baseTemplatePath., string
$tempDir.)
|
|
Construct
Tags:
Parameters:
destructor __destruct [line 1335]
method addBackgroundImage [line 1718]
void addBackgroundImage(
string
$path)
|
|
Adds a background image to the document
Tags:
Parameters:
method addBasicHTML [line 1780]
void addBasicHTML(
[string
$html = '<html><body></body></html>'], [array
$options = array()])
|
|
Tags:
Parameters:
method addBookmark [line 1796]
void addBookmark(
[array
$options = array('type' => null, 'name' => null, 'rawWordML' => false)])
|
|
Adds a bookmart start or end tag
Tags:
Parameters:
method addBreak [line 1842]
void addBreak(
[string
$options = array('type' => 'line', 'rawWordML' => false)])
|
|
Add a break
Tags:
Parameters:
method addChart [line 1920]
void addChart(
[array
$options = array('rawWordML' => false)])
|
|
Add a chart
Tags:
Parameters:
method addDateAndHour [line 2023]
void addDateAndHour(
[array
$options = array( 'dateFormat' => 'dd/MM/yyyy H:mm:ss', 'rawWordML' => false)])
|
|
Adds date and hour to the Word document
Tags:
Parameters:
method addDOCX [line 2079]
void addDOCX(
[array
$options = array('rawWordML' => false)])
|
|
Merge DOCX. Keep content and styles.
Tags:
Parameters:
method addElement [line 2125]
Element addElement(
string
$type, [
$params = ''], array
$parrams)
|
|
Add an element to embedd in other elements
Tags:
Parameters:
method addEndnote [line 2286]
void addEndnote(
[
$options = array('rawWordML' => false)], array
$options.)
|
|
Add an endnote
Tags:
Parameters:
method addFont [line 2333]
void addFont(
array
$fonts)
|
|
Add a new font
Tags:
Parameters:
method addFooter [line 2355]
void addFooter(
$footers, array
$footer, array
1)
|
|
Add a footer.
Tags:
Parameters:
method addFootnote [line 2463]
void addFootnote(
[array
$options = array('rawWordML' => false)])
|
|
Add a footnote
Tags:
Parameters:
method addGraphic [line 2526]
void addGraphic(
array
$dats)
|
|
Add a graphic
Tags:
Parameters:
method addGraphicImg [line 2609]
void addGraphicImg(
[array
$options = array('rawWordML' => false)])
|
|
Add a graphic image
Tags:
Parameters:
method addGraphicTemplate [line 2642]
void addGraphicTemplate(
array
$options)
|
|
Add a graphic template. Replace placeholder with a graphic
Tags:
Parameters:
method addHeader [line 2720]
void addHeader(
array
$headers)
|
|
Add a header.
Tags:
Parameters:
method addHTML [line 2827]
void addHTML(
[array
$options = array('html' => '', 'rawWordML' => false)])
|
|
Inserts HTML into a document as alternative content (altChunk). This method IS NOT compatible with PDF conversion or Open Office (use embedHTML instead).
Tags:
Parameters:
method addImage [line 2879]
void addImage(
[array
$data = ''])
|
|
Add an image
Tags:
Parameters:
method addLink [line 2969]
void addLink(
$text, [array
$options = array('url' => '',
'font' => '',
'sz' => '',
'color' => '0000ff',
'u' => 'single',
'rawWordML' => false)])
|
|
Add a link
Tags:
Parameters:
method addList [line 3029]
void addList(
array
$data, [array
$options = array('rawWordML' => false)])
|
|
Add a list
Tags:
Parameters:
method addMacroFromDoc [line 3069]
void addMacroFromDoc(
string
$path)
|
|
Add a macro from a DOC
Tags:
Parameters:
method addMathDocx [line 3101]
void addMathDocx(
string
$path)
|
|
Convert a math eq to DOCX
Tags:
Parameters:
method addMathEq [line 3120]
void addMathEq(
string
$eq)
|
|
Add an existing math eq to DOCX
Tags:
Parameters:
method addMathMML [line 3133]
void addMathMML(
string
$eq)
|
|
Convert a math MML eq to DOCX
Tags:
Parameters:
method addMHT [line 3152]
void addMHT(
[array
$options = array('rawWordML' => false)])
|
|
Add a MHT file.
Tags:
Parameters:
method addNewBaseTemplate [line 3189]
void addNewBaseTemplate(
$path,
$name, [
$overwrite = false], string
$path., string
$name., boolean
$overwrite.)
|
|
Add a new base template into the templates folder.
Tags:
Parameters:
method addObject [line 3227]
void addObject(
[array
$options = array('rawWordML' => false)])
|
|
Add an existing object (XLS or PPTX)
Tags:
Parameters:
method addPageNumber [line 3307]
void addPageNumber(
[mixed
$type = 'numerical'], [array
$options = array('defaultValue' => 1, 'rawWordML' => false)])
|
|
Adds a page number to the document WARNING: if the page number is not added to a header or footer the user may need to press F9 in the MS Word interface to update its value to the current page
Tags:
Parameters:
method addParagraph [line 3357]
void addParagraph(
array
$parameters, array
$options)
|
|
Adds a complex paragraph to a Word document
Tags:
Parameters:
method addProperties [line 3474]
void addProperties(
array
$values)
|
|
Add properties to document
Tags:
Parameters:
method addRawWordML [line 3520]
void addRawWordML(
string
$wml)
|
|
Add a raw WordML
Tags:
Parameters:
method addRTF [line 3536]
void addRTF(
[array
$options = array('rawWordML' => false)])
|
|
Add a RTF file. Keep content and styles.
Tags:
Parameters:
method addSection [line 3589]
void addSection(
[string
$sectionType = 'nextPage'], [array
$paperType = 'A4'], [array
$options = array()])
|
|
Adds a section
Tags:
Parameters:
method addShape [line 3628]
void addShape(
string
$type, [array
$options = array('rawWordML' => false)])
|
|
Add a shape
Tags:
Parameters:
method addSubDocument [line 3650]
void addSubDocument(
$originalPath, [string
$destination = ''], string
$path)
|
|
Add a subdocument to a master document. The document should be in the same folder as the final master document
Tags:
Parameters:
method addTable [line 3682]
void addTable(
array
$data, [array
$options = array('rawWordML' => false)])
|
|
Add a table.
Tags:
Parameters:
method addTableContents [line 3702]
void addTableContents(
[string
$font = ''])
|
|
Add a table of contents (TOC)
Tags:
Parameters:
method addTemplate [line 3726]
void addTemplate(
string
$path)
|
|
Add a DOCX file as a template
Tags:
Parameters:
method addTemplateChart [line 3757]
void addTemplateChart(
string
$var, string
$chart)
|
|
Replace a variable with a chart.
Tags:
Parameters:
method addTemplateCheckBox [line 3774]
void addTemplateCheckBox(
string
$var, [string
$value = false])
|
|
Replace a variable with a checkbox.
Tags:
Parameters:
method addTemplateImage [line 3792]
void addTemplateImage(
string
$var, string
$pathImage)
|
|
Replace a variable image template with a new image.
Tags:
Parameters:
method addTemplateVariable [line 3813]
void addTemplateVariable(
mixed
$var, [string
$value = ''], [mixed
$settings = ''])
|
|
Replace a variable with a text, HTML, DOCX, RTF, MHT.
Tags:
Parameters:
method addText [line 3865]
void addText(
mixed
$textParams, [array
$paragraphParams = array('rawWordML' => false)])
|
|
Add a text
Tags:
Parameters:
method addTextBox [line 3903]
void addTextBox(
array
$text, [array
$options = array('rawWordML' => false)])
|
|
Add a textbox
Tags:
Parameters:
method addTitle [line 3937]
void addTitle(
string
$text, [array
$options = array('rawWordML' => false)])
|
|
Add a title
Tags:
Parameters:
method addWordML [line 3958]
void addWordML(
[array
$options = array('rawWordML' => false)])
|
|
Adds WordML to the document.
Tags:
Parameters:
method cleanWordMLBlockElements [line 3974]
void cleanWordMLBlockElements(
$wordML)
|
|
Eliminates all block type elements from a WordML string
Tags:
Parameters:
method clearBlocks [line 3999]
method createDocx [line 4017]
void createDocx(
string
$args[0], string
$args[1])
|
|
Generate a new DOCX file
Tags:
Parameters:
method createDocxAndDownload [line 4355]
void createDocxAndDownload(
string
$args[0], string
$args[1])
|
|
Generate and download a new DOCX file
Tags:
Parameters:
method createWordMLFragment [line 5671]
void createWordMLFragment(
$data, mixed
$data,)
|
|
Creates a WordML freagment.
Tags:
Parameters:
method deleteTemplateBlock [line 4402]
void deleteTemplateBlock(
string
$blockName)
|
|
Delete a block
Tags:
Parameters:
method disableDebug [line 4414]
method embedHTML [line 4460]
void embedHTML(
[string
$html = '<html><body></body></html>'], [
$options = array()], array
$options:)
|
|
Embed HTML into the Word document by parsing the HTML code and converting it into WordML It preserves many CSS styles
Tags:
Parameters:
method enableCompatibilityMode [line 4490]
void enableCompatibilityMode(
)
|
|
Enable compatibility mode for OpenOffice and MS Office 2003 CP. Avoid using unsupported methods
Tags:
method enableDebug [line 4502]
method generateBaseWordNumbering [line 7295]
void generateBaseWordNumbering(
)
|
|
creates an empty word numbering base string
Tags:
method getExtension [line 1367]
method getTemplateVariables [line 4515]
array getTemplateVariables(
)
|
|
Return template variables (placeholders)
Tags:
method getTemplateXML [line 4530]
Return the XML of the given Template
Tags:
method getTemporaryDirectory [line 1386]
void getTemporaryDirectory(
)
|
|
Getter
Tags:
method getXmlContentTypes [line 1406]
void getXmlContentTypes(
)
|
|
Getter
Tags:
method getXmlDocPropsApp [line 1446]
void getXmlDocPropsApp(
)
|
|
Getter
Tags:
method getXmlDocPropsCore [line 1466]
void getXmlDocPropsCore(
)
|
|
Getter
Tags:
method getXmlDocPropsCustom [line 1486]
void getXmlDocPropsCustom(
)
|
|
Getter
Tags:
method getXmlRelsRels [line 1426]
method getXmlWordDocumentContent [line 1506]
void getXmlWordDocumentContent(
)
|
|
Getter
Tags:
method getXmlWordDocumentStyles [line 1526]
void getXmlWordDocumentStyles(
)
|
|
Getter
Tags:
method getXmlWordEndnotes [line 1546]
void getXmlWordEndnotes(
)
|
|
Getter
Tags:
method getXmlWordFontTable [line 1566]
void getXmlWordFontTable(
)
|
|
Getter
Tags:
method getXmlWordFooter1 [line 1586]
void getXmlWordFooter1(
)
|
|
Getter
Tags:
method getXmlWordHeader1 [line 1606]
void getXmlWordHeader1(
)
|
|
Getter
Tags:
method getXmlWordRelsDocumentRels [line 1626]
void getXmlWordRelsDocumentRels(
)
|
|
Getter
Tags:
method getXmlWordSettings [line 1646]
void getXmlWordSettings(
)
|
|
Getter
Tags:
method getXmlWordStyles [line 1666]
method getXmlWordThemeTheme1 [line 1686]
void getXmlWordThemeTheme1(
)
|
|
Getter
Tags:
method getXml_Word_WebSettings [line 1706]
void getXml_Word_WebSettings(
)
|
|
Setter
Tags:
method importFontTableXML [line 4744]
void importFontTableXML(
$path, string
$path.)
|
|
Imports an existing fontTable.xml file from an existing docx document.
Tags:
Parameters:
method importHeadersAndFooters [line 7327]
void importHeadersAndFooters(
$path, [
$type = 'headerAndFooter'], string
$path., string
$type., array
$options)
|
|
Inserts new headers and/or footers from a word file.
Tags:
Parameters:
method importSettingsXML [line 4724]
void importSettingsXML(
$path, string
$path.)
|
|
Imports an existing settings.xml file from an existing docx document.
Tags:
Parameters:
method importSingleNumbering [line 7271]
void importSingleNumbering(
string
$numberingsXML, string
$newNumbering, string
$numberId, [
$originalAbstractNumId = ''])
|
|
Inserts a new numbering style.
Tags:
Parameters:
method importStyles [line 4552]
void importStyles(
$path, [
$type = 'replace'], [
$myStyles = array()], string
$path., string
$type., array
$myStyles.)
|
|
Imports an existing style sheet from an existing docx document.
Tags:
Parameters:
method importThemeXML [line 4684]
void importThemeXML(
$path, string
$path.)
|
|
Imports an existing theme from an existing docx document.
Tags:
Parameters:
method importWebSettingsXML [line 4704]
void importWebSettingsXML(
$path, string
$path.)
|
|
Imports an existing webSettings.xml file from an existing docx document.
Tags:
Parameters:
method mergeDOCX [line 4766]
void mergeDOCX(
string
$path, string
$newXML)
|
|
Merge WordML into a DOCX. WordML is added at the end of the document
Tags:
Parameters:
method modifyPageLayout [line 4793]
void modifyPageLayout(
[array
$paperType = 'letter'], [array
$options = array()])
|
|
Modify page layout
Tags:
Parameters:
method parseStyles [line 5006]
void parseStyles(
[
$path = ''], string
$path.)
|
|
Gets the Ids associated with the different styles in the current document or an external docx. It returns a docx with all the avalaible paragraph, list and table styles.
Tags:
Parameters:
method readDOCX [line 5296]
void readDOCX(
string
$path)
|
|
Parse DOCX file and extract content
Tags:
Parameters:
method removeFooters [line 7189]
Removes existing footers.
Tags:
method removeHeaders [line 7141]
Removes existing headers.
Tags:
method removeHeadersAndFooters [line 7131]
void removeHeadersAndFooters(
)
|
|
Removes headers and footers.
Tags:
method replaceHeaderImage [line 5317]
void replaceHeaderImage(
string
$var, string
$pathImage)
|
|
Replace a header image with a new image.
Tags:
Parameters:
method replaceTemplateVariableByHTML [line 5349]
void replaceTemplateVariableByHTML(
string
$var, type
$type, [string
$html = '<html><body></body></html>'], [
$options = array()], array
$options:)
|
|
Replace a template variable with WordML obtained from HTML via the embedHTML method.
Tags:
Parameters:
method setBackgroundColor [line 5377]
void setBackgroundColor(
string
$color)
|
|
Changes the background color of the document
Tags:
Parameters:
method setDecimalSymbol [line 5417]
void setDecimalSymbol(
string
$symbol)
|
|
Change the default font
Tags:
Parameters:
method setDefaultFont [line 5472]
void setDefaultFont(
string
$font)
|
|
Change the default font
Tags:
Parameters:
method setEncodeUTF8 [line 5524]
Transform to UTF-8 charset
Tags:
method setExtension [line 1357]
void setExtension(
$extension)
|
|
Setter
Tags:
Parameters:
method setLanguage [line 5535]
void setLanguage(
[$lang
$lang = DEFAULT_LANGUAGE])
|
|
Change default language.
Tags:
Parameters:
method setMarkAsFinal [line 5589]
Mark the document as final
Tags:
method setTemplateSymbol [line 5606]
void setTemplateSymbol(
[string
$symbol = '$'])
|
|
Set the symbol surrounding varibles (placeholders)
Tags:
Parameters:
method setTemporaryDirectory [line 1376]
void setTemporaryDirectory(
$tempDir)
|
|
Setter
Tags:
Parameters:
method setXmlContentTypes [line 1396]
void setXmlContentTypes(
$xmlContentTypes)
|
|
Setter
Tags:
Parameters:
method setXmlDocPropsApp [line 1436]
void setXmlDocPropsApp(
$xmlDocPropsApp)
|
|
Setter
Tags:
Parameters:
method setXmlDocPropsCore [line 1456]
void setXmlDocPropsCore(
$xmlDocPropsCore)
|
|
Setter
Tags:
Parameters:
method setXmlDocPropsCustom [line 1476]
void setXmlDocPropsCustom(
$xmlDocPropsCustom)
|
|
Setter
Tags:
Parameters:
method setXmlRelsRels [line 1416]
void setXmlRelsRels(
$xmlRelsRels)
|
|
Setter
Tags:
Parameters:
method setXmlWordDocument [line 1496]
void setXmlWordDocument(
$xmlWordDocument)
|
|
Setter
Tags:
Parameters:
method setXmlWordDocumentStyles [line 1516]
void setXmlWordDocumentStyles(
$xmlWordDocumentStyles)
|
|
Setter
Tags:
Parameters:
method setXmlWordEndnotes [line 1536]
void setXmlWordEndnotes(
$xmlWordEndnotes)
|
|
Setter
Tags:
Parameters:
method setXmlWordFontTable [line 1556]
void setXmlWordFontTable(
$xmlWordFontTable)
|
|
Setter
Tags:
Parameters:
method setXmlWordFooter1 [line 1576]
void setXmlWordFooter1(
$xmlWordFooter)
|
|
Setter
Tags:
Parameters:
method setXmlWordHeader1 [line 1596]
void setXmlWordHeader1(
$xmlWordHeader)
|
|
Setter
Tags:
Parameters:
method setXmlWordRelsDocumentRels [line 1616]
void setXmlWordRelsDocumentRels(
$xmlWordRelsDocumentRels)
|
|
Setter
Tags:
Parameters:
method setXmlWordSettings [line 1636]
void setXmlWordSettings(
$xmlWordSettings)
|
|
Setter
Tags:
Parameters:
method setXmlWordStyles [line 1656]
void setXmlWordStyles(
$xmlWordStyles)
|
|
Setter
Tags:
Parameters:
method setXmlWordThemeTheme1 [line 1676]
void setXmlWordThemeTheme1(
$xmlWordThemeTheme)
|
|
Setter
Tags:
Parameters:
method setXmlWordWebSettings [line 1696]
void setXmlWordWebSettings(
$xmlWordWebSettings)
|
|
Setter
Tags:
Parameters:
method transformDocx [line 5622]
void transformDocx(
string
$docSource, string
$docDestination, [string
$tempDir = null])
|
|
Transform DOCX to PDF, ODT, SXW, RTF, DOC, TXT, HTML or WIKI
Tags:
Parameters:
method transformDocxUsingMSWord [line 5643]
void transformDocxUsingMSWord(
$docSource
$docSource, $docDestination
$docDestination)
|
|
If PHPDocX is installed in a server with a working copy of Word 2007 or newer you may use it to do format conversions. Supported formats, DOCX and DOC to PDF, RTF, HTML and DOC
Tags:
Parameters:
method txt2docx [line 5657]
void txt2docx(
$text_filename, [array
$options = array()], string
$path.)
|
|
Insert the content of a text file into a word document trying to hold the styles
Tags:
Parameters:
method __toString [line 1346]
Magic method, returns current word XML
Tags:
Class Constants
|
|