create
[ class tree: create ] [ index: create ] [ all elements ]

Class: CreateDocx

Source Location: /CreateDocx.inc

Class Overview

CreateDocument
   |
   --CreateDocx

Abstract class used for creating documents


Author(s):

Version:

  • 2.2

Copyright:

  • Copyright (c) 2009-2013 Narcea ProduCiones Multimedia S.L. (http://www.2mdc.com)

Variables

Constants

Methods


Child classes:

Phpdocx_Phpdocx
Abstract class used for creating documents

Class Details

[line 21]
Abstract class used for creating documents



Tags:

version:  2.2
copyright:  Copyright (c) 2009-2013 Narcea ProduCiones Multimedia S.L. (http://www.2mdc.com)


[ Top ]


Class Variables

static $bidi =

[line 35]



Tags:

access:  public

Type:   array


[ Top ]

static $customLists =

[line 56]



Tags:

access:  public

Type:   array


[ Top ]

static $intIdWord =

[line 114]



Tags:

access:  public

Type:   int


[ Top ]

static $log =

[line 121]



Tags:

access:  public

Type:   Logger


[ Top ]

static $numOL =

[line 69]



Tags:

access:  public

Type:   integer


[ Top ]

static $numUL =

[line 63]



Tags:

access:  public

Type:   integer


[ Top ]

static $orderedListStyle =

[line 76]



Tags:

access:  public

Type:   string


[ Top ]

static $PHPDOCXStyles =

[line 49]



Tags:

access:  public

Type:   string


[ Top ]

static $rtl =

[line 42]



Tags:

access:  public

Type:   array


[ Top ]

static $sectionProperties = array('w:footnotePr',
                                              'w:endnotePr',
                                              'w:type',
                                              'w:pgSz',
                                              'w:pgMar',
                                              'w:paperSrc',
                                              'w:pgBorders',
                                              'w:lnNumType',
                                              'w:pgNumType',
                                              'w:cols',
                                              'w:formProt',
                                              'w:vAlign',
                                              'w:noEndnote',
                                              'w:titlePg',
                                              'w:textDirection',
                                              'w:bidi',
                                              'w:rtlGutter',
                                              'w:docGrid',
                                              'w:printerSettings',
                                              'w:sectPrChange'
                                               )

[line 128]



Tags:

access:  public

Type:   array


[ Top ]

static $settings = array('w:writeProtection',
                                    'w:view',
                                    'w:zoom',
                                    'w:removePersonalInformation',
                                    'w:removeDateAndTime',
                                    'w:doNotDisplayPageBoundaries',
                                    'w:displayBackgroundShape',
                                    'w:printPostScriptOverText',
                                    'w:printFractionalCharacterWidth',
                                    'w:printFormsData',
                                    'w:embedTrueTypeFonts',
                                    'w:embedSystemFonts',
                                    'w:saveSubsetFonts',
                                    'w:saveFormsData',
                                    'w:mirrorMargins',
                                    'w:alignBordersAndEdges',
                                    'w:bordersDoNotSurroundHeader',
                                    'w:bordersDoNotSurroundFooter',
                                    'w:gutterAtTop',
                                    'w:hideSpellingErrors',
                                    'w:hideGrammaticalErrors',
                                    'w:activeWritingStyle',
                                    'w:proofState',
                                    'w:formsDesign',
                                    'w:attachedTemplate',
                                    'w:linkStyles',
                                    'w:stylePaneFormatFilter',
                                    'w:stylePaneSortMethod',
                                    'w:documentType',
                                    'w:mailMerge',
                                    'w:revisionView',
                                    'w:trackRevisions',
                                    'w:doNotTrackMoves',
                                    'w:doNotTrackFormatting',
                                    'w:documentProtection',
                                    'w:autoFormatOverride',
                                    'w:styleLockTheme',
                                    'w:styleLockQFSet',
                                    'w:defaultTabStop',
                                    'w:autoHyphenation',
                                    'w:consecutiveHyphenLimit',
                                    'w:hyphenationZone',
                                    'w:doNotHyphenateCaps',
                                    'w:showEnvelope',
                                    'w:summaryLength',
                                    'w:clickAndTypeStyle',
                                    'w:defaultTableStyle',
                                    'w:evenAndOddHeaders',
                                    'w:bookFoldRevPrinting',
                                    'w:bookFoldPrinting',
                                    'w:bookFoldPrintingSheets',
                                    'w:drawingGridHorizontalSpacing',
                                    'w:drawingGridVerticalSpacing',
                                    'w:displayHorizontalDrawingGridEvery',
                                    'w:displayVerticalDrawingGridEvery',
                                    'w:doNotUseMarginsForDrawingGridOrigin',
                                    'w:drawingGridHorizontalOrigin',
                                    'w:drawingGridVerticalOrigin',
                                    'w:doNotShadeFormData',
                                    'w:noPunctuationKerning',
                                    'w:characterSpacingControl',
                                    'w:printTwoOnOne',
                                    'w:strictFirstAndLastChars',
                                    'w:noLineBreaksAfter',
                                    'w:noLineBreaksBefore',
                                    'w:savePreviewPicture',
                                    'w:doNotValidateAgainstSchema',
                                    'w:saveInvalidXml',
                                    'w:ignoreMixedContent',
                                    'w:alwaysShowPlaceholderText',
                                    'w:doNotDemarcateInvalidXml',
                                    'w:saveXmlDataOnly',
                                    'w:useXSLTWhenSaving',
                                    'w:saveThroughXslt',
                                    'w:showXMLTags',
                                    'w:alwaysMergeEmptyNamespace',
                                    'w:updateFields',
                                    'w:hdrShapeDefaults',
                                    'w:footnotePr',
                                    'w:endnotePr',
                                    'w:compat',
                                    'w:docVars',
                                    'w:rsids',
                                    'm:mathPr',
                                    'w:uiCompat97To2003',
                                    'w:attachedSchema',
                                    'w:themeFontLang',
                                    'w:clrSchemeMapping',
                                    'w:doNotIncludeSubdocsInStats',
                                    'w:doNotAutoCompressPictures',
                                    'w:forceUpgrade',
                                    'w:captions',
                                    'w:readModeInkLockDown',
                                    'w:smartTagType',
                                    'sl:schemaLibrary',
                                    'w:shapeDefaults',
                                    'w:doNotEmbedSmartTags',
                                    'w:decimalSymbol',
                                    'w:listSeparator'
                                    )

[line 155]



Tags:

access:  public

Type:   array


[ Top ]

static $unorderedListStyle =

[line 83]



Tags:

access:  public

Type:   string


[ Top ]

$fileGraphicTemplate =

[line 89]



Tags:

access:  public

Type:   array


[ Top ]

$graphicTemplate =

[line 107]



Tags:

access:  public

Type:   string


[ Top ]



Class Methods


static method docx2txt [line 5764]

static void docx2txt( $from, array $to, [ $options = array()], string $path.)

Transform a word document to a text file



Tags:

access:  public
example:  example


Parameters:

string   $path.   Path to the text file output
array   $to   styles. 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  

[ Top ]

static method getTempDir [line 8512]

static string getTempDir( )

To add support of sys_get_temp_dir for PHP versions under 5.2.1



Tags:

access:  public


[ Top ]

static method setRTLOptions [line 7116]

static array setRTLOptions( array $options)

sets global right to left options for the different methods



Tags:

access:  public


Parameters:

array   $options  

[ Top ]

constructor __construct [line 724]

CreateDocx __construct( [ $baseTemplatePath = PHPDOCX_BASE_TEMPLATE], string $baseTemplatePath.)

Construct



Tags:

access:  public


Parameters:

string   $baseTemplatePath.   Optional, basicTemplate.docx as default
   $baseTemplatePath  

[ Top ]

destructor __destruct [line 1646]

void __destruct( )

Destruct



Tags:

access:  public


[ Top ]

method addBackgroundImage [line 2029]

void addBackgroundImage( string $path)

Adds a background image to the document



Tags:

access:  public
example:  example


Parameters:

string   $path  

[ Top ]

method addBasicHTML [line 2090]

void addBasicHTML( [string $html = '<html><body></body></html>'], [array $options = array()])



Tags:

deprecated:  
access:  public


Parameters:

string   $html  
array   $options  

[ Top ]

method addBookmark [line 2106]

void addBookmark( [array $options = array('type' => null, 'name' => null, 'rawWordML' => false)])

Adds a bookmart start or end tag



Tags:

access:  public
example:  example


Parameters:

array   $options   Values: 'type' (start, end) 'name' (string) 'rawWordML' (boolean)

[ Top ]

method addBreak [line 2149]

void addBreak( [string $options = array('type' => 'line', 'rawWordML' => false)])

Add a break



Tags:

access:  public
example:  example
example:  example
example:  example
example:  example
example:  example


Parameters:

string   $options   Values: 'type' (line, page, column) 'rawWordML' (boolean)

[ Top ]

method addChart [line 2231]

void addChart( [array $options = array('rawWordML' => false)])

Add a chart



Tags:

access:  public
example:  example
example:  example
example:  example
example:  example
example:  example
example:  example
example:  example
example:  example
example:  example
example:  example
example:  example
example:  example
example:  example
example:  example
example:  example
example:  example
example:  example
example:  example
example:  example


Parameters:

array   $options   Values: 'color' (1, 2, 3...) color scheme, 'perspective' (20, 30...), 'rotX' (20, 30...), 'rotY' (20, 30...), 'data' (array of values), 'float' (left, right, center) floating image. It only applies if textWrap is not inline (default value). 'font' (Arial, Times New Roman...), 'groupBar' (clustered, stacked, percentStacked), 'horizontalOffset' (int) given in emus (1cm = 360000 emus) '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)), 'verticalOffset' (int) given in emus (1cm = 360000 emus) 'title', 'type' (barChart, bar3DChart, bar3DChartCylinder, bar3DChartCone, bar3DChartPyramid, colChart, col3DChart, col3DChartCylinder, col3DChartCone, bar3DChartPyramid, pieChart, pie3DChart, lineChart, line3DChart, areaChart, area3DChart, radar, scatterChart, surfaceChart,ofpiechar, doughnut, bublechart) 'legendPos' (r, l, t, b, none), 'legendOverlay' (0, 1), 'border' (0, 1), 'haxLabel' horizontal axis label, 'vaxLabel' vertical axis label, 'showtable' (0, 1) shows the table of values, 'vaxLabelDisplay' (rotated, vertical, horizontal), 'haxLabelDisplay' (rotated, vertical, horizontal), 'hgrid' (0, 1, 2, 3), 'vgrid' (0, 1, 2, 3), 'style' this work only in radar charts. 'gapWidth' distance between the pie and the second chart(ofpiechart) 'secondPieSize' : size of the second chart(ofpiechart) 'splitType' how decide to split the values :auto(Default Split), cust(Custom Split), percent(Split by Percentage), pos(Split by Position), val(Split by Value) 'splitPos' split position , integer or float 'custSplit' array of index to split 'subtype' type of the second chart pie or bar 'explosion' distance between the diferents values 'holeSize' size of the hole in doughnut type 'symbol' array of symbols(scatter chart) 'symbolSize' the size of the simbols 'smooth' smooth the line (scatter chart) 'wireframe' boolean(surface chart)to remove content color and only leave the border colors 'showValue' (0,1) shows the values inside the chart 'showCategory' (0,1) shows the category inside the chart 'rawWordML' (boolean)

[ Top ]

method addComment [line 2320]

void addComment( [array $options = array('rawWordML' => false)])

Adds a comment



Tags:

access:  public
example:  example


Parameters:

array   $options   Values: 'textDocument'(mixed) a string of text to appear in the document body as anchor for the comment or an array with the text and associated text options 'textComment' (mixed) a string of text to be used as the comment text or a WordML fragment 'initials' (string) 'author' (string) 'date' (string) 'rawWordML' (boolean)

[ Top ]

method addDateAndHour [line 2455]

void addDateAndHour( [array $options = array( 'dateFormat' => 'dd/MM/yyyy H:mm:ss', 'rawWordML' => false)])

Adds date and hour to the Word document



Tags:

access:  public
example:  example


Parameters:

array   $options   Style options to apply to the date Values: 'b' (on, off) set to on for right to left languages 'bidi' (on, off) 'color' (ffffff, ff0000...) 'font' (Arial, Times New Roman...) 'i' (on, off) '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) 'lineSpacing' 120, 240 (standard), 480... 'indent_left' 100... 'indent_right' 100... 'rawWordML' (boolean) 'rtl' (on, off) set to on for right to left languages 'dateFormat (string) dd/MM/yyyy H:mm:ss (default value) One may define a customised format like dd' of 'MMMM' of 'yyyy' at 'H:mm (resulting in 20 of December of 2012 at 9:30)

[ Top ]

method addDOCX [line 2515]

void addDOCX( [array $options = array('matchSource' => true, 'rawWordML' => false, 'preprocess' => false)])

Embeds a DOCX.



Tags:

access:  public
example:  example


Parameters:

array   $options   Values: 'pathDOCX' (string) path to DOCX 'matchSource' (bool) if true (default value)tries to preserve as much as posible the styles of the docx to be included 'preprocess' (boolean) if true does some preprocessing on the docx file to add WARNING: beware that the docx to insert gets modified so please make a safeguard copy first 'rawWordML' (boolean)

[ Top ]

method addElement [line 2568]

Element addElement( string $type, [ $params = ''], array $parrams)

Add an element to embedd in other elements



Tags:

return:  object
deprecated:  
access:  public
example:  example
example:  example
example:  example


Parameters:

string   $type   Element type. Values: 'addImage', 'addGraphic', 'addLink', 'addTextBox', 'addText'
array   $parrams   Set of parameters. Values: same as elements
   $params  

[ Top ]

method addEndnote [line 2713]

void addEndnote( [ $options = array('rawWordML' => false)], array $options.)

Adds an endnote



Tags:

access:  public
example:  example
example:  example


Parameters:

array   $options.   Values: 'textDocument'(mixed) a string of text to appear in the document body or an array with the text and associated text options 'textEndnote' (mixed) a string of text to be used as the endnote text or a WordML fragment 'endnoteMark' (array) bidi, customMark, font, b, i, color, rtl 'referenceMark' (array) bidi, font, b, i, color, rtl 'rawWordML' (boolean)
   $options  

[ Top ]

method addFont [line 2850]

void addFont( array $fonts)

Add a new font



Tags:

access:  public


Parameters:

array   $fonts   Fonts to add

[ Top ]

method addFooter [line 2872]

void addFooter( $footers, array $footer, array 1)

Add a footer.



Tags:

access:  public
example:  example
example:  example
example:  example


Parameters:

array   $footer  
array   1   Values: 'default'(object) WordMLFragment 'even' (object) WordMLFragment 'first' (object) WordMLFragment
   $footers  

[ Top ]

method addFootnote [line 2980]

void addFootnote( [array $options = array('rawWordML' => false)])

Adds a footnote



Tags:

access:  public
example:  example
example:  example
example:  example


Parameters:

array   $options   Values: 'textDocument'(mixed) a string of text to appear in the document body or an array with the text and associated text options 'textFootnote' (mixed) a string of text to be used as the footnote text or a WordML fragment 'footnoteMark' (array) bidi, customMark, font, b, i, color, rtl 'referenceMark' (array) bidi, font, b, i, color, rtl 'rawWordML' (boolean)

[ Top ]

method addFormElement [line 3140]

void addFormElement( mixed $type, [array $options = array('rawWordML' => false)])

Add a Form element (text field, select or checkbox)



Tags:

access:  public
example:  example not found


Parameters:

mixed   $type   it can be 'textfield', 'checkbox' or 'select'
array   $options   Style options to apply to the text Values: 'b' (on, off) 'color' (ffffff, ff0000...) 'font' (Arial, Times New Roman...) 'i' (on, off) 'jc' (both, center, distribute, left, right) 'lineBreak' (before, after, both) 'columnBreak' (before, after, both) 'pageBreakBefore' (on, off) 'sz' (1, 2, 3...) 'u' (dash, dotted, double, single, wave, words) 'widowControl' (on, off) 'wordWrap' (on, off) 'lineSpacing' 120, 240 (standard), 480..., 'indent_left' 100..., 'indent_right' 100... 'rawWordML' (boolean) 'defaultValue' (mixed) a string of text for the textfield type, a boolean value for the checkbox type or an integer representing the index (0 based) for the options of a select form element 'selectOptions' (array) an array of options for the dropdown menu

[ Top ]

method addGraphic [line 3182]

void addGraphic( array $dats)

Add a graphic



Tags:

see:  CreateDocx::addChart()
deprecated:  Use addChart method
access:  public
example:  example
example:  example
example:  example
example:  example
example:  example
example:  example


Parameters:

array   $dats   Parameters of graphic Values: 'color' (1, 2, 3...), 'perspective' (20, 30...), 'rotX' (20, 30...), 'rotY' (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' (barChart, bar3DChart, colChart, col3DChart, pieChart, pie3DChart)

[ Top ]

method addGraphicImg [line 3262]

void addGraphicImg( [array $options = array('rawWordML' => false)])

Add a graphic image



Tags:

access:  public


Parameters:

array   $options   Values: 'color' (1, 2, 3, 4, 5), 'rotX' (20, 30...), 'data' (array of values), 'sizeX' (10, 11, 12...), 'sizeY' (10, 11, 12...), 'title', 'type' (barChart, bar3DChart,colChart, col3DChart, pieChart, pie3DChart) 'rawWordML' (boolean)

[ Top ]

method addGraphicTemplate [line 3294]

void addGraphicTemplate( array $options)

Add a graphic template. Replace placeholder with a graphic



Tags:

access:  public


Parameters:

array   $options   Values: same as charts

[ Top ]

method addHeader [line 3369]

void addHeader( array $headers)

Add a header.



Tags:

access:  public
example:  example
example:  example
example:  example


Parameters:

array   $headers   Values: 'default'(object) WordMLFragment 'even' (object) WordMLFragment 'first' (object) WordMLFragment

[ Top ]

method addHeading [line 3493]

void addHeading( string $text, [int $level = 1], [array $options = array('rawWordML' => false)])

Adds a heading to the Word document



Tags:

access:  public
example:  example


Parameters:

string   $text   the heading text
int   $level   can be 1 (default), 2,3, ...
array   $options   Style options to apply to the heading Values: 'bidi' (on, off) 'b' (on, off) 'caps' (on, off) display text in capital letters 'color' (ffffff, ff0000...) 'font' (Cambria (default), Arial, Times New Roman...) 'i' (on, off) 'indent_left' 100..., 'indent_right' 100... 'jc' (both, center, distribute, left, right) 'keepLines' (on, off) keep all paragraph lines on the same page 'keepNext' (on, off) keep in the same page the current paragraph with next paragraph 'lineSpacing' 120, 240 (standard), 360, 480, ... 'pageBreakBefore' (on, off) 'rawWordML' (boolean) 'rtl' (on, off) 'spacingBottom' (int) bottom margin in twentieths of a point 'spacingTop' (int) top margin in twentieths of a point 'sz' (8, 9, 10, ...) size in points 'u' (none, dash, dotted, double, single, wave, words) 'widowControl' (on, off) 'wordWrap' (on, off)

[ Top ]

method addHTML [line 3542]

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:

access:  public
example:  example
example:  example
example:  example


Parameters:

array   $options   Values: 'html' (string) 'rawWordML' (boolean)

[ Top ]

method addImage [line 3595]

void addImage( [array $data = ''])

Add an image



Tags:

access:  public
example:  example
example:  example


Parameters:

array   $data   Values: 'border'(int) 1, 2, 3... 'borderDiscontinuous' (0, 1) 'float' (left, right, center) floating image. It only applies if textWrap is not inline (default value). 'font' (string) Arial, Times New Roman... 'horizontalOffset' (int) given in emus (1cm = 360000 emus). Only applies if there is the image is not floating 'jc' (center, left, right, inside, outside) 'name' (string) path to a local image 'scaling' (int) 50, 100, .. 'sizeX' (int) 10, 11, 12... 'sizeY' (int) 10, 11, 12... 'dpi' (int) dots per inch 'spacingTop' (int) 10, 11... 'spacingBottom' (int) 10, 11... 'spacingLeft' (int) 10, 11... 'spacingRight' (int) 10, 11... 'textWrap' 0 (inline), 1 (square), 2 (front), 3 (back), 4 (up and bottom)) 'target' (string): document (default value), defaultHeader, firstHeader, evenHeader, defaultFooter, firstFooter, evenFooter, footnote, endnote, comment 'verticalOffset' (int) given in emus (1cm = 360000 emus) 'rawWordML' (boolean)

[ Top ]

method addLineNumbering [line 3686]

void addLineNumbering( [array $options = array()])

Adds line numbering



Tags:

access:  public
example:  example


Parameters:

array   $options   countBy (int) line number increments to display (default value is 1) start (int) initial line number (default value is 1) distance (int) separation in twentieths of a point between the number and the text (defaults to auto) restart (string) could be: continuous (default value: the numbering does not get restarted anywhere in the document), newPage (the numbering restarts at the beginning of every page) newSection (the numbering restarts at the beginning of every section)

[ Top ]

method addLink [line 3757]

void addLink( $text, [array $options = array('url' => '', 'font' => '', 'sz' => '', 'color' => '0000ff', 'u' => 'single', 'rawWordML' => false)])

Add a link



Tags:

see:  bookmarkName
access:  public
example:  example
example:  example


Parameters:

array   $options  
   $text  

[ Top ]

method addList [line 3822]

void addList( array $data, [array $options = array('rawWordML' => false)])

Add a list



Tags:

access:  public
example:  example
example:  example
example:  example
example:  example


Parameters:

array   $data   Values of the list
array   $options   Values: 'font' (string), Arial, Times New Roman, ... 'val' (mixed), 0 (clear), 1 (inordinate), 2(numerical) or the name of the created list 'rawWordML' (boolean)

[ Top ]

method addMacroFromDoc [line 3848]

void addMacroFromDoc( string $path)

Add a macro from a DOC



Tags:

access:  public


Parameters:

string   $path   Path to a file with macro

[ Top ]

method addMathDocx [line 3878]

void addMathDocx( string $path)

Convert a math eq to DOCX



Tags:

access:  public
example:  example


Parameters:

string   $path   Path to a file with math eq

[ Top ]

method addMathEq [line 3898]

void addMathEq( string $eq, [bool $rawWordML = false])

Add an existing math eq to DOCX



Tags:

access:  public
example:  example


Parameters:

string   $eq   Math eq
bool   $rawWordML  

[ Top ]

method addMathMML [line 3915]

void addMathMML( string $eq, [bool $rawWordML = false])

Convert a math MML eq to DOCX



Tags:

access:  public


Parameters:

string   $eq   Math eq
bool   $rawWordML  

[ Top ]

method addMergeField [line 3961]

void addMergeField( string $name, [array $mergeParameters = array()], [array $options = array('rawWordML' => false)], string $format)

Adds a merge field to the Word document



Tags:

access:  public
example:  example


Parameters:

string   $name  
array   $mergeParameters   Keys and values: 'format' (Caps, FirstCap, Lower, Upper) 'mappedField' (boolean) 'preserveFormat' (boolean) 'textAfter' string of text to include after the merge field 'textBefore' string of text to include before the merge field 'verticalFormat' (boolean)
string   $format  
array   $options   style options to apply to the field Keys and values: 'bidi' (on, off) 'b' (on, off) 'color' (ffffff, ff0000...) 'font' (Arial, Times New Roman...) 'i' (on, off) '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) 'lineSpacing' 120, 240 (standard), 480..., 'indent_left' 100..., 'indent_right' 100... 'rawWordML' (boolean) 'rtl' (on, off)

[ Top ]

method addMHT [line 4032]

void addMHT( [array $options = array('rawWordML' => false)])

Add a MHT file.



Tags:

access:  public
example:  example


Parameters:

array   $options   Values: 'pathMHT' (string) path to the MHT file 'rawWordML' (boolean)

[ Top ]

method addNewBaseTemplate [line 4070]

void addNewBaseTemplate( $path, $name, [ $overwrite = false], string $path., string $name., boolean $overwrite.)

Add a new base template into the templates folder.



Tags:

access:  public


Parameters:

string   $path.   Must be a valid path to an existing .docx, .dotx o .docm document
string   $name.   Must be a valid name for the new base template. It should include the extension
boolean   $overwrite.   Optional. If true overwrites any existing template with the given name
   $path  
   $name  
   $overwrite  

[ Top ]

method addObject [line 4103]

void addObject( [array $options = array('rawWordML' => false)])

Add an existing object (XLS or PPTX)



Tags:

todo:  Unfinished method
access:  public


Parameters:

array   $options   Values: 'path' (string) path to the object 'type' (string) object type: xlsx, pptx 'rawWordML' (boolean)

[ Top ]

method addPageBorders [line 4172]

void addPageBorders( [array $options = array()])

Adds page borders



Tags:

access:  public
example:  example


Parameters:

array   $options   (<side> stands for top, right, bootom or left) 'zOrder' (int) 'display' (string) posible values are:allPages (display page border on all pages, default value), firstPage(display page border on first page), notFirstPage (display page border on all pages except first) 'offsetFrom' (string) posible values are: page or text border-width (int) page border width in eigths of a point (default value is 4) border-color (string) hexadecimal color ('000000' (default), 'FF0000', ...) border-style (string) none, single, double, ... (default value is single) border-space (int) border spacing in points (default is 24) border-<side>-width (int) page border width in eighths of a point border-<side>-color (string) hexadecimal color ('000000' (default), 'FF0000', ...) border-<side>-style (string) none, single, double, ... (default value is single) border-<side>-space (int) border spacing in points (default is 24)

[ Top ]

method addPageNumber [line 4275]

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:

access:  public
example:  example
example:  example


Parameters:

mixed   $type   (String): numerical, alphabetical.
array   $options   Style options to apply to the numbering Values: 'bidi' (on, off) 'b' (on, off) 'color' (ffffff, ff0000...) 'font' (Arial, Times New Roman...) 'i' (on, off) '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) 'lineSpacing' 120, 240 (standard), 480..., 'indent_left' 100..., 'indent_right' 100... 'defaultValue' (int) 'rawWordML' (boolean) 'rtl' (on, off)

[ Top ]

method addParagraph [line 4326]

void addParagraph( array $parameters, array $options)

Adds a complex paragraph to a Word document



Tags:

see:  anchor) type bookmark: 'markerName' (string) type image: @see CreateDocx->addImage() 'position' (inline, left, right) types arc, curve, line, polyline, rect, roundrect, shape, oval: @see CreateDocx->addShape()
see:  CreateDocx->addText() 'spacingBottom' (int) bottom margin in points 'spacingTop'(int) top margin in points 'target' (string) document (default value), defaultHeader, firstHeader, evenHeader, defaultFooter, firstFooter, evenFooter. 'rawWordML' (boolean)
access:  public
example:  example
example:  example


Parameters:

array   $options  
array   $parameters   : values: 'type' (text, lineBreak, link, bookmark, image, footnote, endnote, arc, curve, line, polyline, rect, roundrect, shape, oval)

[ Top ]

method addProperties [line 4442]

void addProperties( array $values)

Add properties to document



Tags:

access:  public
example:  example


Parameters:

array   $values   Parameters to use Values: 'title', 'subject', 'creator', 'keywords', 'description', 'category', 'contentStatus', 'Manager','Company', 'custom' ('name' => array('type' => 'value'))

[ Top ]

method addRawWordML [line 4562]

void addRawWordML( string $wml)

Add a raw WordML



Tags:

deprecated:  See addWordML
access:  public


Parameters:

string   $wml   WordML to add

[ Top ]

method addRTF [line 4578]

void addRTF( [array $options = array('rawWordML' => false)])

Add a RTF file. Keep content and styles.



Tags:

access:  public
example:  example


Parameters:

array   $options   Values: 'pathRTF' (string) path to the RTF file 'rawWordML' (boolean)

[ Top ]

method addSection [line 4632]

void addSection( [string $sectionType = 'nextPage'], [array $paperType = 'custom'], [array $options = array()])

Adds a section



Tags:

access:  public
example:  example


Parameters:

string   $sectionType   sectionType (string): nextPage, nextColumn, continuous, evenPage, oddPage
array   $paperType   paperType (string): A4, A3, letter, legal, A4-landscape, A3-landscape, letter-landscape, legal-landscape, custom
array   $options   options Values: width (int): measurement in twips (twentieths of a point) height (int): measurement in twips (twentieths of a point) numberCols (int): number of columns orient (string): portrait, landscape marginTop (int): measurement in twips (twentieths of a point) marginRight (int): measurement in twips (twentieths of a point) marginBottom (int): measurement in twips (twentieths of a point) marginLeft (int): measurement in twips (twentieths of a point) marginHeader (int): measurement in twips (twentieths of a point) marginFooter (int): measurement in twips (twentieths of a point) gutter (int): measurement in twips (twentieths of a point) bidi (on, off) rtl (on, off)

[ Top ]

method addShape [line 4675]

void addShape( string $type, [array $options = array('rawWordML' => false)])

Add a shape



Tags:

access:  public
example:  example


Parameters:

string   $type   Type of shape to draw Values:arc, curve, line, polyline, rect, roundrect, shape, oval
array   $options   General options: 'width' in points 'height' in points 'position' (absolute, relative) 'margin-top' in points 'margin-left' in points 'z-index' integer 'strokecolor' (#ff0000, #00ffff, ...) 'strokeweight' (1.0pt, 3.5pt, ...) 'fillcolor' (#ff0000, #00ffff, ...) 'rawWordML' (boolean) Options for especific type: arc: 'startAngle' (0, 45, 90, ...), 'endAngle' (0, 45, 90, ...) line and curve: 'from' and 'to' (initial and final points in x,y format) curve: 'control1' (x,y), 'control2' (x,y) polyline: 'points' (x1,y1 x2,y2 ....) roundrect: 'arcsize' (0.5, 1.8, ...) shape: 'path' (VML path), 'coordsize' (x,y)

[ Top ]

method addSimpleField [line 4516]

void addSimpleField( $fieldName $fieldName, [ $type = 'general'], [string $format = ''], [array $options = array('rawWordML' => false)], string $type:)

Adds a simple field to the Word 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:

access:  public
example:  example not found


Parameters:

string   $type:   date, numeric or general.
string   $format  
array   $options   style options to apply to the field Values: 'bidi' (on, off) 'b' (on, off) 'color' (ffffff, ff0000...) 'font' (Arial, Times New Roman...) 'i' (on, off) '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) 'lineSpacing' 120, 240 (standard), 480..., 'indent_left' 100..., 'indent_right' 100... 'defaultValue' (mixed) 'doNotShadeFormData' (bool) 'updateFields' (bool) 'rawWordML' (boolean) 'rtl' (on, off)
$fieldName   $fieldName   the field value. Available fields are: AUTHOR, COMMENTS, DOCPROPERTY, FILENAME, FILESIZE, KEYWORDS, LASTSAVEDBY, NUMCHARS, NUMPAGES, NUMWORDS, SUBJECT, TEMPLATE, TITLE
   $type  

[ Top ]

method addStructuredDocumentTag [line 4720]

void addStructuredDocumentTag( mixed $type, [array $options = array('rawWordML' => false)])

Add a Structured Document Tag



Tags:

access:  public
example:  example not found


Parameters:

mixed   $type   it can be 'comboBox', 'date', 'dropDownList' or 'richText'
array   $options   Style options to apply to the text Values: 'b' (on, off) 'color' (ffffff, ff0000...) 'font' (Arial, Times New Roman...) 'i' (on, off) 'jc' (both, center, distribute, left, right) 'lineBreak' (before, after, both) 'columnBreak' (before, after, both) 'pageBreakBefore' (on, off) 'sz' (1, 2, 3...) 'u' (dash, dotted, double, single, wave, words) 'widowControl' (on, off) 'wordWrap' (on, off) 'lineSpacing' 120, 240 (standard), 480..., 'indent_left' 100..., 'indent_right' 100... 'placeholderText (string) text to be shown by default 'alias' (string) the label that will be shown by the structured document tag 'lock' (string) locking properties: sdtLocked (cannot be deleted), contentLocked (contents can not be edited directly), unlocked (default value: no locking) and sdtContentLocked (contents can not be directyly edited or the structured tag removed) 'tag' (string) a programmatic tag 'temporary (boolean) if true the structured tag is removed after editing 'rawWordML' (boolean) 'listItems' (array) an array of arrays each one of them containing the text to show and value

[ Top ]

method addSubDocument [line 4751]

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:

access:  public


Parameters:

string   $path   path to the subdocument
string   $destination   path to where the subdocument should be stored if empty is assumed to remain in its original folder
   $originalPath  

[ Top ]

method addTable [line 4828]

void addTable( array $tableData, [array $tableProperties = array('rawWordML' => false)], [array $rowProperties = array()])

Add a table.



Tags:

access:  public
example:  example
example:  example
example:  example
example:  example


Parameters:

array   $tableData   an array of arrays with the table data organized by rows Each cell content may be a string, WordMLFragment or array. If the cell contents are in the form of an array its keys and posible values are: 'value' (mixed) a string or WordMLFragment 'rowspan' (int) 'colspan' (int) 'width' (int) in twentieths of a point 'border' (none, single, double, dashed, threeDEngrave, threeDEmboss, outset, inset) 'border_color' (ffffff, ff0000) 'border_spacing' (0, 1, 2...) 'border_sz' (10, 11...) in eights of a point 'border_<side>' (none, single, double, dashed, threeDEngrave, threeDEmboss, outset, inset) where the side may be: top, left, right or bottom 'border_<side>_color' (ffffff, ff0000) 'border_<side>_spacing' (0, 1, 2...) 'border_<side>_sz' (10, 11...) 'background_color' (ffffff, ff0000) 'noWrap' (boolean) 'cellMargin' (mixed) an integer value or an array: 'top' (int) in twentieths of a point 'right' (int) in twentieths of a point 'bottom' (int) in twentieths of a point 'left' (int) in twentieths of a point 'textDirection' (string) available values are: tbRl and btLr 'fitText' (boolean) if true fits the text to the size of the cell 'vAlign' (string) vertical align of text: top, center, both or bottom
array   $tableProperties   Parameters to use Values: 'bidi' (on, off) set it to on for right to left languages 'border' (none, single, double, dashed, threeDEngrave, threeDEmboss, outset, inset) 'border_color' (ffffff, ff0000) 'border_spacing' (0, 1, 2...) 'border_sz' (10, 11...) in eights of a point 'border_settings' (all, outside, inside) if all (default value) the border styles apply to all table borders. If the value is set to outside or inside the border styles will only apply to the outside or inside boreders respectively. 'cantSplitRows' (boolean) set global row split properties (can be overriden by rowProperties) 'cellMargin' (array) the keys are top, right, bottom and left and the values is given in twips (twentieths of a point) 'cellSpacing' (int) given in twips (twentieths of a point) 'float' (array) with the following keys and values: 'textMargin_top' (int) in twentieths of a point 'textMargin_right' (int) in twentieths of a point 'textMargin_bottom' (int) in twentieths of a point 'textMargin_left' (int) in twentieths of a point 'align' (string) posible values are: left, center, right, outside, inside 'font' (Arial, Times New Roman...) 'indent' (int) given in twips (twentieths of a point) 'jc' (center, left, right) 'decimalTab' 'size_col': column width fix (int) column width variable (array) 'tableWidth' (array) its posible keys and values are: 'type' (pct, dxa) pct if the value refers to percentage and dxa if the value is given in twentieths of a point (twips) 'value' (int) 'TBLSTYLEval' (string) Word table style 'rawWordML' (boolean)
array   $rowProperties   (array) a cero based array. Each entry is an array with keys and values: 'cantSplit' (boolean) 'minHeight' (int) in twentieths of a point 'height' (int) in twentieths of a point 'tblHeader' (boolean) if true this row repeats at the beguinning of each new page

[ Top ]

method addTableContents [line 4872]

void addTableContents( [array $options = array()], [(array) $legend = array()], [(string) $stylesTOC = ''])

Add a table of contents (TOC)



Tags:

access:  public
example:  example


Parameters:

array   $options   Values: 'autoUpdate' (boolean) if true it will try to update the TOC when first opened 'displayLevels' (string) must be of the form '1-3' where the first number is the start level an the second the end level. If not defined all existing levels are shown
(array)   $legend   Values: 'pStyle' (string) Word style to be used. Run parseStyles() to check all available paragraph styles 'b' (on, off) 'color' (ffffff, ff0000...) 'font' (Arial, Times New Roman...) 'i' (on, off) 'indent_left' 100..., 'indent_right' 100... 'jc' (both, center, distribute, left, right) 'keepLines' (on, off) keep all paragraph lines on the same page 'keepNext' (on, off) keep in the same page the current paragraph with next paragraph 'lineSpacing' 120, 240 (standard), 480..., 'pageBreakBefore' (on, off) 'sz' (8, 9, 10, ...) 'text' (string) 'u' (none, dash, dotted, double, single, wave, words) 'widowControl' (on, off) 'wordWrap' (on, off)
(string)   $stylesTOC   path to the docx with the required styles for the Table of Contents

[ Top ]

method addTemplate [line 4910]

void addTemplate( string $path)

Add a DOCX file as a template



Tags:

access:  public
example:  example
example:  example
example:  example
example:  example
example:  example
example:  example
example:  example
example:  example
example:  example
example:  example


Parameters:

string   $path   Path to the template file

[ Top ]

method addTemplateChart [line 4937]

void addTemplateChart( string $var, string $chart)

Replace a variable with a chart.



Tags:

access:  public
example:  example


Parameters:

string   $var   Value of the variable
string   $chart   Chart to add Values: same as charts.

[ Top ]

method addTemplateCheckBox [line 4954]

void addTemplateCheckBox( string $var, [string $value = false])

Replace a variable with a checkbox.



Tags:

access:  public
example:  example


Parameters:

string   $var   Value of the variable. String
string   $value  

[ Top ]

method addTemplateImage [line 4975]

void addTemplateImage( string $var, string $pathImage, [array $options = array()])

Replace a variable image template with a new image.



Tags:

access:  public
example:  example


Parameters:

string   $var   Value of the variable
string   $pathImage   Path of the new image
array   $options   Values: width (mixed): the value in cm (float) or 'auto' (use image size) height (mixed): the value in cm (float) or 'auto' (use image size) dpi (int): dots per inch. This parameter is only taken into account if width or height are set to auto. If any of these parameters is not set the width and/or height of the placeholder image will be preserved

[ Top ]

method addTemplateVariable [line 4998]

void addTemplateVariable( mixed $var, [string $value = ''], [mixed $settings = ''])

Replace a variable with a text, HTML, DOCX, RTF, MHT.



Tags:

access:  public
example:  example
example:  example


Parameters:

mixed   $var   Value of the variable. String, html or array of values
string   $value   Text value, type of value, CSS or text array Values type of template: list, table,
mixed   $settings   Template settings or content type Content types: html, rtf, docx, mht

[ Top ]

method addText [line 5068]

void addText( mixed $textParams, [array $paragraphParams = array('rawWordML' => false)])

Add a text



Tags:

access:  public
example:  example
example:  example
example:  example
example:  example
example:  example
example:  example
example:  example
example:  example


Parameters:

mixed   $textParams   if a string just the text to be included, if an array is or an array of arrays with each element containing the text to be inserted and their formatting properties or a an instance of WordMLFragment Array values: 'text' (string) the run of text to be inserted 'b' (on, off) 'caps' (on, off) display text in capital letters 'color' (ffffff, ff0000...) 'columnBreak' (before, after, both) inserts a column break before, after or both, a run of text 'font' (Arial, Times New Roman...) 'i' (on, off) 'lineBreak' (before, after, both) inserts a line break before, after or both, a run of text 'sz' (1, 2, 3...) 'tab' (boolean) inserts a tab. Default value is false 'spaces': number of spaces at the beguinning of the run of text 'u' (none, dash, dotted, double, single, wave, words) 'rtl' (on, off)
array   $paragraphParams   Style options to apply to the whole paragraph Values: 'pStyle' (string) Word style to be used. Run parseStyles() to check all available paragraph styles 'b' (on, off) 'bidi' (on, off) 'caps' (on, off) display text in capital letters 'color' (ffffff, ff0000...) 'contextualSpacing' (on, off) ignore spacing above and below when using identical styles 'firstLineIndent' 100, 200, ... 'font' (Arial, Times New Roman...) 'hanging' 100, 200, ... 'i' (on, off) 'indent_left' 100..., 'indent_right' 100... 'jc' (both, center, distribute, left, right) 'keepLines' (on, off) keep all paragraph lines on the same page 'keepNext' (on, off) keep in the same page the current paragraph with next paragraph 'lineSpacing' 120, 240 (standard), 360, 480, ... 'pageBreakBefore' (on, off) 'rawWordML' (boolean) 'rtl' (on, off) 'spacingBottom' (int) bottom margin in twentieths of a point 'spacingTop' (int) top margin in twentieths of a point 'sz' (8, 9, 10, ...) size in points 'tabPositions' (array) each entry is an associative array with the following keys and values 'type' (string) can be clear, left (default), center, right, decimal, bar and num 'leader' (string) can be none (default), dot, hyphen, underscore, heavy and middleDot 'position' (int) given in twentieths of a point if there is a tab and the tabPositions array is not defined the standard tab position (default of 708) will be used 'textDirection' (lrTb, tbRl, btLr, lrTbV, tbRlV, tbLrV) text flow direction 'u' (none, dash, dotted, double, single, wave, words) 'widowControl' (on, off) 'wordWrap' (on, off)

[ Top ]

method addTextBox [line 5107]

void addTextBox( array $text, [array $options = array('rawWordML' => false)])

Add a textbox



Tags:

access:  public
example:  example
example:  example


Parameters:

array   $text   these are the same parameters used in the addText method The first array entry is the text to be included in the text box, the second one is itself another array with all the standard text formatting options
array   $options   includes the specific textbox options Values: 'border' (int) 'border_color (string) color (black, red,...) or hexadecimal value (#ff0000, #0000ff, ...) 'align' (center, left, right) 'fillcolor' (string) color (black, red,...) or hexadecimal value (#ff0000, #0000ff, ...) 'width' (float) width in cm 'height' (float) height in cm 'textWrap' (tight, square, through, none) 'margin_left' (float) distance in cm 'margin_top' (float) distance in cm 'padding_bottom' (float) distance in cm 'padding_left' (float) distance in cm 'padding_right' (float) distance in cm 'padding_top' (float) distance in cm 'rawWordML' (boolean)

[ Top ]

method addWordML [line 5130]

void addWordML( [array $options = array('rawWordML' => false)])

Adds WordML to the document.



Tags:

access:  public
example:  example


Parameters:

array   $options   Values: 'wordML' (string) WordML to add 'rawWordML' (boolean)

[ Top ]

method cleanTemplateVariable [line 5147]

void cleanTemplateVariable( string $variableName, [string $type = 'block'])



Tags:

access:  public


Parameters:

string   $variableName  
string   $type   can be 'block'(default value): removes the containing paragraph or 'inline': just removes the variable.

[ Top ]

method cleanWordMLBlockElements [line 5163]

void cleanWordMLBlockElements( $wordML)

Eliminates all block type elements from a WordML string



Tags:

access:  public


Parameters:

   $wordML  

[ Top ]

method clearBlocks [line 5189]

void clearBlocks( )

Clear all BLOCK tags



Tags:

access:  public


[ Top ]

method createDocx [line 5207]

void createDocx( string $args[0], string $args[1])

Generate a new DOCX file



Tags:

access:  public
example:  example
example:  example


Parameters:

string   $args[0]   File name
string   $args[1]   Page style Values: 'bottom' (4000, 4001...), 'columns' (1, 2, 3), 'left' (4000, 4001...), 'orient' (landscape), 'right' (4000, 4001), 'titlePage' (1), 'top' (4000, 4001)

[ Top ]

method createDocxAndDownload [line 5558]

void createDocxAndDownload( string $args[0], string $args[1], string $args[2])

Generate and download a new DOCX file



Tags:

access:  public


Parameters:

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)
string   $args[2]   Download file name

[ Top ]

method createListStyle [line 7228]

void createListStyle( string $name, [array $listOptions = array()])

Create a new style to use in your Word document.



Tags:

access:  public
example:  example


Parameters:

string   $name   the name we want to give to the created list
array   $listOptions   an array with the different styling options for each level: 'type' can be decimal, lowerLetter, .... 'font' Symbol, Courier new, Wingdings, ... 'format' the default one is '%1.' for firs level, '%2' for second level and so long so forth 'hanging' the extra space for the numbering, should be big enough to accomodate it, the default is 360 'left' the left indent. The default value is 720 times the list level

[ Top ]

method createParagraphStyle [line 7280]

void createParagraphStyle( string $name, [mixed $styleOptions = array()])

Create a new paragraph style and linked char style to be used in your Word document.



Tags:

access:  public
example:  example


Parameters:

string   $name   the name we want to give to the created style
mixed   $styleOptions   it includes the required style options Array values: 'b' (on, off) 'border' (on, off) if "on" you may set: border-width (int) page border width in eigths of a point (default value is 4) border-color (string) hexadecimal color ('000000' (default), 'FF0000', ...) border-style (string) none, single, double, ... (default value is single) border-space (int) border spacing in points (default is 24) border-<side>-width (int) page border width in eights of a point border-<side>-color (string) hexadecimal color ('000000' (default), 'FF0000', ...) border-<side>-style (string) none, single, double, ... (default value is single) border-<side>-space (int) border spacing in points (default is 24) 'caps' (on, off) display text in capital letters 'color' (ffffff, ff0000...) 'contextualSpacing' (on, off) ignore spacing above and below when using identical styles 'font' (Arial, Times New Roman...) 'hanging' 100, .... 'i' (on, off) 'indent_left' 100..., 'indent_right' 100... 'indent_firstLine' 100, ... 'jc' (both, center, distribute, left, right) 'keepLines' (on, off) keep all paragraph lines on the same page 'keepNext' (on, off) keep in the same page the current paragraph with next paragraph 'lineSpacing' 120, 240 (standard), 360, 480, ... 'outlineLvl' (int) heading level (1-9) 'pageBreakBefore' (on, off) 'spacingBottom' (int) bottom margin in twentieths of a point 'spacingTop' (int) top margin in twentieths of a point 'smallCaps' (on, off) display text in small caps 'sz' (8, 9, 10, ...) size in points 'textDirection' (lrTb, tbRl, btLr, lrTbV, tbRlV, tbLrV) text flow direction 'u' (none, dash, dotted, double, single, wave, words) 'widowControl' (on, off) 'wordWrap' (on, off)

[ Top ]

method createWordMLFragment [line 7329]

void createWordMLFragment( $data, mixed $data,)

Creates a WordML fragment.



Tags:

access:  public
example:  example
example:  example


Parameters:

mixed   $data,   string or array
   $data  

[ Top ]

method deleteTemplateBlock [line 5607]

void deleteTemplateBlock( string $blockName)

Delete a block of content markep up between BLOCK tags



Tags:

access:  public


Parameters:

string   $blockName   Block to remove

[ Top ]

method disableDebug [line 5619]

void disableDebug( )

Disable debug mode



Tags:

deprecated:  
access:  public


[ Top ]

method docxSettings [line 5659]

void docxSettings( array $settingParameters)

Stablish the general docx settings in settings.xml



Tags:

access:  public
example:  example not found


Parameters:

array   $settingParameters   settings Keys and values: 'view' (string): none(default), print, outline, masterPages, normal (draft view), web 'zoom'(mixed): a percentage or none, fullPage (display one full page), bestFit (display page width), textFit (display text width) 'mirrorMargins' (bool) if true interchanges inside and outside margins in odd and even pages 'bordersDoNotSurroundHeader' (bool) 'bordersDoNotSurroundFooter' (bool) 'gutterAtTop' (bool) 'hideSpellingErrors' (bool) 'hideGrammaticalErrors' (bool) 'documentType' (string): notSpecified (default), letter, eMail 'trackRevisions' (bool) 'defaultTabStop'(int) in twips (twentieths of a point) 'autoHyphenation' (bool) 'consecutiveHyphenLimit'(int): maximum number of consecutively hyphenated lines 'hyphenationZone' (int) distance in twips (twentieths of a point) 'doNotHyphenateCaps' (bool): do not hyphenate capital letters 'defaultTableStyle' (string): the table style to be used by default 'bookFoldRevPrinting' (bool): reverse book fold printing 'bookFoldPrinting' (bool): book fold printing 'bookFoldPrintingSheets' (int): number of pages per booklet 'doNotShadeFormData' (bool) 'noPunctuationKerning' (bool): never kern punctuation characters 'printTwoOnOne' (bool): print two pages per sheet 'savePreviewPicture' (bool): generate thumbnail for document on save 'updateFields' (bool): automatically recalculate fields on open

[ Top ]

method embedHTML [line 5795]

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:

access:  public
example:  example
example:  example
example:  example


Parameters:

string   $html   HTML to add. Must be a valid XHTML
array   $options:   isFile (boolean), baseURL (string), customListStyles (bool) if true try to use the predefined customm lists downloadImages (boolean), filter (string) could be an string denoting the id, class or tag to be filtered. If you want only a class introduce .classname, #idName for an id or <htmlTag> for a particular tag. One can also use standard XPath expresions supported by PHP. 'parseAnchors' (boolean), 'parseDivs' (paragraph, table): parses divs as paragraphs or tables, 'parseFloats' (boolean), 'strictWordStyles' (boolean) if true ignores all CSS styles and uses the styles set via the wordStyles option (see next) 'wordStyles' (array) associates a particular class, id or HTML tag to a Word style 'target' (string) document (default value), defaultHeader, firstHeader, evenHeader, defaultFooter, firstFooter, evenFooter, footnote, endnote and or comment. 'rawWordML' (boolean)
   $options  

[ Top ]

method enableCompatibilityMode [line 5840]

void enableCompatibilityMode( )

Enable compatibility mode for OpenOffice and MS Office 2003 CP. Avoid using unsupported methods



Tags:

access:  public


[ Top ]

method enableDebug [line 5852]

void enableDebug( )

Enable debug mode



Tags:

deprecated:  
access:  public


[ Top ]

method generateBaseWordNumbering [line 8949]

void generateBaseWordNumbering( )

creates an empty word numbering base string



Tags:

access:  public


[ Top ]

method getExtension [line 1678]

void getExtension( )

Getter



Tags:

access:  public


[ Top ]

method getTemplateVariables [line 5865]

array getTemplateVariables( )

Return template variables (placeholders)



Tags:

access:  public
example:  example


[ Top ]

method getTemplateXML [line 5878]

array getTemplateXML( )

Return the XML of the given Template



Tags:

access:  public


[ Top ]

method getTemporaryDirectory [line 1697]

void getTemporaryDirectory( )

Getter



Tags:

access:  public


[ Top ]

method getXmlContentTypes [line 1717]

void getXmlContentTypes( )

Getter



Tags:

access:  public


[ Top ]

method getXmlDocPropsApp [line 1757]

void getXmlDocPropsApp( )

Getter



Tags:

access:  public


[ Top ]

method getXmlDocPropsCore [line 1777]

void getXmlDocPropsCore( )

Getter



Tags:

access:  public


[ Top ]

method getXmlDocPropsCustom [line 1797]

void getXmlDocPropsCustom( )

Getter



Tags:

access:  public


[ Top ]

method getXmlRelsRels [line 1737]

void getXmlRelsRels( )

Getter



Tags:

access:  public


[ Top ]

method getXmlWordDocumentContent [line 1817]

void getXmlWordDocumentContent( )

Getter



Tags:

access:  public


[ Top ]

method getXmlWordDocumentStyles [line 1837]

void getXmlWordDocumentStyles( )

Getter



Tags:

access:  public


[ Top ]

method getXmlWordEndnotes [line 1857]

void getXmlWordEndnotes( )

Getter



Tags:

access:  public


[ Top ]

method getXmlWordFontTable [line 1877]

void getXmlWordFontTable( )

Getter



Tags:

access:  public


[ Top ]

method getXmlWordFooter1 [line 1897]

void getXmlWordFooter1( )

Getter



Tags:

access:  public


[ Top ]

method getXmlWordHeader1 [line 1917]

void getXmlWordHeader1( )

Getter



Tags:

access:  public


[ Top ]

method getXmlWordRelsDocumentRels [line 1937]

void getXmlWordRelsDocumentRels( )

Getter



Tags:

access:  public


[ Top ]

method getXmlWordSettings [line 1957]

void getXmlWordSettings( )

Getter



Tags:

access:  public


[ Top ]

method getXmlWordStyles [line 1977]

void getXmlWordStyles( )

Getter



Tags:

access:  public


[ Top ]

method getXmlWordThemeTheme1 [line 1997]

void getXmlWordThemeTheme1( )

Getter



Tags:

access:  public


[ Top ]

method getXml_Word_WebSettings [line 2017]

void getXml_Word_WebSettings( )

Setter



Tags:

access:  public


[ Top ]

method importFontTableXML [line 6091]

void importFontTableXML( $path, string $path.)

Imports an existing fontTable.xml file from an existing docx document.



Tags:

access:  public


Parameters:

string   $path.   Must be a valid path to an existing .docx, .dotx o .docm document
   $path  

[ Top ]

method importHeadersAndFooters [line 8974]

void importHeadersAndFooters( $path, [ $type = 'headerAndFooter'], string $path., string $type.)

Inserts new headers and/or footers from a word file.



Tags:

access:  public
example:  example


Parameters:

string   $path.   Path to the docx from which we wish to import the header and/or footer
string   $type.   Declares if we want to import only the header, only the footer or both. Values: header, footer, headerAndFooter (default value)
   $path  
   $type  

[ Top ]

method importSettingsXML [line 6072]

void importSettingsXML( $path, string $path.)

Imports an existing settings.xml file from an existing docx document.



Tags:

access:  public


Parameters:

string   $path.   Must be a valid path to an existing .docx, .dotx o .docm document
   $path  

[ Top ]

method importSingleNumbering [line 8925]

void importSingleNumbering( string $numberingsXML, string $newNumbering, string $numberId, [ $originalAbstractNumId = ''])

Inserts a new numbering style.



Tags:

access:  public


Parameters:

string   $numberingsXML   the numberings.xml that we wish to modify
string   $newNumbering   the new numbering style we wish to add.
string   $numberId   a unique integer that determines the numbering id and the abstract numbering id
   $originalAbstractNumId  

[ Top ]

method importStyles [line 5898]

void importStyles( $path, [ $type = 'replace'], [ $myStyles = array()], [ $styleIdentifier = 'styleName'], string $path., string $type., array $myStyles.)

Imports an existing style sheet from an existing docx document.



Tags:

access:  public
example:  example


Parameters:

string   $path.   Must be a valid path to an existing .docx, .dotx o .docm document
string   $type.   You may choose 'replace' (overwrites the current styles) or 'merge' (adds the selected styles)
array   $myStyles.   A list of specific styles to be merged. If it is empty or the choosen type is 'replace' it will be ignored.
   $path  
   $type  
   $myStyles  
   $styleIdentifier  

[ Top ]

method importThemeXML [line 6034]

void importThemeXML( $path, string $path.)

Imports an existing theme from an existing docx document.



Tags:

access:  public


Parameters:

string   $path.   Must be a valid path to an existing .docx, .dotx o .docm document
   $path  

[ Top ]

method importWebSettingsXML [line 6053]

void importWebSettingsXML( $path, string $path.)

Imports an existing webSettings.xml file from an existing docx document.



Tags:

access:  public


Parameters:

string   $path.   Must be a valid path to an existing .docx, .dotx o .docm document
   $path  

[ Top ]

method modifyInputFields [line 6111]

void modifyInputFields( array $data)

Modify the value of a series of input fields.



Tags:

access:  public
example:  example


Parameters:

array   $data   With the key, the name of the variable and the value the value of the input text

[ Top ]

method modifyPageLayout [line 6140]

void modifyPageLayout( [array $paperType = 'letter'], [array $options = array()])

Modify page layout



Tags:

access:  public
example:  example not found


Parameters:

array   $paperType   paperType (string): A4, A3, letter, legal, A4-landscape, A3-landscape, letter-landscape, legal-landscape, custom
array   $options   options Values: width (int): measurement in twips (twentieths of a point) height (int): measurement in twips (twentieths of a point) numberCols (int): integer orient (string): portrait, landscape marginTop (int): measurement in twips (twentieths of a point) marginRight (int): measurement in twips (twentieths of a point) marginBottom (int): measurement in twips (twentieths of a point) marginLeft (int): measurement in twips (twentieths of a point) marginHeader (int): measurement in twips (twentieths of a point) marginFooter (int): measurement in twips (twentieths of a point) gutter (int): measurement in twips (twentieths of a point) bidi (on, off): set to 'on' for right to left languages rtlGutter (on, off): set to 'on' for right to left languages

[ Top ]

method parseStyles [line 6441]

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 available paragraph, list and table styles.




Tags:

access:  public
example:  example


Parameters:

string   $path.   Optional, if empty lists the Ids of the current style sheet
   $path  

[ Top ]

method readDOCX [line 6730]

void readDOCX( string $path)

Parse DOCX file and extract content



Tags:

access:  public
example:  example


Parameters:

string   $path   Path to DOCX file

[ Top ]

method removeFooters [line 8844]

void removeFooters( )

Removes existing footers.



Tags:

access:  public


[ Top ]

method removeHeaders [line 8796]

void removeHeaders( )

Removes existing headers.



Tags:

access:  public


[ Top ]

method removeHeadersAndFooters [line 8786]

void removeHeadersAndFooters( )

Removes headers and footers.



Tags:

access:  public


[ Top ]

method replaceHeaderImage [line 6750]

void replaceHeaderImage( string $var, string $pathImage)

Replace a header image with a new image.



Tags:

access:  public
example:  example


Parameters:

string   $var   Value of the variable
string   $pathImage   Path of the new image

[ Top ]

method replaceTemplateVariableByHTML [line 6781]

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:

access:  public
example:  example


Parameters:

string   $var   Value of the variable.
string   $html   HTML source
array   $options:   isFile (boolean), customListStyles (bool) if true try to use the predefined customm lists baseURL (string), downloadImages (boolean), filter (string) could be an string denoting the id, class or tag to be filtered. If you want only a class introduce .classname, #idName for an id or <htmlTag> for a particular tag. One can also use standard XPath expresions supported by PHP. 'parseAnchors' (boolean), 'parseDivs' (paragraph, table): parses divs as paragraphs or tables, 'parseFloats' (boolean), 'strictWordStyles' (boolean) if true ignores all CSS styles and uses the styles set via the wordStyles option (see next) 'wordStyles' (array) associates a particular class, id or HTML tag to a Word style
type   $type   inline or block
   $options  

[ Top ]

method setBackgroundColor [line 6818]

void setBackgroundColor( string $color)

Changes the background color of the document



Tags:

access:  public
example:  example


Parameters:

string   $color   Values: hexadecimal color value without # (ffff00, 0000ff, ...)

[ Top ]

method setDecimalSymbol [line 6857]

void setDecimalSymbol( string $symbol)

Change the default font



Tags:

access:  public


Parameters:

string   $symbol   Values: '.', ',',...

[ Top ]

method setDefaultFont [line 6909]

void setDefaultFont( string $font)

Change the default font



Tags:

access:  public
example:  example


Parameters:

string   $font   The new font Values: 'Arial', 'Times New Roman'...

[ Top ]

method setEncodeUTF8 [line 6958]

void setEncodeUTF8( )

Transform to UTF-8 charset



Tags:

access:  public


[ Top ]

method setExtension [line 1668]

void setExtension( $extension)

Setter



Tags:

access:  public


Parameters:

   $extension  

[ Top ]

method setLanguage [line 6969]

void setLanguage( [$lang $lang = null])

Change default language.



Tags:

access:  public
example:  example


Parameters:

$lang   $lang   Locale: en-US, es-ES...

[ Top ]

method setMarkAsFinal [line 7025]

void setMarkAsFinal( )

Mark the document as final



Tags:

access:  public
example:  example


[ Top ]

method setRTL [line 7045]

void setRTL( [array $options = array('bidi' => true, 'rtl' => true)])

sets global right to left options



Tags:

access:  public


Parameters:

array   $options   values: 'bidi' (bool) 'rtl' (bool)

[ Top ]

method setTemplateSymbol [line 7132]

void setTemplateSymbol( [string $symbol = '$'])

Set the symbol surrounding varibles (placeholders)



Tags:

access:  public


Parameters:

string   $symbol   The new symbol. Optional, $ as default

[ Top ]

method setTemporaryDirectory [line 1687]

void setTemporaryDirectory( $tempDir)

Setter



Tags:

access:  public


Parameters:

   $tempDir  

[ Top ]

method setXmlContentTypes [line 1707]

void setXmlContentTypes( $xmlContentTypes)

Setter



Tags:

access:  public


Parameters:

   $xmlContentTypes  

[ Top ]

method setXmlDocPropsApp [line 1747]

void setXmlDocPropsApp( $xmlDocPropsApp)

Setter



Tags:

access:  public


Parameters:

   $xmlDocPropsApp  

[ Top ]

method setXmlDocPropsCore [line 1767]

void setXmlDocPropsCore( $xmlDocPropsCore)

Setter



Tags:

access:  public


Parameters:

   $xmlDocPropsCore  

[ Top ]

method setXmlDocPropsCustom [line 1787]

void setXmlDocPropsCustom( $xmlDocPropsCustom)

Setter



Tags:

access:  public


Parameters:

   $xmlDocPropsCustom  

[ Top ]

method setXmlRelsRels [line 1727]

void setXmlRelsRels( $xmlRelsRels)

Setter



Tags:

access:  public


Parameters:

   $xmlRelsRels  

[ Top ]

method setXmlWordDocument [line 1807]

void setXmlWordDocument( $xmlWordDocument)

Setter



Tags:

access:  public


Parameters:

   $xmlWordDocument  

[ Top ]

method setXmlWordDocumentStyles [line 1827]

void setXmlWordDocumentStyles( $xmlWordDocumentStyles)

Setter



Tags:

access:  public


Parameters:

   $xmlWordDocumentStyles  

[ Top ]

method setXmlWordEndnotes [line 1847]

void setXmlWordEndnotes( $xmlWordEndnotes)

Setter



Tags:

access:  public


Parameters:

   $xmlWordEndnotes  

[ Top ]

method setXmlWordFontTable [line 1867]

void setXmlWordFontTable( $xmlWordFontTable)

Setter



Tags:

access:  public


Parameters:

   $xmlWordFontTable  

[ Top ]

method setXmlWordFooter1 [line 1887]

void setXmlWordFooter1( $xmlWordFooter)

Setter



Tags:

access:  public


Parameters:

   $xmlWordFooter  

[ Top ]

method setXmlWordHeader1 [line 1907]

void setXmlWordHeader1( $xmlWordHeader)

Setter



Tags:

access:  public


Parameters:

   $xmlWordHeader  

[ Top ]

method setXmlWordRelsDocumentRels [line 1927]

void setXmlWordRelsDocumentRels( $xmlWordRelsDocumentRels)

Setter



Tags:

access:  public


Parameters:

   $xmlWordRelsDocumentRels  

[ Top ]

method setXmlWordSettings [line 1947]

void setXmlWordSettings( $xmlWordSettings)

Setter



Tags:

access:  public


Parameters:

   $xmlWordSettings  

[ Top ]

method setXmlWordStyles [line 1967]

void setXmlWordStyles( $xmlWordStyles)

Setter



Tags:

access:  public


Parameters:

   $xmlWordStyles  

[ Top ]

method setXmlWordThemeTheme1 [line 1987]

void setXmlWordThemeTheme1( $xmlWordThemeTheme)

Setter



Tags:

access:  public


Parameters:

   $xmlWordThemeTheme  

[ Top ]

method setXmlWordWebSettings [line 2007]

void setXmlWordWebSettings( $xmlWordWebSettings)

Setter



Tags:

access:  public


Parameters:

   $xmlWordWebSettings  

[ Top ]

method tickCheckbox [line 7146]

void tickCheckbox( string $var, [int $value = 1])

Checks or unchecks a Word template checkbox.



Tags:

access:  public
example:  example


Parameters:

string   $var   variables name
int   $value   1 (check) or 0 (uncheck)

[ Top ]

method transformDocx [line 7174]

void transformDocx( string $docSource, string $docDestination, [string $tempDir = null], [array $options = array()], [string $version = null])

Transform DOCX to PDF, ODT, SXW, RTF, DOC, TXT, HTML or WIKI



Tags:

access:  public
example:  example not found


Parameters:

string   $docSource  
string   $docDestination  
string   $tempDir  
array   $options   : · method : 'direct' (default), 'script' ; 'direct' method uses passthru and 'script' uses a external script. If you're using Apache and 'direct' doesn't work use 'script' · 'odfconverter' : true (default) or false. Use odf-converter.
string   $version   32, 64 or null (default). If null autodetect

[ Top ]

method transformDocxUsingMSWord [line 7195]

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:

access:  public


Parameters:

$docSource   $docSource   You should use the full Windows path to the docx (remember to escape backslashes)
$docDestination   $docDestination   ou should use the full Windows path to the docx (remember to escape backslashes)

[ Top ]

method txt2docx [line 7209]

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:

access:  public
example:  example


Parameters:

string   $path.   Path to the text file from which we insert into docx document
array   $options   of style values keys: styleTbl, styleLst, styleP
   $text_filename  

[ Top ]

method __toString [line 1657]

string __toString( )

Magic method, returns current word XML



Tags:

return:  Return current word
access:  public


[ Top ]


Class Constants

NAMESPACEWORD =  'w'

[line 23]


[ Top ]

SCHEMA_IMAGEDOCUMENT =
    'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image'

[line 24]


[ Top ]

SCHEMA_OFFICEDOCUMENT =
    'http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument'

[line 26]


[ Top ]



Documentation generated on Mon, 13 Jan 2014 13:44:03 +0100 by phpDocumentor 1.4.4