Class CreateDocx

Description

Main class. Methods and vars to generate a DOCX file

Located in /CreateDocx.inc (line 33)


	
			
Class Constant Summary
 SCHEMA_IMAGEDOCUMENT = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image'
 SCHEMA_OFFICEDOCUMENT = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument'
Variable Summary
static int $intIdWord
static Logger $log
Method Summary
static void docx2txt ( $from, array $to, [ $options = array()], string $path.)
CreateDocx __construct ([string $extension = 'docx'])
void __destruct ()
void addBreak ([string $type = ''])
void addFont (array $fonts)
void addFooter ([string $dat = ''], [array $paramsFooter = ''])
void addGraphic (array $dats)
void addHeader ([string $text = 'Header'], [array $paramsHeader = ''])
void addImage ([array $dats = ''])
void addLink ([string $text = ''], [ $textLink = ''], [string $font = ''], string $link)
void addList (array $dats, [array $paramsList = ''])
void addMathDocx (string $path)
void addMathEq (string $eq)
void addParagraph (string $text, [string $style = ''], [string $align = ''])
void addTable (array $dats, [array $parameters = ''])
void addTableContents ([string $font = ''])
void addText (mixed $value, [array $style = ''])
void addTitle (string $text, [array $style = ''])
void createDocx (string $args[0], string $args[1])
void fAddBreak ([string $type = ''])
void fAddFont (array $fonts)
void fAddFooter ([string $dat = ''], [array $paramsFooter = ''])
void fAddGraphic (array $dats)
void fAddHeader ([string $text = 'Header'], [array $paramsHeader = ''])
void fAddImage ([array $dats = ''])
void fAddLink ([string $text = ''], [ $textLink = ''], [string $font = ''], string $link)
void fAddList (array $dats, [array $paramsList = ''])
void fAddMathDocx (string $path)
void fAddMathEq (string $eq)
void fAddParagraph (string $text, [string $style = ''], [string $align = ''])
void fAddTable (array $dats, [array $parameters = ''])
void fAddTableContents ([string $font = ''])
void fAddText (mixed $value, [array $style = ''])
void fAddTitle (string $text, [array $style = ''])
void fCreateDocx (string $args[0])
void fSetDefaultFont (string $font)
void getXmlRels_Rels ()
void setDefaultFont (string $font)
void setEncodeUTF8 ()
void setLanguage ([$lang $lang = 'en-US'])
void setXmlContentTypes ( $xmlContentTypes)
void setXmlDocPropsApp ( $xmlDocPropsApp)
void setXmlDocPropsCore ( $xmlDocPropsCore)
void setXmlRelsRels ( $xmlRelsRels)
void setXmlWordDocument ( $xmlWordDocument)
void setXmlWordEndnotes ( $xmlWordEndnotes)
void setXmlWordFontTable ( $xmlWordFontTable)
void setXmlWordFooter1 ( $xmlWordFooter)
void setXmlWordHeader1 ( $xmlWordHeader)
void setXmlWordRelsDocumentRels ( $xmlWordRelsDocumentRels)
void setXmlWordSettings ( $xmlWordSettings)
void setXmlWordStyles ( $xmlWordStyles)
void setXmlWordThemeTheme1 ( $xmlWordThemeTheme)
void setXmlWordWebSettings ( $xmlWordWebSettings)
string __toString ()
Variables
static int $intIdWord (line 47)
  • access: public
static Logger $log (line 66)
  • access: public
array $fileGraphicTemplate (line 59)
  • access: public
string $graphicTemplate (line 53)
  • access: public
Methods
static method docx2txt (line 1228)

Transform a word document to a text file

  • access: public
  • example: example not found
static void docx2txt ( $from, array $to, [ $options = array()], string $path.)
  • string $path.: Path to the text file output
  • array $to: styles. Declares if we want to change the default styles of phpdocx keys: table => true/false,list => true/false, paragraph => true/false, footnote => true/false, endnote => true/false, chart => (0=false,1=array,2=table)
  • $from
  • $options
Constructor __construct (line 359)

Construct

  • access: public
CreateDocx __construct ([string $extension = 'docx'])
  • string $extension: File extension. Optional, docx as default
Destructor __destruct (line 422)

Destruct

  • access: public
void __destruct ()
addBreak (line 726)

Add a break

  • access: public
void addBreak ([string $type = ''])
  • string $type: Break type Values: 'line', 'page'
addFont (line 739)

Add a new font

  • access: public
void addFont (array $fonts)
  • array $fonts: Fonts to add
addFooter (line 754)

Add a footer

  • access: public
void addFooter ([string $dat = ''], [array $paramsFooter = ''])
  • string $dat: Text to add
  • array $paramsFooter: Parameters of footer Values: 'pager' (true, false), 'pagerAlignment' (left, right, false)
addGraphic (line 781)

Add a graphic

  • access: public
void addGraphic (array $dats)
  • array $dats: Parameters of graphic Values: 'color' (1, 2, 3...), 'cornerP' (20, 30...), 'cornerX' (20, 30...), 'cornerY' (20, 30...), 'data' (array of values), 'font' (Arial, Times New Roman...), 'groupBar' (clustered, stacked), 'jc' (center, left, right), 'showPercent' (0, 1), 'sizeX' (10, 11, 12...), 'sizeY' (10, 11, 12...), 'textWrap' (0 (inline), 1 (square), 2 (front), 3 (back), 4 (up and bottom), 5 (clear)), 'title', 'type' (pieChart, barChart, colChart)
addHeader (line 849)

Add a header.

  • access: public
void addHeader ([string $text = 'Header'], [array $paramsHeader = ''])
  • string $text: Text to add
  • array $paramsHeader: Parameters of header
addImage (line 874)

Add an image

  • access: public
void addImage ([array $dats = ''])
  • array $dats: Image to add and paramaters to use Values: 'border'(1, 2, 3...), 'borderDiscontinuous' (0, 1), 'font' (Arial, Times New Roman...), 'jc' (center, left, right), 'name', 'scaling' (50, 100), 'sizeX' (10, 11, 12...), 'sizeY' (10, 11, 12...), spacingTop (10, 11...), spacingBottom (10, 11...), spacingLeft (10, 11...), spacingRight (10, 11...), 'textWrap' (0 (inline), 1 (square), 2 (front), 3 (back), 4 (up and bottom), 5 (clear))
addLink (line 933)

Add a link

  • access: public
void addLink ([string $text = ''], [ $textLink = ''], [string $font = ''], string $link)
  • string $text: Text to use as link
  • string $link: URL link
  • string $font: Type of font Values: 'Arial', 'Times New Roman'...
  • $textLink
addList (line 949)

Add a list

  • access: public
void addList (array $dats, [array $paramsList = ''])
  • array $dats: Values of the list
  • array $paramsList: Parameters to use Values: 'font' (Arial, Times New Roman...), 'val' (0 (clear, 1 (inordinate), 2(numerical))
addMathDocx (line 962)

Convert a math eq to DOCX

  • access: public
void addMathDocx (string $path)
  • string $path: Path to a file with math eq
addMathEq (line 978)

Add an existing math eq to DOCX

  • access: public
void addMathEq (string $eq)
  • string $eq: Math eq
addParagraph (line 993)

Add a paragraph

  • deprecated:
  • access: public
void addParagraph (string $text, [string $style = ''], [string $align = ''])
  • string $text: Text to add
  • string $style: Style of the paragraph
  • string $align: Align of the paragraph
addTable (line 1013)

Add a table.

  • access: public
void addTable (array $dats, [array $parameters = ''])
  • array $dats: Values to add
  • array $parameters: Parameters to use Values: 'border' (none, single, double), 'border_color' (ffffff, ff0000), 'border_spacing' (0, 1, 2...), 'border_sz' (10, 11...), 'font' (Arial, Times New Roman...), 'jc' (center, left, right), 'size_col' (1200, 1300...), 'TBLSTYLEval' (Cuadrculamedia3-nfasis1, Sombreadomedio1, Tablaconcuadrcula, TableGrid)
addTableContents (line 1027)

Add a table of contents (TOC)

  • access: public
void addTableContents ([string $font = ''])
  • string $font: Set font type Values: 'Arial', 'Times New Roman'...
addText (line 1047)

Add a text

  • access: public
void addText (mixed $value, [array $style = ''])
  • mixed $value: Text or array of texts to add
  • array $style: Style of text Values: 'b' (single), 'color' (ffffff, ff0000...), 'font' (Arial, Times New Roman...), 'i' (single), 'jc' (both, center, distribute, left, right), 'pageBreakBefore' (on, off), 'sz' (1, 2, 3...), 'u' (dash, dotted, double, single, wave, words), 'widowControl' (on, off), 'wordWrap' (on, off)
addTitle (line 1067)

Add a title

  • access: public
void addTitle (string $text, [array $style = ''])
  • string $text: Text to add
  • array $style: Style of title Values: 'b' (single), 'color' (ffffff, ff0000...), 'font' (Arial, Times New Roman...), 'i' (single), 'jc' (both, center, distribute, left, right), 'pageBreakBefore' (on, off), 'sz' (1, 2, 3...), 'u' (dash, dotted, double, single, wave, words), 'widowControl' (on, off), 'wordWrap' (on, off)
createDocx (line 1084)

Generate a new DOCX file

  • access: public
void createDocx (string $args[0], string $args[1])
  • string $args[0]: File name
  • string $args[1]: Page style Values: 'bottom' (4000, 4001...), 'left' (4000, 4001...), 'orient' (landscape), 'right' (4000, 4001), 'titlePage' (1), 'top' (4000, 4001)
fAddBreak (line 1275)

Add a break

  • deprecated:
  • access: public
void fAddBreak ([string $type = ''])
  • string $type: Break type
fAddFont (line 1289)

Add a new font

  • deprecated:
  • access: public
void fAddFont (array $fonts)
  • array $fonts: Fonts to add
fAddFooter (line 1304)

Add a footer

  • deprecated:
  • access: public
void fAddFooter ([string $dat = ''], [array $paramsFooter = ''])
  • string $dat: Text to add
  • array $paramsFooter: Parameters of footer
fAddGraphic (line 1325)

Add a graphic

  • deprecated:
  • access: public
void fAddGraphic (array $dats)
  • array $dats: Parameters of graphic
fAddHeader (line 1394)

Add a header.

  • deprecated:
  • access: public
void fAddHeader ([string $text = 'Header'], [array $paramsHeader = ''])
  • string $text: Text to add
  • array $paramsHeader: Parameters of header
fAddImage (line 1413)

Add an image

  • deprecated:
  • access: public
void fAddImage ([array $dats = ''])
  • array $dats: Image to add and paramaters to use
fAddLink (line 1472)

Add a link

  • deprecated:
  • access: protected
void fAddLink ([string $text = ''], [ $textLink = ''], [string $font = ''], string $link)
  • string $text: Text to use as link
  • string $link: URL link
  • string $font: Type of font
  • $textLink
fAddList (line 1487)

Add a list

  • deprecated:
  • access: public
void fAddList (array $dats, [array $paramsList = ''])
  • array $dats: Values of the list
  • array $paramsList: Parameters to use
fAddMathDocx (line 1501)

Convert a math eq to DOCX

  • deprecated:
  • access: public
void fAddMathDocx (string $path)
  • string $path: Path to a file with math eq
fAddMathEq (line 1518)

Add an existing math eq to DOCX

  • deprecated:
  • access: public
void fAddMathEq (string $eq)
  • string $eq: Math eq
fAddParagraph (line 1533)

Add a paragraph

  • deprecated:
  • access: public
void fAddParagraph (string $text, [string $style = ''], [string $align = ''])
  • string $text: Text to add
  • string $style: Style of the paragraph
  • string $align: Align of the paragraph
fAddTable (line 1548)

Add a table.

  • deprecated:
  • access: public
void fAddTable (array $dats, [array $parameters = ''])
  • array $dats: Values to add
  • array $parameters: Parameters to use
fAddTableContents (line 1562)

Add a table of contents (TOC)

  • deprecated:
  • access: public
void fAddTableContents ([string $font = ''])
  • string $font: Set font type
fAddText (line 1577)

Add a text

  • deprecated:
  • access: public
void fAddText (mixed $value, [array $style = ''])
  • mixed $value: Text or array of texts to add
  • array $style: Style of text
fAddTitle (line 1592)

Add a title

  • deprecated:
  • access: public
void fAddTitle (string $text, [array $style = ''])
  • string $text: Text to add
  • array $style: Style of title
fCreateDocx (line 1606)

Generate a new DOCX file

  • deprecated:
  • access: public
void fCreateDocx (string $args[0])
  • string $args[0]: File name
fSetDefaultFont (line 1748)

Change the default font

  • deprecated:
  • access: public
void fSetDefaultFont (string $font)
  • string $font: The new font
getXmlContentTypes (line 454)

Getter

  • access: public
void getXmlContentTypes ()
getXmlDocPropsApp (line 494)

Getter

  • access: public
void getXmlDocPropsApp ()
getXmlDocPropsCore (line 514)

Getter

  • access: public
void getXmlDocPropsCore ()
getXmlRels_Rels (line 474)

Getter

  • access: public
void getXmlRels_Rels ()
getXmlWordDocumentContent (line 534)

Getter

  • access: public
void getXmlWordDocumentContent ()
getXmlWordEndnotes (line 554)

Getter

  • access: public
void getXmlWordEndnotes ()
getXmlWordFontTable (line 574)

Getter

  • access: public
void getXmlWordFontTable ()
getXmlWordFooter1 (line 594)

Getter

  • access: public
void getXmlWordFooter1 ()
getXmlWordHeader1 (line 614)

Getter

  • access: public
void getXmlWordHeader1 ()
getXmlWordRelsDocumentRels (line 634)

Getter

  • access: public
void getXmlWordRelsDocumentRels ()
getXmlWordSettings (line 654)

Getter

  • access: public
void getXmlWordSettings ()
getXmlWordStyles (line 674)

Getter

  • access: public
void getXmlWordStyles ()
getXmlWordThemeTheme1 (line 694)

Getter

  • access: public
void getXmlWordThemeTheme1 ()
getXmlWordWebSettings (line 714)

Setter

  • access: public
void getXmlWordWebSettings ()
setDefaultFont (line 1241)

Change the default font

  • access: public
void setDefaultFont (string $font)
  • string $font: The new font Values: 'Arial', 'Times New Roman'...
setEncodeUTF8 (line 1251)

Transform to UTF-8 charset

  • access: public
void setEncodeUTF8 ()
setLanguage (line 1261)

Change default language.

  • access: public
void setLanguage ([$lang $lang = 'en-US'])
  • $lang $lang: Locale: en-US, es-ES...
setXmlContentTypes (line 444)

Setter

  • access: public
void setXmlContentTypes ( $xmlContentTypes)
  • $xmlContentTypes
setXmlDocPropsApp (line 484)

Setter

  • access: public
void setXmlDocPropsApp ( $xmlDocPropsApp)
  • $xmlDocPropsApp
setXmlDocPropsCore (line 504)

Setter

  • access: public
void setXmlDocPropsCore ( $xmlDocPropsCore)
  • $xmlDocPropsCore
setXmlRelsRels (line 464)

Setter

  • access: public
void setXmlRelsRels ( $xmlRelsRels)
  • $xmlRelsRels
setXmlWordDocument (line 524)

Setter

  • access: public
void setXmlWordDocument ( $xmlWordDocument)
  • $xmlWordDocument
setXmlWordEndnotes (line 544)

Setter

  • access: public
void setXmlWordEndnotes ( $xmlWordEndnotes)
  • $xmlWordEndnotes
setXmlWordFontTable (line 564)

Setter

  • access: public
void setXmlWordFontTable ( $xmlWordFontTable)
  • $xmlWordFontTable
setXmlWordFooter1 (line 584)

Setter

  • access: public
void setXmlWordFooter1 ( $xmlWordFooter)
  • $xmlWordFooter
setXmlWordHeader1 (line 604)

Setter

  • access: public
void setXmlWordHeader1 ( $xmlWordHeader)
  • $xmlWordHeader
setXmlWordRelsDocumentRels (line 624)

Setter

  • access: public
void setXmlWordRelsDocumentRels ( $xmlWordRelsDocumentRels)
  • $xmlWordRelsDocumentRels
setXmlWordSettings (line 644)

Setter

  • access: public
void setXmlWordSettings ( $xmlWordSettings)
  • $xmlWordSettings
setXmlWordStyles (line 664)

Setter

  • access: public
void setXmlWordStyles ( $xmlWordStyles)
  • $xmlWordStyles
setXmlWordThemeTheme1 (line 684)

Setter

  • access: public
void setXmlWordThemeTheme1 ( $xmlWordThemeTheme)
  • $xmlWordThemeTheme
setXmlWordWebSettings (line 704)

Setter

  • access: public
void setXmlWordWebSettings ( $xmlWordWebSettings)
  • $xmlWordWebSettings
__toString (line 433)

Magic method, returns current word XML

  • return: Return current word
  • access: public
string __toString ()
Class Constants
NAMESPACEWORD = 'w' (line 35)
SCHEMA_IMAGEDOCUMENT =
'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image'
(line 36)
SCHEMA_OFFICEDOCUMENT =
'http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument'
(line 38)

Documentation generated on Wed, 13 Jun 2012 12:09:40 +0200 by phpDocumentor 1.4.3