PHP 클래스 PHPRtfLite

저자: Denis Slaveckij ([email protected])
저자: Steffen Zeidler ([email protected])
파일 보기 프로젝트 열기: phprtflite/phprtflite 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_borderSurroundsFooter boolean
$_borderSurroundsHeader boolean
$_colorTable PHPRtfLite_DocHead_ColorTable color table instance
$_defaultFont PHPRtfLite_Font default font
$_fontTable PHPRtfLite_DocHead_FontTable font table instance
$_footers PHPRtfLite_Container_Footer[] rtf footers
$_headers PHPRtfLite_Container_Header[] rtf headers
$_properties array rtf properties
$_sections PHPRtfLite_Container_Section[] rtf sections

공개 메소드들

메소드 설명
__construct ( )
addFooter ( string $type = PHPRtfLite_Container_Footer::TYPE_ALL, PHPRtfLite_Container_Footer $footer = null ) : PHPRtfLite_Container_Footer creates footer for the document
addHeader ( string $type = PHPRtfLite_Container_Header::TYPE_ALL, PHPRtfLite_Container_Header $header = null ) : PHPRtfLite_Container_Header creates header for the document
addSection ( PHPRtfLite_Container_Section $section = null ) : PHPRtfLite_Container_Section adds section to rtf document
borderSurroundsFooter ( ) : boolean checks, if border surrounds footer
borderSurroundsHeader ( ) : boolean checks, if border surrounds header
convertNewlinesToRtfCode ( string $text ) : string convert new lines to rtf line breaks
free ( )
getBorder ( ) : PHPRtfLite_Border gets border of document
getCharset ( ) : string gets charset for rtf text inputs
getColorTable ( ) : PHPRtfLite_DocHead_ColorTable gets color table
getContent ( boolean $free = true ) : string gets rtf document code
getDefaultFont ( ) : PHPRtfLite_Font gets default font
getDefaultFontForNotes ( ) : PHPRtfLite_Font gets default font for notes
getDefaultTabWidth ( ) : float sets default tab width of the document
getEndnoteNumberingType ( ) : integer gets endnote numbering type
getEndnoteStartNumber ( ) : integer gets endnote start number
getFontTable ( ) : PHPRtfLite_DocHead_FontTable gets font table
getFooters ( ) : array gets defined footers for document pages
getFootnoteNumberingType ( ) : integer gets footnote numbering type
getFootnoteStartNumber ( ) : integer gets footnote start number
getGutter ( ) : float gets the gutter width
getHeaders ( ) : array gets defined headers for document pages
getMarginBottom ( ) : float gets the bottom margin of document pages
getMarginLeft ( ) : float gets the left margin of document pages
getMarginRight ( ) : float gets the right margin of document pages
getMarginTop ( ) : float gets the top margin of document pages
getNoteDocHead ( ) : PHPRtfLite_DocHead_Note gets document head definition for notes
getPageNumberStart ( ) : integer gets the beginning page number
getPaperHeight ( ) : float gets the paper height of document
getPaperWidth ( ) : float gets the paper width of document
getProperty ( string $name ) : string gets rtf property
getSections ( ) : array gets sections
getViewMode ( ) : integer gets the view mode of the document
getWriter ( ) : PHPRtfLite_Writer_Interface gets writer
getZoomLevel ( ) : integer gets the zoom level (in percents) of the document
getZoomMode ( ) : integer gets the zoom mode of the document
hasSpecialLayoutForFirstPage ( ) : boolean returns true, if first page has special layout
isLandscape ( ) : boolean returns true, if landscape layout should be used
isMirrorMargins ( ) : boolean returns true, if use mirror margins should be used
isOddEvenDifferent ( ) : boolean gets if odd and even headers/footers are different
isRestartEndnoteNumberEachPage ( ) : boolean checks, if endnote numbering shall be started on each page
isRestartFootnoteNumberEachPage ( ) : boolean sets restart endnote number on each page
quoteRtfCode ( string $text, boolean $convertNewlines = true ) : string quotes rtf code
registerAutoloader ( ) : boolean registers autoloader for PHPRtfLite classes
registerFont ( PHPRtfLite_Font $font ) registers the font in color table and font table
registerParFormat ( PHPRtfLite_ParFormat $parFormat ) registers the par format in color table
save ( string $file, boolean $free = true ) saves rtf document to file
sendRtf ( string $filename = 'simple', $free = true ) sends rtf content as file attachment
setBorder ( PHPRtfLite_Border $border ) Sets border to rtf document. Sections may override this border.
setBorderSurroundsFooter ( boolean $borderSurroundsFooter = true ) : PHPRtfLite
setBorderSurroundsHeader ( boolean $borderSurroundsHeader = true ) : PHPRtfLite sets border surrounds header
setBorders ( PHPRtfLite_Border_Format $borderFormat, boolean $left = true, boolean $top = true, boolean $right = true, boolean $bottom = true ) Sets borders to rtf document. Sections may override this border.
setCharset ( string $charset ) sets charset for rtf text inputs
setDefaultFont ( PHPRtfLite_Font $font ) sets default font
setDefaultFontForNotes ( PHPRtfLite_Font $font ) sets default font for notes
setDefaultTabWidth ( float $defaultTabWidth ) sets default tab width of the document
setEndnoteNumberingType ( integer $numberingType ) sets endnote numbering type
setEndnoteStartNumber ( integer $startNumber ) sets endnote start number
setFootnoteNumberingType ( integer $numberingType ) sets footnote numbering type
setFootnoteStartNumber ( integer $startNumber ) sets footnote start number
setGutter ( float $gutter ) sets the gutter width.
NOTICE: Does not work with OpenOffice.
setHyphenation ( ) sets using hyphenation
setLandscape ( ) sets landscape orientation for the document
setMarginBottom ( float $margin ) sets the bottom margin of document pages
setMarginLeft ( float $margin ) sets the left margin of document pages
setMarginRight ( float $margin ) sets the right margin of document pages
setMarginTop ( float $margin ) sets the top margin of document pages
setMargins ( float $marginLeft, float $marginTop, float $marginRight, float $marginBottom ) sets the margins of document pages
setMirrorMargins ( ) sets the margin definitions on left and right pages.
NOTICE: Does not work with OpenOffice.
setOddEvenDifferent ( boolean $different = true ) sets if odd and even headers/footers are different
setPageNumberStart ( integer $pageNumber ) sets the beginning page number
setPaperFormat ( string $paperFormat ) Sets the paper format.
setPaperHeight ( float $height ) sets the paper height of document
setPaperWidth ( float $width ) sets the paper width of document
setProperty ( string $name, mixed $value ) sets document information properties
setRestartEndnoteNumberEachPage ( ) : boolean checks, if footnote numbering shall be started on each page
setRestartFootnoteNumberEachPage ( ) sets restart footnote number on each page
setSpecialLayoutForFirstPage ( boolean $specialLayout = true ) sets that first page has a special layout
setUseTemporaryFile ( boolean $flag = true ) set that a temporary file should be used for creating the output NOTE: is slowing down the rendering because of the io operations, but uses less memory
setViewMode ( integer $viewMode ) sets the view mode of the document
setWriter ( PHPRtfLite_Writer_Interface $writer ) sets writer
setZoomLevel ( integer $zoom ) sets the zoom level (in percents) of the document. By default word uses 100%.
NOTICE: if zoom mode is defined, zoom level is not used.
setZoomMode ( integer $zoomMode ) sets the zoom mode of the document
unregisterAutoloader ( ) : boolean unregisters autoloader for PHPRtfLite classes

보호된 메소드들

메소드 설명
getInfoPart ( ) : string gets rtf info part
render ( ) prepares rtf contents

비공개 메소드들

메소드 설명
createWriter ( string $file = null ) creates writer

메소드 상세

__construct() 공개 메소드

public __construct ( )

addFooter() 공개 메소드

creates footer for the document
public addFooter ( string $type = PHPRtfLite_Container_Footer::TYPE_ALL, PHPRtfLite_Container_Footer $footer = null ) : PHPRtfLite_Container_Footer
$type string Represented by class constants PHPRtfLite_Container_Footer::TYPE_*
Possible values:
PHPRtfLite_Container_Footer::TYPE_ALL all pages (different odd and even headers/footers must be not set)
PHPRtfLite_Container_Footer::TYPE_LEFT left pages (different odd and even headers/footers must be set)
PHPRtfLite_Container_Footer::TYPE_RIGHT right pages (different odd and even headers/footers must be set)
PHPRtfLite_Container_Footer::TYPE_FIRST first page
$footer PHPRtfLite_Container_Footer
리턴 PHPRtfLite_Container_Footer

addHeader() 공개 메소드

creates header for the document
public addHeader ( string $type = PHPRtfLite_Container_Header::TYPE_ALL, PHPRtfLite_Container_Header $header = null ) : PHPRtfLite_Container_Header
$type string Represented by class constants PHPRtfLite_Container_Header::TYPE_*
Possible values:
PHPRtfLite_Container_Header::TYPE_ALL all pages (different odd and even headers/footers must be not set)
PHPRtfLite_Container_Header::TYPE_LEFT left pages (different odd and even headers/footers must be set)
PHPRtfLite_Container_Header::TYPE_RIGHT right pages (different odd and even headers/footers must be set
PHPRtfLite_Container_Header::TYPE_FIRST first page
$header PHPRtfLite_Container_Header
리턴 PHPRtfLite_Container_Header

addSection() 공개 메소드

adds section to rtf document
public addSection ( PHPRtfLite_Container_Section $section = null ) : PHPRtfLite_Container_Section
$section PHPRtfLite_Container_Section
리턴 PHPRtfLite_Container_Section

borderSurroundsFooter() 공개 메소드

checks, if border surrounds footer
public borderSurroundsFooter ( ) : boolean
리턴 boolean

borderSurroundsHeader() 공개 메소드

checks, if border surrounds header
public borderSurroundsHeader ( ) : boolean
리턴 boolean

convertNewlinesToRtfCode() 공개 정적인 메소드

convert new lines to rtf line breaks
public static convertNewlinesToRtfCode ( string $text ) : string
$text string
리턴 string

free() 공개 메소드

public free ( )

getBorder() 공개 메소드

gets border of document
public getBorder ( ) : PHPRtfLite_Border
리턴 PHPRtfLite_Border

getCharset() 공개 메소드

gets charset for rtf text inputs
public getCharset ( ) : string
리턴 string

getColorTable() 공개 메소드

gets color table
public getColorTable ( ) : PHPRtfLite_DocHead_ColorTable
리턴 PHPRtfLite_DocHead_ColorTable

getContent() 공개 메소드

gets rtf document code
public getContent ( boolean $free = true ) : string
$free boolean
리턴 string

getDefaultFont() 공개 메소드

gets default font
public getDefaultFont ( ) : PHPRtfLite_Font
리턴 PHPRtfLite_Font

getDefaultFontForNotes() 공개 메소드

gets default font for notes
public getDefaultFontForNotes ( ) : PHPRtfLite_Font
리턴 PHPRtfLite_Font

getDefaultTabWidth() 공개 메소드

sets default tab width of the document
public getDefaultTabWidth ( ) : float
리턴 float $defaultTabWidth Default tab width

getEndnoteNumberingType() 공개 메소드

gets endnote numbering type

getEndnoteStartNumber() 공개 메소드

gets endnote start number
public getEndnoteStartNumber ( ) : integer
리턴 integer

getFontTable() 공개 메소드

gets font table
public getFontTable ( ) : PHPRtfLite_DocHead_FontTable
리턴 PHPRtfLite_DocHead_FontTable

getFooters() 공개 메소드

gets defined footers for document pages
public getFooters ( ) : array
리턴 array contains PHPRtfLite_Container_FOOTER objects

getFootnoteNumberingType() 공개 메소드

gets footnote numbering type

getFootnoteStartNumber() 공개 메소드

gets footnote start number
public getFootnoteStartNumber ( ) : integer
리턴 integer

getGutter() 공개 메소드

gets the gutter width
public getGutter ( ) : float
리턴 float $gutter gutter width

getHeaders() 공개 메소드

gets defined headers for document pages
public getHeaders ( ) : array
리턴 array contains PHPRtfLite_Container_Header objects

getInfoPart() 보호된 메소드

gets rtf info part
protected getInfoPart ( ) : string
리턴 string

getMarginBottom() 공개 메소드

gets the bottom margin of document pages
public getMarginBottom ( ) : float
리턴 float $margin

getMarginLeft() 공개 메소드

gets the left margin of document pages
public getMarginLeft ( ) : float
리턴 float $margin

getMarginRight() 공개 메소드

gets the right margin of document pages
public getMarginRight ( ) : float
리턴 float $margin

getMarginTop() 공개 메소드

gets the top margin of document pages
public getMarginTop ( ) : float
리턴 float $margin

getNoteDocHead() 공개 메소드

gets document head definition for notes
public getNoteDocHead ( ) : PHPRtfLite_DocHead_Note
리턴 PHPRtfLite_DocHead_Note

getPageNumberStart() 공개 메소드

gets the beginning page number
public getPageNumberStart ( ) : integer
리턴 integer

getPaperHeight() 공개 메소드

gets the paper height of document
public getPaperHeight ( ) : float
리턴 float $paperHeight paper height

getPaperWidth() 공개 메소드

gets the paper width of document
public getPaperWidth ( ) : float
리턴 float $paperWidth paper width

getProperty() 공개 메소드

gets rtf property
public getProperty ( string $name ) : string
$name string
리턴 string

getSections() 공개 메소드

gets sections
public getSections ( ) : array
리턴 array

getViewMode() 공개 메소드

gets the view mode of the document
public getViewMode ( ) : integer
리턴 integer view mode represented as class constants VIEW_MODE_*

getWriter() 공개 메소드

gets writer
public getWriter ( ) : PHPRtfLite_Writer_Interface
리턴 PHPRtfLite_Writer_Interface

getZoomLevel() 공개 메소드

gets the zoom level (in percents) of the document
public getZoomLevel ( ) : integer
리턴 integer $zoom zoom level

getZoomMode() 공개 메소드

gets the zoom mode of the document
public getZoomMode ( ) : integer
리턴 integer

hasSpecialLayoutForFirstPage() 공개 메소드

returns true, if first page has special layout

isLandscape() 공개 메소드

returns true, if landscape layout should be used
public isLandscape ( ) : boolean
리턴 boolean

isMirrorMargins() 공개 메소드

returns true, if use mirror margins should be used
public isMirrorMargins ( ) : boolean
리턴 boolean

isOddEvenDifferent() 공개 메소드

gets if odd and even headers/footers are different
public isOddEvenDifferent ( ) : boolean
리턴 boolean

isRestartEndnoteNumberEachPage() 공개 메소드

checks, if endnote numbering shall be started on each page

isRestartFootnoteNumberEachPage() 공개 메소드

sets restart endnote number on each page

quoteRtfCode() 공개 정적인 메소드

quotes rtf code
public static quoteRtfCode ( string $text, boolean $convertNewlines = true ) : string
$text string
$convertNewlines boolean
리턴 string

registerAutoloader() 공개 정적인 메소드

registers autoloader for PHPRtfLite classes
public static registerAutoloader ( ) : boolean
리턴 boolean

registerFont() 공개 메소드

registers the font in color table and font table
public registerFont ( PHPRtfLite_Font $font )
$font PHPRtfLite_Font

registerParFormat() 공개 메소드

registers the par format in color table
public registerParFormat ( PHPRtfLite_ParFormat $parFormat )
$parFormat PHPRtfLite_ParFormat

render() 보호된 메소드

prepares rtf contents
protected render ( )

save() 공개 메소드

saves rtf document to file
public save ( string $file, boolean $free = true )
$file string Name of file
$free boolean

sendRtf() 공개 메소드

sends rtf content as file attachment
public sendRtf ( string $filename = 'simple', $free = true )
$filename string

setBorder() 공개 메소드

Sets border to rtf document. Sections may override this border.
public setBorder ( PHPRtfLite_Border $border )
$border PHPRtfLite_Border

setBorderSurroundsFooter() 공개 메소드

public setBorderSurroundsFooter ( boolean $borderSurroundsFooter = true ) : PHPRtfLite
$borderSurroundsFooter boolean
리턴 PHPRtfLite

setBorderSurroundsHeader() 공개 메소드

sets border surrounds header
public setBorderSurroundsHeader ( boolean $borderSurroundsHeader = true ) : PHPRtfLite
$borderSurroundsHeader boolean
리턴 PHPRtfLite

setBorders() 공개 메소드

Sets borders to rtf document. Sections may override this border.
public setBorders ( PHPRtfLite_Border_Format $borderFormat, boolean $left = true, boolean $top = true, boolean $right = true, boolean $bottom = true )
$borderFormat PHPRtfLite_Border_Format
$left boolean
$top boolean
$right boolean
$bottom boolean

setCharset() 공개 메소드

sets charset for rtf text inputs
public setCharset ( string $charset )
$charset string

setDefaultFont() 공개 메소드

sets default font
public setDefaultFont ( PHPRtfLite_Font $font )
$font PHPRtfLite_Font

setDefaultFontForNotes() 공개 메소드

sets default font for notes
public setDefaultFontForNotes ( PHPRtfLite_Font $font )
$font PHPRtfLite_Font

setDefaultTabWidth() 공개 메소드

sets default tab width of the document
public setDefaultTabWidth ( float $defaultTabWidth )
$defaultTabWidth float Default tab width

setEndnoteNumberingType() 공개 메소드

sets endnote numbering type
public setEndnoteNumberingType ( integer $numberingType )
$numberingType integer

setEndnoteStartNumber() 공개 메소드

sets endnote start number
public setEndnoteStartNumber ( integer $startNumber )
$startNumber integer

setFootnoteNumberingType() 공개 메소드

sets footnote numbering type
public setFootnoteNumberingType ( integer $numberingType )
$numberingType integer

setFootnoteStartNumber() 공개 메소드

sets footnote start number
public setFootnoteStartNumber ( integer $startNumber )
$startNumber integer

setGutter() 공개 메소드

sets the gutter width.
NOTICE: Does not work with OpenOffice.
public setGutter ( float $gutter )
$gutter float gutter width

setHyphenation() 공개 메소드

sets using hyphenation
public setHyphenation ( )

setLandscape() 공개 메소드

sets landscape orientation for the document
public setLandscape ( )

setMarginBottom() 공개 메소드

sets the bottom margin of document pages
public setMarginBottom ( float $margin )
$margin float

setMarginLeft() 공개 메소드

sets the left margin of document pages
public setMarginLeft ( float $margin )
$margin float

setMarginRight() 공개 메소드

sets the right margin of document pages
public setMarginRight ( float $margin )
$margin float

setMarginTop() 공개 메소드

sets the top margin of document pages
public setMarginTop ( float $margin )
$margin float

setMargins() 공개 메소드

sets the margins of document pages
public setMargins ( float $marginLeft, float $marginTop, float $marginRight, float $marginBottom )
$marginLeft float Margin left (default 3 cm)
$marginTop float Margin top (default 1 cm)
$marginRight float Margin right (default 3 cm)
$marginBottom float Margin bottom (default 2 cm)

setMirrorMargins() 공개 메소드

sets the margin definitions on left and right pages.
NOTICE: Does not work with OpenOffice.
public setMirrorMargins ( )

setOddEvenDifferent() 공개 메소드

sets if odd and even headers/footers are different
public setOddEvenDifferent ( boolean $different = true )
$different boolean

setPageNumberStart() 공개 메소드

sets the beginning page number
public setPageNumberStart ( integer $pageNumber )
$pageNumber integer Beginning page number (if not defined, Word uses 1)

setPaperFormat() 공개 메소드

Sets the paper format.
public setPaperFormat ( string $paperFormat )
$paperFormat string

setPaperHeight() 공개 메소드

sets the paper height of document
public setPaperHeight ( float $height )
$height float paper height

setPaperWidth() 공개 메소드

sets the paper width of document
public setPaperWidth ( float $width )
$width float pager width

setProperty() 공개 메소드

sets document information properties
public setProperty ( string $name, mixed $value )
$name string 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)
$value mixed Value

setRestartEndnoteNumberEachPage() 공개 메소드

checks, if footnote numbering shall be started on each page

setRestartFootnoteNumberEachPage() 공개 메소드

sets restart footnote number on each page

setSpecialLayoutForFirstPage() 공개 메소드

sets that first page has a special layout
public setSpecialLayoutForFirstPage ( boolean $specialLayout = true )
$specialLayout boolean

setUseTemporaryFile() 공개 메소드

set that a temporary file should be used for creating the output NOTE: is slowing down the rendering because of the io operations, but uses less memory
public setUseTemporaryFile ( boolean $flag = true )
$flag boolean default is true

setViewMode() 공개 메소드

sets the view mode of the document
public setViewMode ( integer $viewMode )
$viewMode integer View Mode. Represented as class constants VIEW_MODE_*
Possible values:
VIEW_MODE_NONE => 0 - None
VIEW_MODE_PAGE_LAYOUT => 1 - Page Layout view
VIEW_MODE_OUTLINE => 2 - Outline view
VIEW_MODE_MASTER => 3 - Master Document view
VIEW_MODE_NORMAL => 4 - Normal view
VIEW_MODE_ONLINE_LAYOUT => 5 - Online Layout view

setWriter() 공개 메소드

sets writer
public setWriter ( PHPRtfLite_Writer_Interface $writer )
$writer PHPRtfLite_Writer_Interface

setZoomLevel() 공개 메소드

sets the zoom level (in percents) of the document. By default word uses 100%.
NOTICE: if zoom mode is defined, zoom level is not used.
public setZoomLevel ( integer $zoom )
$zoom integer zoom level

setZoomMode() 공개 메소드

sets the zoom mode of the document
public setZoomMode ( integer $zoomMode )
$zoomMode integer zoom mode. Represented as class constants. Possible values:
ZOOM_MODE_NONE => 0 - None
ZOOM_MODE_FULL_PAGE => 1 - Full Page
ZOOM_MODE_BEST_FIT => 2 - Best Fit

unregisterAutoloader() 공개 정적인 메소드

unregisters autoloader for PHPRtfLite classes
public static unregisterAutoloader ( ) : boolean
리턴 boolean

프로퍼티 상세

$_borderSurroundsFooter 보호되어 있는 프로퍼티

protected bool $_borderSurroundsFooter
리턴 boolean

$_borderSurroundsHeader 보호되어 있는 프로퍼티

protected bool $_borderSurroundsHeader
리턴 boolean

$_colorTable 보호되어 있는 프로퍼티

color table instance
protected PHPRtfLite_DocHead_ColorTable $_colorTable
리턴 PHPRtfLite_DocHead_ColorTable

$_defaultFont 보호되어 있는 프로퍼티

default font
protected PHPRtfLite_Font $_defaultFont
리턴 PHPRtfLite_Font

$_fontTable 보호되어 있는 프로퍼티

font table instance
protected PHPRtfLite_DocHead_FontTable $_fontTable
리턴 PHPRtfLite_DocHead_FontTable

$_footers 보호되어 있는 프로퍼티

rtf footers
protected PHPRtfLite_Container_Footer[] $_footers
리턴 PHPRtfLite_Container_Footer[]

$_headers 보호되어 있는 프로퍼티

rtf headers
protected PHPRtfLite_Container_Header[] $_headers
리턴 PHPRtfLite_Container_Header[]

$_properties 보호되어 있는 프로퍼티

rtf properties
protected array $_properties
리턴 array

$_sections 보호되어 있는 프로퍼티

rtf sections
protected PHPRtfLite_Container_Section[] $_sections
리턴 PHPRtfLite_Container_Section[]