creates the document
package |
Docxpresso |
---|
__construct(array $params = array())
access |
public |
---|---|
array
the posible keys and values are: 'template' => (string) path to the template we wish to use 'base-font-size' => (int) The default document font size (in points) that will be used for the computation of relative units (em, rem). The default value can be globally set in the config.ini file
_followingNode(\Docxpresso\DOMNode $node) : mixed
access |
private |
---|
\Docxpresso\DOMNode
mixed
(DOMnode or NULL)
_isAbsolutePath(string $path) : \Docxpresso\ODFElement
access |
private |
---|
string
\Docxpresso\ODFElement
_parseTabs() : void
access |
private |
---|---|
_parseVars(string $type = 'document', array $options = array()) : \Docxpresso\CreateDocument
access |
public |
---|
string
it can be document header or footer
array
an array with the following keys and values: 'format' => (array) an array with two entries giving the chosen openning and closing symbol for template variables. The default value is array('{{', '}}') but any other combination of symbols is possible. we do not recommend using the same symbol for both arrays entries or symbols that may be used somewhere else within the document because that may lead to "false positives"
\Docxpresso\CreateDocument
_processTemplate() : void
access |
private |
---|---|
_removeEmptyBackground(string $dom) : void
access |
private |
---|
string
_removeImageLuminance(string $dom) : void
access |
private |
---|
string
_repairFloats() : void
access |
private |
---|
_repairSections(string $key) : void
access |
private |
---|
string
_repairTable(string $key) : void
access |
private |
---|
string
_themeTableStyles(\Docxpresso\DOMNode $tableNode, string $key, string $class, array $mask) : void
access |
private |
---|
\Docxpresso\DOMNode
string
string
array
addBorder(string &$style, string $border) : void
access |
public |
---|---|
static |
string
string
bookmark(array $options, boolean $reference = false) : \Docxpresso\ODFElement
access |
public |
---|
array
with the following keys and values
'name' => (string) the bookmark name needed for cross references
'text' => (string) the text to insert (can be empty)
'style' => (string) a list of properties in CSS format
boolean
if true returns a reference to the wrapping paragraph element so we can keep nesting. The default value is false, i.e. no nested element
\Docxpresso\ODFElement
cell() : \Docxpresso\CreateDocument
chart(string $type, array $options = array()) : \Docxpresso\ODFElement
access |
public |
---|
string
the available types are: 2D: column, bar, pie, donut, area, line, scatter, bubble, radar, filled-radar, column-line 3D: 3Dcolumn, 3Dbar, 3Dpie, 3Ddonut, 3Darea, 3Dline, 3Dscatter
array
with the following keys and values
'data' => (array) it can be an array with different formats:
pie and donuts charts:
array( 'category_1' => 3,
'category_2' => 5,
'category_3' => 4.3,
)
bar, column, area , line, scatter, (filled-)radar
and column-line charts:
array( 'series' => array('ser_1', 'ser_2'),
'category_1' => array(20,40),
'category_2' => array(30,10),
'category_3' => array(12.5, 54),
)
buble charts
array( array(2, 5 7),
array(4.3, 12, 3.5),
array(6, 3, 5),
)
'chart-properties' => (array) with keys and values:
'data-label-number' => (string) none, value or percentage.
'label-position' => (string) avoid-overlap, center,
top, top-right, right, bottom-right, bottom, bottom-left, left,
top-left, inside, outside or near-origin.
'label-position-negative' => (string) it only applies if
the value is negative. If not given the value for
data-label-position will be used
top-left, inside, outside or near-origin.
'hole-size' => (int) specifies the diameter of the inner hole
of a ring chart as percentage of the outer diameter of the
outermost ring.
'pie-offset' => (int) specifies the distance of a segment from
the center of the circle in case of circle charts. The offset
is given as an integer which is interpreted as a percentage of
the radius of the circle. In case of ring charts specifies an
additional distance of a segment from the center of the circle.
The distance is given as percentage of the thickness of the
ring.
'angle-offset' => (int) it specifies in degrees a counter
clockwise rotation of a polar coordinate in a circle, ring or
polar chart.
'stacked' => (boolean) default value is false. it specifies the
accumulation of the series values per category. Each value is
in addition to the other values in the same category.
'chart-interpolation' => (string) none (if points are to be
connected by a straight line, b-spline or cubic-spline.
'spline-resolution' => (int) a positive inetger. It only applies
if the chart-interpolation option is not equal to none.
'deep' => (boolean) if true the series will be shown
in 3D one behind the other and not side by side. It only
applies to 3D charts.
'solid-type' => (string) cuboid (default), cylinder, cone or
pyramid. It only applies to 3D bar charts.
'style' => (string) a list of properties in CSS format that only
set the global properties of the chart. In order to customize the
different chart components you should use the associated
chart methods.
\Docxpresso\ODFElement
chartLegend() : \Docxpresso\ODFElement
access |
public |
---|---|
\Docxpresso\ODFElement
chartTitle() : \Docxpresso\ODFElement
access |
public |
---|---|
\Docxpresso\ODFElement
checkbox(array $options, boolean $reference = true) : \Docxpresso\ODFElement
access |
public |
---|
array
with the following keys and values
'form-name' => (string) the name of the form where we want to insert
this control
'name' => (string) the control name
'value' => (string) the associated value
'checked' => (int) 1 or 0
'style' => (string) a list of properties in CSS format
'styleId' => (string) if given the styleId is not generated randomly
'pageNumber' => (int) for absolutely positioned controls (optional).
boolean
if true returns a reference to the frame element so further elements can be nested. The default value is true.
\Docxpresso\ODFElement
cloneContent(array $options) : void
access |
public |
---|
array
an array with the following keys and values: 'needle' => (string) the text to be searched in order to select the content to be cloned or the bookmark name if the element option is set to be equal to bookmark. 'element' => (string) the type of element to be cloned. possible values are: paragraph (default), list, list-item, table, table-row, image, chart, heading, section and bookmark. 'match' => (int) if there is more than one resulting element its order of ocurrence. The default is 1 (first match). 'repeat' => (int) The number of times that the cloned element will be repeated. Deafault is 1. 'position' => (mixed) specifies were the clone nodes should be inserted. Possible values are a string:
self: (default) just before the chosen element
cursor: just before the current cursor location
or a DOMNode (the cloned nodes will be inserted before it). In the case of list-element and table-row the last option will be ignored. 'heading-level' => (int) only applies if 'heading' is the chosen element value. Default value is 1. 'container' => (bool) if true (default is false) the container paragraph (if any) will be cloned in the case of charts, images and textboxes. 'target' => (string) it can be document (default), header or footer.
columnBreak() : void
access |
public |
---|---|
cursor(array $options = array()) : void
access |
public |
---|
array
an array with the following keys and values: 'needle' => (string) if given the (first, if match is not set) node containing it will be chosen as the reference node. 'element' => (string) it sets the type of the reference node. It can be paragraph (default) or table. 'match' => (int) if there is more than one resulting node its order of ocurrence. The default is 1 (first match). 'position' => (string) it can be before (default, the cursor is located before the reference node), after (the cursor is located just after the reference node) or end (end of the document). In the last case the options needle and match will be ignored.
documentFragment() : \Docxpresso\DocumentFragment
access |
public |
---|---|
\Docxpresso\DocumentFragment
endnote(array $options = array(), boolean $reference = true) : \Docxpresso\ODFElement
access |
public |
---|
array
boolean
\Docxpresso\ODFElement
extractTemplateFiles(\Docxpresso\ZipArchive $zip) : array
access |
public |
---|---|
static |
\Docxpresso\ZipArchive
array
field(string $type, array $options = array(), boolean $reference = true) : \Docxpresso\ODFElement
access |
public |
---|
string
the available types are: author-name: the full author name bookmark-ref: reference to a bookmark page date: current date page-count: total number of pages page-number: current page number (with an optional offset) title: document title
array
the possible keys and values are:
'default-value' => (string) the field default value
'number-format' => (string) used for page-count and page-number
1: Hindu-Arabic number sequence starts with 1.
a: number sequence of lowercase Modern Latin basic alphabet
characters starts with “a”.
A: number sequence of uppercase Modern Latin basic alphabet
characters starts with “A”.
i: number sequence of lowercase Roman numerals starts with “i”.
I: number sequence of uppercase Roman numerals start with “I”.
'number-offset' => (int) allows to start the numbering with a given
offset. For example, if we would like to ignore the front page for
page numbering we should choose a value of -1.
'reference-format' => (string) used for bookmark-ref
page: displays the number of the page on which the
referenced item appears.
text: displays the text of the referenced item.
'reference-name' => (string) the name of the linked reference
'date-format' => (array) the date is built by running consecutively
through the array entries. possible values are:
day: day of the month with two digits
day-short: day of the month with one/two digits (as required)
day-of-week: day of the week in textual format
day-of-week-short: abbreviated day of the week in textual format
month: month of the year with two digits
month-short: month of the year with one/two digits (as required)
month-of-year: month of year in textual form
month-of-year-short: month of year in abbreviated textual form
year: year number with four digits
year-short: year number with 2 digits
text (string): an arbitrary string of text
Examples:
1. array('day', '/', 'month', '/', 'year') yields 07/03/2014
2. array('day-of-week', ' ', 'day-short', ', 'month-of-year', '-', 'year')
yields Thursday 7, November-2014
'style' => (string) a list of properties in CSS format
boolean
if true returns a reference to the form element so further elements can be nested. The default value is true.
\Docxpresso\ODFElement
footnote(array $options = array(), boolean $reference = true) : \Docxpresso\ODFElement
access |
public |
---|
array
boolean
\Docxpresso\ODFElement
form(array $options, boolean $reference = true) : \Docxpresso\ODFElement
access |
public |
---|
array
the avalaible key and values are: 'name' => (string) a unique name that identifies the form. If not given will be automatically generated. 'target' => (string) that can be '_blank (default), _self or _top or a frame name 'action' => (string) points to the URL (if any) where the data of the form should be sent and processed 'method' => (string) may be get (default) or post
boolean
if true returns a reference to the form element so further elements can be nested. The default value is true.
\Docxpresso\ODFElement
frame(array $options = array(), boolean $reference = true) : \Docxpresso\ODFElement
access |
public |
---|
array
with the following keys and values
'style' => (string) a list of properties in CSS format
'styleId' => (string) if given the styleId is not generated randomly
boolean
if true returns a reference to the frame element so further elements can be nested. The default value is true.
\Docxpresso\ODFElement
getDOM() : array
access |
public |
---|---|
array
header(array $options = array()) : \Docxpresso\ODFElement
access |
public |
---|
array
with the following keys and values
'section' => (int) the section number. If not given it is assumed
that the header will be inserted in the current section
'dynamic-spacing' => (bool) select true if you wish that the
package accomodates the header properties to the general document
layout. Default value is false.
'left-page' => (bool) if true the header will be specific of left
pages only
'style' => (string) a list of properties in CSS format
'styleId' => (string) if given the styleId is not generated randomly
\Docxpresso\ODFElement
heading(array $options, boolean $reference = true) : \Docxpresso\ODFElement
access |
public |
---|
array
with the following keys and values
'level' => (int) the heading level: 1 (h1), 2 (h2),... up to 6
'text' => (string) an optional text (it can also be added later
with the text method)
'style' => (string) a list of properties in CSS format
'enforce' => (bool) if set to true and the current element does not
accept paragraphs the method searches for the first ancestor that
allows for the isnsertion. Beware that the return element is a
reference to the inserted paragraph and the chaining may result
affected consequently!!
boolean
if true returns a reference to the paragraph element. The default value is true
\Docxpresso\ODFElement
hr(array $options = array()) : \Docxpresso\ODFElement
access |
public |
---|
array
with the following keys and values
'style' => (string) a list of properties in CSS format
'styleId' => (string) if given the styleId is not generated randomly
\Docxpresso\ODFElement
html(array $options) : \Docxpresso\CreateDocument
access |
public |
---|
array
the available keys and values are: 'baseURL' => (string) if set enforces the base URL used for relative paths, otherwise it will be autodetected (if possible). 'encoding' => (string) if set enforces the encoding to be used otherwise it will be autodetected. 'isFile' => (boolean) true if the HTML code has to be retrieved from a file. Default value is false, i.e. the HTML is a string. 'context' => (array) this option is only taken into account if we need to fetch the HTML code via a http request. Its use is optional and if not set standard values, valid in the majority of cases, will be used. This option sets the http context (headers) for the http request. Depending on the server this option may be mandatory, i.e. the server will not return anything unless it receives this additional info. The keys and values are(http://www.php.net/manual/en/context.http.php):
'method': GET (default value) or POST.
'header': an array with the required headers that may include among
others: 'Referer', 'User-agent', 'Referer', 'Connection', ...
'proxy':address of the proxy server
'request_fulluri' true or false (default).
'follow_location': Follow Location header redirects. Set to 0
to disable. Default value is 1.
'max_redirects'The maximum number of redirects to follow.
1 or less means that no redirects are followed (default is 20).
'protocol_version': HTTP protocol version (default is 1.0).
'html' => (string) it can be a string of HTML code or the path to the the path to the HTML file if the 'isFile' option is set to true.
\Docxpresso\CreateDocument
image(array $options, boolean $reference = true) : \Docxpresso\ODFElement
access |
public |
---|
array
with the following keys and values
'src' => (string) path to the image we want to insert
'title' => (string) the image title should be included for
accesibility reasons
'description' => (string) the image description should be included
for accesibility reasons
'style' => (string) a list of properties in CSS format
boolean
if true returns a reference to the image element so further elements can be nested. The default value is false.
\Docxpresso\ODFElement
inputField(array $options, boolean $reference = true) : \Docxpresso\ODFElement
access |
public |
---|
array
with the following keys and values
'form-name' => (string) the name of the form where we want to insert
this control
'name' => (string) the control name.
'value' => (string) the associated default value, if any.
'style' => (string) a list of properties in CSS format.
'styleId' => (string) if given the styleId is not generated randomly
'pageNumber' => (int) for absolutely positioned controls (optional).
boolean
if true returns a reference to the frame element so further elements can be nested. The default value is true.
\Docxpresso\ODFElement
insertDocumentFragment(\Docxpresso\DocumentFragment $fragment) : \Docxpresso\CreateDocument
lineBreak() : void
access |
public |
---|---|
link(array $options, boolean $reference = true) : \Docxpresso\ODFElement
access |
public |
---|
array
with the following keys and values
'text' => (string) an optional text (it can also be added later
with the text method)
'target' => (string) the link target (the default is _blank)
'title' => (string) an optional title text for the link
'style' => (string) a list of properties in CSS format
'url' => (string) the link href attribute. It can be a http path or
an anchor to a previously defined bookmark (#name)
boolean
if true returns a reference to the paragraph element. The default value is true
\Docxpresso\ODFElement
listItem() : \Docxpresso\CreateDocument
loadTheme(string $path = '') : \Docxpresso\CreateDocument
access |
public |
---|
string
the path to the correponding CSS file. The
\Docxpresso\CreateDocument
math(string $equation, array $options = array()) : \Docxpresso\ODFElement
access |
public |
---|
string
the equation that we want to insert in MathML 1.0 or StarMath 5.0 format
array
with the following keys and values
'math-settings' => (array) with the following keys and values:
'base-font-size' => (int) base font size used in the equation.
The default size is 12 (pt).
'rel-text-size' => (int) relative text size (default: 100)
'rel-indexes-size' => (int) relative index size (default: 60)
'rel-functions-size' => (int) relative function size (default: 100)
'rel-operators-size' => (int) relative operator size (default: 100)
'rel-limits-size' => (int) relative limit size (default: 60)
'variables-font' => (string) default is Times New Roman
'functions-font' => (string) default is Times New Roman
'numbers-font' => (string) default is Times New Roman
'text-font' => (string) default is Times New Roman
'custom-serif-font' => (string) default is Times New Roman
'custom-sans-serif-font' => (string) default is Arial
'custom-fixed-font' => (string) default is Courier New
'style' => (string) a list of properties in CSS format
NOTE: Only MathML 1.0 is supported. You can check the documentation in
http://www.w3.org/TR/1998/REC-MathML-19980407/.
For StarMath 5.0 syntax you may refer to the official docs in:
https://wiki.openoffice.org/wiki/Documentation/OOo3_User_Guides/Math_Guide/Math_commands_reference
http://www.openoffice.org/documentation/manuals/oooauthors/MathObjects.pdf
\Docxpresso\ODFElement
ODF2HTML5(string $path, array $options = array()) : void
access |
public |
---|
string
the path to the resulting HTML5 file. The path should include the extension (html or htm)
array
an array with the following keys and values: 'format' => (string) the values can be:
standard: (default) the styles and images are stored in a folder
with the same name of the HTML5 file
single-file: the styles are integrated within the <head> tag
element and the images are base64 encoded an integrated within the
HTML5 file
orderedList(array $options = array(), boolean $reference = true) : \Docxpresso\ODFElement
access |
public |
---|
array
with the following keys and values
'items' => (array) a (nested) array with the items to be included
in the list (plain text or document fragments). This argument is
optional because the items can also be added via the itemList
method.
'style' => (string) a list of properties in CSS format
'styleId' => (string) if given the styleId is not generated randomly
boolean
if true returns a reference to the element so further elements can be nested. The default value is true.
\Docxpresso\ODFElement
pageBreak() : void
access |
public |
---|---|
pageLayout(array $options = array()) : \Docxpresso\CreateDocument
access |
public |
---|
array
the availables keys and values are:
'orientation' => (string) can be portrait (default) or landscape
'paperSize' => (string) the predefined available options are:
A3
A4 (default)
letter
legal
If the width and height properties are set in the style option this
value will be ignored
'section' => (int) the section number to which we want to apply
the custom layout. If not set or empty the style is applied to all
document sections.
'style' => (string) a list of properties in CSS format
'styleId' => (string) if given the styleId is not generated randomly
\Docxpresso\CreateDocument
paragraph(array $options = array(), boolean $reference = true) : \Docxpresso\ODFElement
access |
public |
---|
array
with the following keys and values
'text' => (string) an optional text (it can also be added later
with the text method)
'style' => (string) a list of properties in CSS format
'styleId' => (string) if given the styleId is not generated randomly
boolean
if true returns a reference to the paragraph element. The default value is true
\Docxpresso\ODFElement
parseRowCellChilds(array $options) : void
access |
public |
---|---|
static |
array
with the following keys and values
'dom' => (DOMDocument) the dom we need to search
'id' => (string) unique identifier
'idType' => (string) it can be styleId or xml:id
'tag' => (string) the tag we want to parse
'style' => (array) the preparsed CSS styles
parseTableCellChilds(array $options) : void
access |
public |
---|---|
static |
array
with the following keys and values
'dom' => (DOMDocument) the dom we need to search
'id' => (string) unique identifier
'idType' => (string) it can be styleId or xml:id
'tag' => (string) the tag we want to parse
'style' => (array) the preparsed CSS styles
parseVariables(array $options = array()) : \Docxpresso\CreateDocument
access |
public |
---|
array
an array with the following keys and values: 'format' => (array) an array with two entries giving the chosen openning and closing symbol for template variables. The default value is array('{{', '}}') but any other combination of symbols is possible. Althoug allowed, we do not recommend using the same symbol for both arrays entries or symbols that may be used somewhere else within the document because that may lead to "false positives"
\Docxpresso\CreateDocument
radioButton(array $options, boolean $reference = true) : \Docxpresso\ODFElement
access |
public |
---|
array
with the following keys and values
'form-name' => (string) the name of the form where we want to insert
this control
'name' => (string) the control name. Radio buttons belonging to the
same group should share the same name
'value' => (string) the associated value
'selected' => (bool) true or false. only one readio button should be
selected by group otherwise use a checkbox control component
'style' => (string) a list of properties in CSS format
'styleId' => (string) if given the styleId is not generated randomly
'pageNumber' => (int) for absolutely positioned controls (optional).
boolean
if true returns a reference to the frame element so further elements can be nested. The default value is true.
\Docxpresso\ODFElement
removeContent(array $options) : \Docxpresso\CreateDocument
access |
public |
---|
array
an array with the following keys and values: 'needle' => (string) the text to be searched to select the content to be removed or the bookmark name if the element option is set to be equal to bookmark. 'element' => (string) the type of element to be removed. possible values are:
text: (default)the text given in the needle is removed from the
document,
paragraph: the paragraphs that contain the needle text are removed,
list: the lists that contain the needle text are removed,
list-item: the list items that contain the needle text are removed,
table: the table that contains the needle text is removed unless the
text fall within a subtable,
table-row: the same that for table but just for a table row
image: the images which title include the needle text are removed,
chart: the charts which title description include the given text
are removed,
section: all section content of a section that contains the needle
text is removed,
textbox: all textbox content of a textbox that contains the needle
text is removed,
heading: all the contents that fall under a given heading are
removed whenever the heading contains the needle text
'heading-level' => (int) only applies if 'heading' is the chosen element value. Default value is 1. 'match' => (mixed) if an integer (defining its order of appareance) only that match will be removed if 'all'(default value)all the matches will be removed. 'container' => (bool) if true (default is false) the container paragraph (if any) will be removed in the case of charts, images and textboxes. 'target' => (string) possible values are: document (default), header or footer
\Docxpresso\CreateDocument
removeCursor(\Docxpresso\DOMNode $node = NULL) : void
access |
public |
---|
\Docxpresso\DOMNode
render(string $path = '', array $options = array()) : void
access |
public |
---|
string
the path where we want to save the generated file
array
rendering options with the following keys and values The avalaible keys and values are: 'soffice' => (string) path to soffice.exe . If not explicitely given the path for soffice stored in config.ini is used. 'legacy' => (bool) if true converts the ouput to Word 97 compatible .doc file. Only applies to .doc format. 'PageRange' => (string) if empty (default) includes all pages. If a single number it renders only the corresponding page and if a range, i.e. 1-3 renders from the page 1 to three both included. 'UseLosslessCompression' => (bool) if true images are not compressed. The default is false. 'Quality' => (int) the quality of the compressed images (JPG). Deafault value is 90. 'ReduceImageResolution' => (bool) if true the image resolution is changed. Default is false. 'MaxImageResolution' => (int) maximum image resolution. Default value is 300. 'SelectPdfVersion => (int) PDF version:
0: PDF 1.4 (default).
1: PDF/A-1 (ISO 19005-1:2005).
'UseTaggedPDF => (bool) if true the generated PDF will be tagged for accesibility. Default value is false. 'ExportFormFields => (bool) exports form fields. Default value is true. 'FormsType' => (int) form protocol:
0: FDF.
1: PDF.
2: HTML(default value).
3: XML.
'ExportBookmarks' => (bool) exports bookmarks. Default value is true. 'EmbedStandardFonts' => (bool) embeds the standard PDF fonts. Default value is false. 'Watermark' => (string) watermark text. Default is an empty string. 'InitialView' => (int) initial view:
0: (default) default view mode, neither outlines or thumbnails.
1: outline pane opened.
2: thumbnail pane opened.
'Magnification' => (int) PDF magnification on openning:
0: (default) default magnification.
1: fit entire page within the viewer window.
2: fit entire page width within the viewer window.
3: fit entire page width (cutting margins) within the viewer window.
4: opens with the zoom specified in the Zoom option.
'Zoom' => (int) zoom level on openning. Default is 100 (it only applies if Maginification equals 4). The available range is 50-1600. 'PageLayout' => (int) PDF layout on openning:
0: (default) default viewer configuration.
1: one page at a time.
2: display pages in one column.
3: display pages in two columns.
'FirstPageOnLeft' => (bool) if true the first page should be on the left. Default is false (only used if PageLayout equals 3). 'CenterWindow' => (bool) if true the PDF window is centered in the screen. Default is false. 'OpenInFullScreenMode' => (bool) if true the PDF opens in full screen mode. Default is false. 'DisplayPDFDocumentTitle' => (bool) if true the PDF window shows the document title. Default is true. 'HideViewerMenubar' => (bool) if true hides the viewer menu. Default is false. 'HideViewerToolbar' => (bool) if true hides the viewer toolbar. Default is false. 'HideViewerWindowControls' => (bool) if true hides the viewer window controls. Default is false. 'EncryptFile' => (bool) if true encrypts the file. Default is false. 'DocumentOpenPassword' => (string) password to open file if the option EncryptFile is set to true. Default is an empty string. 'RestrictPermissions' => (bool) if true restricts you may restrict printing, copying and modifying. Default is false. 'PermissionPassword' => (string) password to to access the restricted functionalities if the option DocumentOpenPassword is set to true. Default is an empty string. 'Printing' => (int) printing configuration:
0: the document can not be printed.
1: the document can only be printed in low resolution.
2: (default) the document can be printed with no restrictions.
'Changes' => (int) specify which changes are allowed:
0: protected against any change.
1: pages can be added, deleted or rotated.
2: filling forms.
3: filling forms and adding comments.
4: (default) all changes are allowed but page extraction.
'EnableCopyingOfContent' => (bool) if true the content can be copied and pasted elsewhere. Default is true.
replace(array $vars, array $options = array()) : void
access |
public |
---|
array
an array with keys the name of the variables and values:
'value' => (mixed) it can be:
1. A string or DocumentFragment object
2. An array with entries that are themselves
strings or DocumentFragment objects
'html' => (bool) if true (default) detects if the content is plain
text or a HTML code. It overwrites the global html option if any.
'parse-line-breaks' => (bool) if true parses line breaks. If the
method detects that the string is HTML the default is false,
otherwise defaults to true. It overwrites the global
parse-line-breaks option if any.
'block-type' => (bool) if true removes and replaces the containing
paragraph. Default is false. It overwrites the global block-type
option if any.
'image' => (bool) set only to true if the variable name is
associated with the title of a placeholder image. Default is false.
It overwrites the element option if any.
'match' => (int) if given and if the 'value' option is not an array
only the selected match will be replaced, i.e. if match equals 1
the first appearance of the variable will be replaced and the
others will be ignored. It overwrites the global match option
if any.
'width' => (string) an optional new width for image replacement. The
format must be like in CSS, i.e. 100px or 2cm, 3in, etcetera.
'height' => (string) an optional new height for image replacement.
The format must be like in CSS, i.e. 100px or 2cm, 3in, etcetera.
array
an array with the following keys and values: 'format' => (array) an array with two entries giving the chosen openning and closing symbol for template variables. The default value is array('{{', '}}') but any other combination of symbols is possible, even array('', ''), although this is not recommended unless strictly necessary. 'element' => (string) the element level at which we want to carry out the replacement. possible values are: text (default), paragraph, list, table or image. 'target' => (string) it can be document (default), header or footer. 'html' => (bool) if true (default) detects if the content is plain text or a HTML code. It may be overwritten for a single value in the $vars array. 'parse-line-breaks' => (bool) if true parses line breaks. If the method detects that the string is HTML the default is false, otherwise defaults to true. It may be overwritten for a single value in the $vars array. 'block-type' => (bool) if true removes and replaces the containing paragraph. Default is false. It may be overwritten for a single value in the $vars array. 'match' => (int) if given and if the 'value' option is not an array only the selected match will be replaced, i.e. if match equals 1 the first appearance of the variable will be replaced and the others will be ignored. It may be overwritten for a single value in the $vars array
replaceChartData(string $var, array $options) : void
access |
public |
---|
string
the name used for the chart title. If empty the chatr will be chosen via the match option.
array
with the following keys and values
'data' => (array) it can be an array with different formats:
pie and donuts charts:
array( 'category_1' => 3,
'category_2' => 5,
'category_3' => 4.3,
)
bar, column, area , line, scatter, (filled-)radar
and column-line charts:
array( 'series' => array('ser_1', 'ser_2'),
'category_1' => array(20,40),
'category_2' => array(30,10),
'category_3' => array(12.5, 54),
)
buble charts: not supported yet
'format' => (array) an array with two entries giving the chosen openning and closing symbol for the variable. The default value is array('{{', '}}') but any other combination of symbols is possible, even array('', ''), although this is not recommended unless strictly necessary. 'match' => (int) if given, only the selected match will be replaced, i.e. if match equals 1 the first chart tagged with the variable will be replaced and the others will be ignored.
row() : \Docxpresso\CreateDocument
section(array $options = array()) : \Docxpresso\CreateDocument
access |
public |
---|
array
the availables keys and values are:
'orientation' => (string) can be portrait (default) or landscape
'paperSize' => (string) the predwefined available options are:
A3
A4 (default)
letter
legal
If the width and height properties are set in the style option this
value will be ignored
'style' => (string) a list of properties in CSS format
'styleId' => (string) if given the styleId is not generated randomly
\Docxpresso\CreateDocument
select(array $options, boolean $reference = true) : \Docxpresso\ODFElement
access |
public |
---|
array
with the following keys and values
'form-name' => (string) the name of the form where we want to insert
this control
'name' => (string) the control name.
'items' => (array) an associative array with keys as options and
values the corresponding form values
'selected' => (string) the name of the selected item
selected by group otherwise use a checkbox control component
'style' => (string) a list of properties in CSS format
'styleId' => (string) if given the styleId is not generated randomly
'pageNumber' => (int) for absolutely positioned controls (optional).
boolean
if true returns a reference to the frame element so further elements can be nested. The default value is true.
\Docxpresso\ODFElement
setCursor(\Docxpresso\DOMNode $node, \Docxpresso\DOMNode $refNode = NULL, string $position = 'before') : void
access |
public |
---|
\Docxpresso\DOMNode
\Docxpresso\DOMNode
string
setGlobalCSSProps(array $props) : void
access |
public |
---|
array
the available global CSS properties that may be modified with the help of this method are: font-size: value in pixels (12px, 14px, ...) font-family: Arial, Calibri, ... color: hexadecimal value (#000000, #ff0000, ...)
tab(array $options = array()) : \Docxpresso\ODFElement
access |
public |
---|
array
\Docxpresso\ODFElement
table(array $options = array(), boolean $reference = true) : \Docxpresso\ODFElement
access |
public |
---|
array
with the following keys and values
'data' => (array) an optional array of arrays with the
values to be included in the different table rows and cells.
Beware of teh limited formatting capabilities of this option.
For more advanced formatting one should use
the row and cell methods.
Beware of teh limited formatting capabilities of this option.
'grid' => (mixed) mandatory if tableData is not given.
It may be:
The number of columns (integer): all columns are of equal size
An array where each item represents the respective column width
'style' => (string) a list of properties in CSS format
'mask' => (array) this array stablishes the table theme options that
should be applied to the current table. The default values are:
array( 'NE' => true,
'NW' => true,
'SE' => true,
'SW' => false,
'firstRow' => true,
'lastRow' => false,
'bandedRow' => true,
'firstCol' => true,
'lastCol' => false,
'bandedCol' => false)
'styleId' => (string) if given the styleId is not generated randomly
boolean
if true returns a reference to the text element so they can be nested.
\Docxpresso\ODFElement
text(array $options, boolean $reference = true) : \Docxpresso\ODFElement
access |
public |
---|
array
with the following keys and values
'text' => (string) an optional text (it can also be added later
with the text method)
'style' => (string) a list of properties in CSS format
'styleId' => (string) if given the styleId is not generated randomly
boolean
if true returns a reference to the text element so they can be nested.
\Docxpresso\ODFElement
textArea(array $options, boolean $reference = true) : \Docxpresso\ODFElement
access |
public |
---|
array
with the following keys and values
'form-name' => (string) the name of the form where we want to insert
this control
'name' => (string) the control name
'value' => (string) the associated value
'scroll' => (boolean) if true (default) the text area shows vertical
scrollbars
'style' => (string) a list of properties in CSS format
'styleId' => (string) if given the styleId is not generated randomly
'pageNumber' => (int) for absolutely positioned controls (optional).
boolean
if true returns a reference to the frame element so further elements can be nested. The default value is true.
\Docxpresso\ODFElement
textBox(array $options = array(), boolean $reference = true) : \Docxpresso\ODFElement
access |
public |
---|
array
with the following keys and values
'pageNumber' => (int) for absolutely positioned textboxes (optional)
'style' => (string) a list of properties in CSS format
'styleId' => (string) if given the styleId is not generated randomly
boolean
if true returns a reference to the frame element so further elements can be nested. The default value is true.
\Docxpresso\ODFElement
toc(array $options = array()) : \Docxpresso\CreateDocument
access |
public |
---|
array
with the following keys and values
'auto-update' => (boolean) if true (default value) the TOC will
automatically update on openning and the user will not be prompted
to do so. This option is ignored unless the target document
is in Open Document Format (.odt)
'leader-char' => (string) the leader char the joins the name of the
heading with its page number. The default value is '.'.
'linked' => (boolean) if true (default value) the toc entry is
linked to the corresponding heading so on can navegate through the
contents from the toc.
'outline-level' => (int) an integer number (smaller than 10) that
sets the the highest heading level that wil show up in the toc. The
default value is 3.
'title' => (string) The title, if any, of the table of contents. The
format is given in the first array entry of the style option
'style' => (array) an array with the styles in CSS format
for the title (style[0]) and the toc levels (the j-th level style
being given by style[j]).
\Docxpresso\CreateDocument
unorderedList(array $options = array(), boolean $reference = true) : \Docxpresso\ODFElement
access |
public |
---|
array
with the following keys and values
'items' => (array) a (nested) array with the items to be included
in the list (plain text or document fragments). This argument is
optional because the items can also be added via the itemList
method.
'style' => (string) a list of properties in CSS format
'styleId' => (string) if given the styleId is not generated randomly
boolean
if true returns a reference to the element so further elements can be nested. The default value is true.
\Docxpresso\ODFElement
XMLChart(string $xml, string $styleId = '') : \Docxpresso\ODFElement
access |
public |
---|
string
with the following structure <chart style="CSS styles"
type="column|bar|pie|donut|area|line|scatter|bubble|radar|filled-radar|column-line|3Dcolumn|3Dbar|3Dpie|3Ddonut|3Darea|3Dline|3Dscatter"
data-label-number="none|value|percentage"
label-position="avoid-overlap|center|top|top-right|right|bottom-right|bottom|bottom-left|left|top-left|inside|outside|near-origin"
label-position-negative="top-left|inside|outside|near-origin"
hole-size="integer"
pie-offset="integer"
angle-offset="integer"
stacked="boolean"
chart-interpolation="none|b-spline|cubic-spline"
spline-resolution="integer"
deep="boolean" >
<title color="hexadecimal color"
font-family="string"
font-size="float(pt|cm|in|mm)"
font-weight="normal|bold"
font-style="normal|italic"
stroke="solid|dash|none"
fill-color="hexadecimal color"
opacity="integer%"
stroke-width="float(pt|cm|in|mm)"
stroke-color="hexadecimal color"
stroke-opacity="integer%"
stroke-linejoin="round|bevel|middle|miter|none"
stroke-linecap="butt|round|square" >Title</title>
<legend legend-position="left|right|top|bottom"
color="hexadecimal color"
font-family="string"
font-size="float(pt|cm|in|mm)"
font-weight="normal|bold"
font-style="normal|italic"
stroke="solid|dash|none"
fill-color="hexadecimal color"
opacity="integer%"
stroke-width="float(pt|cm|in|mm)"
stroke-color="hexadecimal color"
stroke-opacity="integer%"
stroke-linejoin="round|bevel|middle|miter|none"
stroke-linecap="butt|round|square"/>
<grid dimension="x|y|z"
type="major|minor"
stroke="solid|dash|none"
stroke-width="float(pt|cm|in|mm)"
stroke-color="hexadecimal color"
stroke-opacity="integer%"
stroke-linejoin="round|bevel|middle|miter|none"
stroke-linecap="butt|round|square" />
<axis dimension="x|y|z"
visible="boolean"
logarithmic="boolean"
font-color="hexadecimal color"
font-size="float(pt|cm|in|mm)"
axis-position="start|end"
origin="float"
maximum="float"
minimum ="float"
label-arrangement="side-by-side|stagger-even|stagger-odd"
display-level="boolean"
axis-label-position="near-axis|near-axis-other-side|outside-end|outside-start"
reverse-direction="boolean"
text-overlap="boolean"
line-break="boolean"
stroke="solid|dash|none"
stroke-width="float(pt|cm|in|mm)"
stroke-color="hexadecimal color"
stroke-opacity="integer%"
stroke-linejoin="round|bevel|middle|miter|none"
stroke-linecap="butt|round|square"
interval-major="float"
interval-minor-divisor="integer"
tick-marks-major-inner="boolean"
tick-marks-minor-inner="boolean"
tick-marks-major-outer="boolean"
tick-marks-minor-outer="boolean" />
<component type="wall|floor"
fill-color="hexadecimal color"
opacity="integer%"
stroke="solid|dash|none"
stroke-width="float(pt|cm|in|mm)"
stroke-color="hexadecimal color"
stroke-opacity="integer%"
stroke-linejoin="round|bevel|middle|miter|none"
stroke-linecap="butt|round|square" />
<transform3D rotate-x="integer"
rotate-y="integer"
rotate-z="integer"
right-angled-axes="true|false"
perspective="integer" />
<!-- for pie and donut charts -->
<categories>
<category name=""
value=""
fill-color="hexadecimal color"
opacity="integer%"
stroke="solid|dash|none"
stroke-width="float(pt|cm|in|mm)"
stroke-color="hexadecimal color"
stroke-opacity="integer%" />
<category name=""
value=""
fill-color="hexadecimal color"
opacity="integer%"
stroke="solid|dash|none"
stroke-width="float(pt|cm|in|mm)"
stroke-color="hexadecimal color"
stroke-opacity="integer%" />
<category name=""
value=""
fill-color="hexadecimal color"
opacity="integer%"
stroke="solid|dash|none"
stroke-width="float(pt|cm|in|mm)"
stroke-color="hexadecimal color"
stroke-opacity="integer%" />
</categories>
<!-- for all other charts -->
<series>
<ser name=""
fill-color="hexadecimal color"
opacity="integer%"
stroke="solid|dash|none"
stroke-width="float(pt|cm|in|mm)"
stroke-color="hexadecimal color"
stroke-opacity="integer%"
solid-type="cuboid|cylinder|cone|pyramid" />
<ser name=""
fill-color="hexadecimal color"
opacity="integer%"
stroke="solid|dash|none"
stroke-width="float(pt|cm|in|mm)"
stroke-color="hexadecimal color"
stroke-opacity="integer%"
solid-type="cuboid|cylinder|cone|pyramid" />
</series>
<categories>
<category name="">
<data value="" />
<data value="" />
</category>
<category name="">
<data value="" />
<data value="" />
</category>
<category name="">
<data value="" />
<data value="" />
</category>
</categories>
string
\Docxpresso\ODFElement
automaticStyles : array
var | |
---|---|
access |
public |
static |
array
baseFontSize : array
var | |
---|---|
access |
public |
static |
array
break : string
var | |
---|---|
access |
public |
static |
string
charts : array
var | |
---|---|
access |
public |
static |
array
config : array
var | |
---|---|
access |
public |
static |
array
currentDocument : \Docxpresso\CreateDocument
currentEndnote : integer
var | |
---|---|
access |
public |
static |
integer
currentFootnote : integer
var | |
---|---|
access |
public |
static |
integer
currentForm : string
var | |
---|---|
access |
public |
static |
string
customTemplate : boolean
var | |
---|---|
access |
public |
static |
boolean
format : string
var | |
---|---|
access |
public |
static |
string
forms : array
var | |
---|---|
access |
public |
static |
array
counter : integer
var | |
---|---|
access |
public |
static |
integer
fields : boolean
var | |
---|---|
access |
public |
static |
boolean
list : array
var | |
---|---|
access |
public |
static |
array
manifest : \Docxpresso\DOMNode
var | |
---|---|
access |
public |
\Docxpresso\DOMNode
math : array
var | |
---|---|
access |
public |
static |
array
mathSettings : array
var | |
---|---|
access |
public |
static |
array
masterStyles : array
var | |
---|---|
access |
public |
static |
array
media : array
var | |
---|---|
access |
public |
static |
array
nodeMap : \Docxpresso\splObjectStorage
var | |
---|---|
access |
public |
static |
\Docxpresso\splObjectStorage
placeholderVariables : array
var | |
---|---|
access |
public |
static |
array
sectionIds : array
var | |
---|---|
access |
public |
static |
array
styleHeader : array
var | |
---|---|
access |
public |
static |
array
styleTarget : array
var | |
---|---|
access |
public |
static |
array
styleTypes : array
..
var | |
---|---|
access |
public |
static |
array
tabStops : array
var | |
---|---|
access |
public |
static |
array
tables : array
var | |
---|---|
access |
public |
static |
array
theme : string
var | |
---|---|
access |
public |
static |
string
toc : boolean
var | |
---|---|
access |
public |
static |
boolean
unid : string
var | |
---|---|
access |
public |
static |
string
updateFields : array
var | |
---|---|
access |
public |
static |
array
updateMath : array
var | |
---|---|
access |
public |
static |
array
XMLMath : array
var | |
---|---|
access |
public |
static |
array
XMLCharts : array
var | |
---|---|
access |
public |
static |
array
contentODF : \Docxpresso\ODFElement
var | |
---|---|
access |
public |
\Docxpresso\ODFElement
template : array
var | |
---|---|
access |
public |
array
_dom : array
var | |
---|---|
access |
private |
array
_styleProcessor : \Docxpresso\StyleProcessor
var | |
---|---|
access |
private |
\Docxpresso\StyleProcessor