Documentation

RTF extends AbstractWriter
in package
implements WriterInterface

RTF writer.

Tags
since
0.7.0

Table of Contents

Interfaces

WriterInterface
Writer interface.

Properties

$mediaPaths  : array<string|int, mixed>
Paths to store media files.
$parts  : array<string|int, mixed>
Part name and file name pairs.
$phpWord  : PhpWord
PHPWord object.
$writerParts  : array<string|int, mixed>
Individual writers.
$diskCachingDirectory  : string
Disk caching directory.
$lastParagraphStyle  : mixed
Last paragraph style.
$originalFilename  : string
Original file name.
$tempDir  : string
Temporary directory.
$tempFilename  : string
Temporary file name.
$useDiskCaching  : bool
Use disk caching.

Methods

__construct()  : mixed
Create new instance.
getColorTable()  : array<string|int, mixed>
Get color table.
getDiskCachingDirectory()  : string
Get disk caching directory.
getFontTable()  : array<string|int, mixed>
Get font table.
getLastParagraphStyle()  : mixed
Get last paragraph style.
getPhpWord()  : PhpWord
Get PhpWord object.
getTempDir()  : string
Get temporary directory.
getWriterPart()  : mixed
Get writer part.
isUseDiskCaching()  : bool
Get use disk caching status.
save()  : void
Save content to file.
setLastParagraphStyle()  : void
Set last paragraph style.
setPhpWord()  : self
Set PhpWord object.
setTempDir()  : self
Set temporary directory.
setUseDiskCaching()  : self
Set use disk caching status.
addFilesToPackage()  : void
Add files to package.
addFileToPackage()  : void
Add file to package.
cleanupTempFile()  : void
Cleanup temporary file.
clearTempDir()  : void
Clear temporary directory.
getTempFile()  : string
Get temporary file name.
getZipArchive()  : ZipArchive
Get ZipArchive object.
openFile()  : resource
Open file for writing.
writeFile()  : void
Write content to file.
deleteDir()  : void
Delete directory.
getContent()  : string
Get content.

Properties

$mediaPaths

Paths to store media files.

protected array<string|int, mixed> $mediaPaths = ['image' => '', 'object' => '']

$parts

Part name and file name pairs.

protected array<string|int, mixed> $parts = []

$writerParts

Individual writers.

protected array<string|int, mixed> $writerParts = []

$diskCachingDirectory

Disk caching directory.

private string $diskCachingDirectory = './'

$lastParagraphStyle

Last paragraph style.

private mixed $lastParagraphStyle

$originalFilename

Original file name.

private string $originalFilename

$useDiskCaching

Use disk caching.

private bool $useDiskCaching = false

Methods

__construct()

Create new instance.

public __construct([PhpWord|null $phpWord = null ]) : mixed
Parameters
$phpWord : PhpWord|null = null

getColorTable()

Get color table.

public getColorTable() : array<string|int, mixed>
Return values
array<string|int, mixed>

getDiskCachingDirectory()

Get disk caching directory.

public getDiskCachingDirectory() : string
Return values
string

getFontTable()

Get font table.

public getFontTable() : array<string|int, mixed>
Return values
array<string|int, mixed>

getLastParagraphStyle()

Get last paragraph style.

public getLastParagraphStyle() : mixed

getTempDir()

Get temporary directory.

public getTempDir() : string
Return values
string

getWriterPart()

Get writer part.

public getWriterPart([string $partName = '' ]) : mixed
Parameters
$partName : string = ''

Writer part name

isUseDiskCaching()

Get use disk caching status.

public isUseDiskCaching() : bool
Return values
bool

save()

Save content to file.

public save(string $filename) : void
Parameters
$filename : string

setLastParagraphStyle()

Set last paragraph style.

public setLastParagraphStyle([mixed $value = '' ]) : void
Parameters
$value : mixed = ''

setPhpWord()

Set PhpWord object.

public setPhpWord([PhpWord|null $phpWord = null ]) : self
Parameters
$phpWord : PhpWord|null = null
Return values
self

setTempDir()

Set temporary directory.

public setTempDir(string $value) : self
Parameters
$value : string
Return values
self

setUseDiskCaching()

Set use disk caching status.

public setUseDiskCaching([bool $value = false ][, string $directory = null ]) : self
Parameters
$value : bool = false
$directory : string = null
Return values
self

addFileToPackage()

Add file to package.

protected addFileToPackage(ZipArchive $zipPackage, string $source, string $target) : void

Get the actual source from an archive image.

Parameters
$zipPackage : ZipArchive
$source : string
$target : string

cleanupTempFile()

Cleanup temporary file.

protected cleanupTempFile() : void

clearTempDir()

Clear temporary directory.

protected clearTempDir() : void

getTempFile()

Get temporary file name.

protected getTempFile(string $filename) : string

If $filename is php://output or php://stdout, make it a temporary file

Parameters
$filename : string
Return values
string

openFile()

Open file for writing.

protected openFile(string $filename) : resource
Parameters
$filename : string
Tags
since
0.11.0
Return values
resource

writeFile()

Write content to file.

protected writeFile(resource $fileHandle, string $content) : void
Parameters
$fileHandle : resource
$content : string
Tags
since
0.11.0

deleteDir()

Delete directory.

private deleteDir(string $dir) : void
Parameters
$dir : string

getContent()

Get content.

private getContent() : string
Tags
since
0.11.0
Return values
string

        
On this page

Search results