Settings
PHPWord settings class
Tags
Table of Contents
- DEFAULT_FONT_COLOR = '000000'
- DEFAULT_FONT_CONTENT_TYPE = 'default'
- DEFAULT_FONT_NAME = 'Arial'
- Default font settings
- DEFAULT_FONT_SIZE = 10
- DEFAULT_PAPER = 'A4'
- OLD_LIB = 'PhpOffice\PhpWord\Shared\ZipArchive'
- PCLZIP = 'PclZip'
- PDF_RENDERER_DOMPDF = 'DomPDF'
- PDF rendering libraries
- PDF_RENDERER_MPDF = 'MPDF'
- PDF_RENDERER_TCPDF = 'TCPDF'
- UNIT_CM = 'cm'
- UNIT_INCH = 'inch'
- UNIT_MM = 'mm'
- UNIT_PICA = 'pica'
- UNIT_POINT = 'point'
- UNIT_TWIP = 'twip'
- Measurement units multiplication factor
- ZIPARCHIVE = 'ZipArchive'
- Zip libraries
- $defaultFontName : string
- Default font name
- $defaultFontSize : int
- Default font size
- $defaultPaper : string
- Default paper
- $measurementUnit : int|float
- Measurement unit
- $outputEscapingEnabled : bool
- Enables built-in output escaping mechanism.
- $pdfRendererName : string
- Name of the external Library used for rendering PDF files
- $pdfRendererPath : string
- Directory Path to the external Library used for rendering PDF files
- $tempDir : string
- The user defined temporary directory.
- $xmlWriterCompatibility : bool
- Compatibility option for XMLWriter
- $zipClass : string
- Name of the class used for Zip file management
- getCompatibility() : mixed
- Return the compatibility option used by the XMLWriter
- getDefaultFontName() : string
- Get default font name
- getDefaultFontSize() : int
- Get default font size
- getDefaultPaper() : string
- Get default paper
- getMeasurementUnit() : string
- Get measurement unit
- getPdfRendererName() : string
- Return the PDF Rendering Library.
- getPdfRendererPath() : string
- Return the directory path to the PDF Rendering Library.
- getTempDir() : string
- Returns path to temporary directory.
- getZipClass() : string
- Get zip handler class
- hasCompatibility() : bool
- Return the compatibility option used by the XMLWriter
- isOutputEscapingEnabled() : bool
- loadConfig() : array<string|int, mixed>
- Load setting from phpword.yml or phpword.yml.dist
- setCompatibility() : bool
- Set the compatibility option used by the XMLWriter
- setDefaultFontName() : bool
- Set default font name
- setDefaultFontSize() : bool
- Set default font size
- setDefaultPaper() : bool
- Set default paper
- setMeasurementUnit() : bool
- Set measurement unit
- setOutputEscapingEnabled() : mixed
- setPdfRenderer() : bool
- Set details of the external library for rendering PDF files
- setPdfRendererName() : bool
- Identify the external library to use for rendering PDF files
- setPdfRendererPath() : bool
- Location of external library to use for rendering PDF files
- setTempDir() : mixed
- Sets the user defined path to temporary directory.
- setZipClass() : bool
- Set zip handler class
Constants
DEFAULT_FONT_COLOR
public
mixed
DEFAULT_FONT_COLOR
= '000000'
DEFAULT_FONT_CONTENT_TYPE
public
mixed
DEFAULT_FONT_CONTENT_TYPE
= 'default'
DEFAULT_FONT_NAME
Default font settings
public
mixed
DEFAULT_FONT_NAME
= 'Arial'
OOXML defined font size values in halfpoints, i.e. twice of what PhpWord use, and the conversion will be conducted during XML writing.
DEFAULT_FONT_SIZE
public
mixed
DEFAULT_FONT_SIZE
= 10
DEFAULT_PAPER
public
mixed
DEFAULT_PAPER
= 'A4'
OLD_LIB
public
mixed
OLD_LIB
= 'PhpOffice\PhpWord\Shared\ZipArchive'
PCLZIP
public
mixed
PCLZIP
= 'PclZip'
PDF_RENDERER_DOMPDF
PDF rendering libraries
public
mixed
PDF_RENDERER_DOMPDF
= 'DomPDF'
Tags
PDF_RENDERER_MPDF
public
mixed
PDF_RENDERER_MPDF
= 'MPDF'
PDF_RENDERER_TCPDF
public
mixed
PDF_RENDERER_TCPDF
= 'TCPDF'
UNIT_CM
public
mixed
UNIT_CM
= 'cm'
UNIT_INCH
public
mixed
UNIT_INCH
= 'inch'
UNIT_MM
public
mixed
UNIT_MM
= 'mm'
UNIT_PICA
public
mixed
UNIT_PICA
= 'pica'
UNIT_POINT
public
mixed
UNIT_POINT
= 'point'
UNIT_TWIP
Measurement units multiplication factor
public
mixed
UNIT_TWIP
= 'twip'
Applied to:
- Section: margins, header/footer height, gutter, column spacing
- Tab: position
- Indentation: left, right, firstLine, hanging
- Spacing: before, after
Tags
ZIPARCHIVE
Zip libraries
public
mixed
ZIPARCHIVE
= 'ZipArchive'
Tags
Properties
$defaultFontName
Default font name
private
static string
$defaultFontName
= self::DEFAULT_FONT_NAME
$defaultFontSize
Default font size
private
static int
$defaultFontSize
= self::DEFAULT_FONT_SIZE
$defaultPaper
Default paper
private
static string
$defaultPaper
= self::DEFAULT_PAPER
$measurementUnit
Measurement unit
private
static int|float
$measurementUnit
= self::UNIT_TWIP
$outputEscapingEnabled
Enables built-in output escaping mechanism.
private
static bool
$outputEscapingEnabled
= false
Default value is false for backward compatibility with versions below 0.13.0.
$pdfRendererName
Name of the external Library used for rendering PDF files
private
static string
$pdfRendererName
= null
$pdfRendererPath
Directory Path to the external Library used for rendering PDF files
private
static string
$pdfRendererPath
= null
$tempDir
The user defined temporary directory.
private
static string
$tempDir
= ''
$xmlWriterCompatibility
Compatibility option for XMLWriter
private
static bool
$xmlWriterCompatibility
= true
$zipClass
Name of the class used for Zip file management
private
static string
$zipClass
= self::ZIPARCHIVE
Methods
getCompatibility()
Return the compatibility option used by the XMLWriter
public
static getCompatibility() : mixed
Tags
Return values
mixed —getDefaultFontName()
Get default font name
public
static getDefaultFontName() : string
Return values
string —getDefaultFontSize()
Get default font size
public
static getDefaultFontSize() : int
Return values
int —getDefaultPaper()
Get default paper
public
static getDefaultPaper() : string
Return values
string —getMeasurementUnit()
Get measurement unit
public
static getMeasurementUnit() : string
Return values
string —getPdfRendererName()
Return the PDF Rendering Library.
public
static getPdfRendererName() : string
Return values
string —getPdfRendererPath()
Return the directory path to the PDF Rendering Library.
public
static getPdfRendererPath() : string
Return values
string —getTempDir()
Returns path to temporary directory.
public
static getTempDir() : string
Tags
Return values
string —getZipClass()
Get zip handler class
public
static getZipClass() : string
Return values
string —hasCompatibility()
Return the compatibility option used by the XMLWriter
public
static hasCompatibility() : bool
Return values
bool —Compatibility
isOutputEscapingEnabled()
public
static isOutputEscapingEnabled() : bool
Tags
Return values
bool —loadConfig()
Load setting from phpword.yml or phpword.yml.dist
public
static loadConfig([string $filename = null ]) : array<string|int, mixed>
Parameters
- $filename : string = null
Return values
array<string|int, mixed> —setCompatibility()
Set the compatibility option used by the XMLWriter
public
static setCompatibility(bool $compatibility) : bool
This sets the setIndent and setIndentString for better compatibility
Parameters
- $compatibility : bool
Return values
bool —setDefaultFontName()
Set default font name
public
static setDefaultFontName(string $value) : bool
Parameters
- $value : string
Return values
bool —setDefaultFontSize()
Set default font size
public
static setDefaultFontSize(int $value) : bool
Parameters
- $value : int
Return values
bool —setDefaultPaper()
Set default paper
public
static setDefaultPaper(string $value) : bool
Parameters
- $value : string
Return values
bool —setMeasurementUnit()
Set measurement unit
public
static setMeasurementUnit(string $value) : bool
Parameters
- $value : string
Return values
bool —setOutputEscapingEnabled()
public
static setOutputEscapingEnabled(bool $outputEscapingEnabled) : mixed
Parameters
- $outputEscapingEnabled : bool
Tags
Return values
mixed —setPdfRenderer()
Set details of the external library for rendering PDF files
public
static setPdfRenderer(string $libraryName, string $libraryBaseDir) : bool
Parameters
- $libraryName : string
- $libraryBaseDir : string
Return values
bool —Success or failure
setPdfRendererName()
Identify the external library to use for rendering PDF files
public
static setPdfRendererName(string $libraryName) : bool
Parameters
- $libraryName : string
Return values
bool —setPdfRendererPath()
Location of external library to use for rendering PDF files
public
static setPdfRendererPath(string $libraryBaseDir) : bool
Parameters
- $libraryBaseDir : string
-
Directory path to the library's base folder
Return values
bool —Success or failure
setTempDir()
Sets the user defined path to temporary directory.
public
static setTempDir(string $tempDir) : mixed
Parameters
- $tempDir : string
-
The user defined path to temporary directory
Tags
Return values
mixed —setZipClass()
Set zip handler class
public
static setZipClass(string $zipClass) : bool
Parameters
- $zipClass : string