Class Rtf

Description

Class for creating rtf documents.

  • copyright: 2007-2008 Denis Slaveckij
  • author: Denis Slaveckij <info@phprtf.com>
  • version: 0.3.0

Located in /Rtf.php (line 29)


	
			
Variable Summary
Method Summary
Rtf Rtf ()
void addColor (string $color)
void addFont (string $font)
Footer &addFooter ([string $type = 'all'])
Header &addHeader ([string $type = 'all'])
string getBackColor (string $backColor)
string getColor (string $color)
string getFont (string $font)
string getFontColor (string $fontColor)
void save (string $fileName)
void sendRtf ([string $fileName = "simple"])
void setBorders (BorderFormat &$borderFormat, [boolean $left = true], [boolean $top = true], [boolean $right = true], [boolean $bottom = true])
void setDefaultTabWidth (float $defaultTabWidth)
void setGutter (float $gutter)
void setInfo (string $property, mixed $value)
void setLandscape ()
void setMargins (float $marginLeft, float $marginTop, float $marginRight, float $marginBottom)
void setPaperHeight (float $paperHeight)
void setPaperWidth (float $paperWidth)
void setStartPage (float $startPage)
void setViewMode (integer $viewMode)
void setZoom (integer $zoom)
void setZoomKind (integer $zoomKind)
Variables
mixed $footers = array() (line 39)

Internal use.

  • access: public
mixed $headers = array() (line 37)

Internal use.

  • access: public
mixed $marginBottom = 2 (line 51)

Internal use.

  • access: public
mixed $marginLeft = 3 (line 45)

Internal use.

  • access: public
mixed $marginRight = 3 (line 47)

Internal use.

  • access: public
mixed $marginTop = 1 (line 49)

Internal use.

  • access: public
mixed $oddEvenDifferent (line 53)

Internal use.

  • access: public
mixed $paperHeight = 29 (line 43)

Internal use.

  • access: public
mixed $paperWidth = 21 (line 41)

Internal use.

  • access: public
mixed $sections = array() (line 35)

Internal use.

  • access: public
Methods
Constructor Rtf (line 90)

Rtf constructor.

  • access: public
Rtf Rtf ()
addColor (line 389)

Adds color to rtf document. Internal use.

  • access: public
void addColor (string $color)
  • string $color: Color
addFont (line 375)

Adds font to rtf document. Internal use.

  • access: public
void addFont (string $font)
  • string $font: Font
addFooter (line 324)

Creates footer for document pages.

  • access: public
Footer &addFooter ([string $type = 'all'])
  • string $type: Possible values:
    'all' => all pages (different odd and even headers/footers must be not set)
    'left' => left pages (different odd and even headers/footers must be set)
    'right' => right pages (different odd and even headers/footers must be set)
    'first' => first page
addHeader (line 295)

Creates header for document pages.

  • access: public
Header &addHeader ([string $type = 'all'])
  • string $type: Possible values:
    'all' => all pages (different odd and even headers/footers must be not set)
    'left' => left pages (different odd and even headers/footers must be set)
    'right' => right pages (different odd and even headers/footers must be set)
    'first' => first page
addSection (line 134)

Adds section to rtf document.

  • access: public
Section &addSection ()
getBackColor (line 434)

Gets rtf code of background color. Internal use.

  • access: public
string getBackColor (string $backColor)
  • string $backColor: Background color
getColor (line 414)

Gets rtf code of color. Internal use.

  • access: public
string getColor (string $color)
  • string $color: Color
getFont (line 404)

Gets rtf code of font. Internal use.

  • access: public
string getFont (string $font)
  • string $font: Font
getFontColor (line 424)

Gets rtf code of font color. Internal use.

  • access: public
string getFontColor (string $fontColor)
  • string $fontColor: Font color
save (line 346)

Saves rtf document to file.

  • access: public
void save (string $fileName)
  • string $fileName: Name of file
sendRtf (line 358)

Sends rtf content as file attachment.

  • access: public
void sendRtf ([string $fileName = "simple"])
  • string $fileName: Name of file
setBorders (line 269)

Sets borders of document pages. Sections can override this borders.

  • access: public
void setBorders (BorderFormat &$borderFormat, [boolean $left = true], [boolean $top = true], [boolean $right = true], [boolean $bottom = true])
  • BorderFormat &$borderFormat
  • boolean $left: If false, left border is not set (default true)
  • boolean $top: If false, top border is not set (default true)
  • boolean $right: If false, right border is not set (default true)
  • boolean $bottom: If false, bottom border is not set (default true)
setDefaultTabWidth (line 151)

Sets default tab width of the document.

  • access: public
void setDefaultTabWidth (float $defaultTabWidth)
  • float $defaultTabWidth: Default tab width
setGutter (line 203)

Sets the gutter width.
NOTICE: OpenOficce doesn't understant.

  • access: public
void setGutter (float $gutter)
  • float $gutter: Gutter width
setInfo (line 112)

SetS document information properties.

void setInfo (string $property, mixed $value)
  • string $property: Property of document. Possible properties:
    'title' => title of the document (value string)
    'subject' => subject of the document (value string)
    'author' => author of the document (value string)
    'manager' => manager of the document (value string)
    'company' => company of author (value string)
    'operator' => operator of document. Operator is a person who last made changes to the document. (value string)
    'category' => category of document (value string)
    'keywords' => keywords of document (value string)
    'doccomm' => comments of document (value string)
    'creatim' => creation time (value int)
    'revtim' => last revision time (value int)
    'buptim' => last backup time (value int)
    'printim' => last print time (value int)
  • mixed $value: Value
setLandscape (line 256)

Sets landscape orientation of paper.

void setLandscape ()
setMargins (line 181)

Sets the margins of document pages.

  • access: public
void setMargins (float $marginLeft, float $marginTop, float $marginRight, float $marginBottom)
  • float $marginLeft: Margin left (default 3 cm)
  • float $marginTop: Margin top (default 1 cm)
  • float $marginRight: Margin right (default 3 cm)
  • float $marginBottom: Margin bottom (default 2 cm)
setMirrorMargins (line 193)

Sets the margin definitions on left and right pages.
NOTICE: OpenOficce doesn't Understant.

  • access: public
void setMirrorMargins ()
setOddEvenDifferent (line 281)

Sets if odd and even headers/footers are different

  • access: public
void setOddEvenDifferent ()
setPaperHeight (line 169)

Sets the paper height of document.

  • access: public
void setPaperHeight (float $paperHeight)
  • float $paperHeight: Paper height
setPaperWidth (line 160)

Sets the paper width of document.

  • access: public
void setPaperWidth (float $paperWidth)
  • float $paperWidth: Paper width
setStartPage (line 212)

Sets the beginning page number.

  • access: public
void setStartPage (float $startPage)
  • float $startPage: Beginning page number (if not defined, Word understands as 1)
setViewMode (line 227)

Sets the view mode of the document.

  • access: public
void setViewMode (integer $viewMode)
  • integer $viewMode: (0 - 5) $viewMode View Mode. Possible values:
    '0' => None
    '1' => Page Layout view
    '2' - Outline view
    '3' - Master Document view
    '4' - Normal view
    '5' - Online Layout view
setZoom (line 237)

Sets the zoom level (in percents) of the document. By default word understands as 100%.
NOTICE: if zoom kind is defined, zoom level is not used.

  • access: public
void setZoom (integer $zoom)
  • integer $zoom: Zoom Level
setZoomKind (line 249)

Sets the zoom kind of the document.

  • access: public
void setZoomKind (integer $zoomKind)
  • integer $zoomKind: Zoom kind. Possible values:
    '0' => None
    '1' => Full Page
    '2' => Best Fit

Documentation generated on Fri, 25 Jan 2008 23:10:51 +0200 by phpDocumentor 1.3.1