Options
in package
Table of Contents
- $adminPassword : string
- $adminUsername : string
- $chroot : string
- dompdf's "chroot"
- $debugCss : bool
- $debugKeepTemp : bool
- $debugLayout : bool
- $debugLayoutBlocks : bool
- $debugLayoutInline : bool
- $debugLayoutLines : bool
- $debugLayoutPaddingBox : bool
- $debugPng : bool
- $defaultFont : string
- The default font family
- $defaultMediaType : string
- html target media view which should be rendered into pdf.
- $defaultPaperOrientation : string
- The default paper orientation.
- $defaultPaperSize : string
- The default paper size.
- $dpi : int
- Image DPI setting
- $fontCache : string
- The location of the DOMPDF font cache directory
- $fontDir : string
- The location of the DOMPDF font directory
- $fontHeightRatio : float
- A ratio applied to the fonts height to be more like browsers' line height
- $isFontSubsettingEnabled : bool
- Whether to enable font subsetting or not.
- $isHtml5ParserEnabled : bool
- Use the more-than-experimental HTML5 Lib parser
- $isJavascriptEnabled : bool
- Enable inline Javascript
- $isPhpEnabled : bool
- Enable embedded PHP
- $isRemoteEnabled : bool
- Enable remote file access
- $logOutputFile : string
- $pdfBackend : string
- The PDF rendering backend to use
- $pdflibLicense : string
- PDFlib license key
- $rootDir : string
- The root of your DOMPDF installation
- $tempDir : string
- The location of a temporary directory.
- __construct() : mixed
- get() : mixed
- getAdminPassword() : string
- getAdminUsername() : string
- getChroot() : string
- getDebugCss() : bool
- getDebugKeepTemp() : bool
- getDebugLayout() : bool
- getDebugLayoutBlocks() : bool
- getDebugLayoutInline() : bool
- getDebugLayoutLines() : bool
- getDebugLayoutPaddingBox() : bool
- getDebugPng() : bool
- getDefaultFont() : string
- getDefaultMediaType() : string
- getDefaultPaperOrientation() : string
- getDefaultPaperSize() : string
- getDpi() : int
- getFontCache() : string
- getFontDir() : string
- getFontHeightRatio() : float
- getIsFontSubsettingEnabled() : bool
- getIsHtml5ParserEnabled() : bool
- getIsJavascriptEnabled() : bool
- getIsPhpEnabled() : bool
- getIsRemoteEnabled() : bool
- getLogOutputFile() : string
- getPdfBackend() : string
- getPdflibLicense() : string
- getRootDir() : string
- getTempDir() : string
- isFontSubsettingEnabled() : bool
- isHtml5ParserEnabled() : bool
- isJavascriptEnabled() : bool
- isPhpEnabled() : bool
- isRemoteEnabled() : bool
- set() : $this
- setAdminPassword() : $this
- setAdminUsername() : $this
- setChroot() : $this
- setDebugCss() : $this
- setDebugKeepTemp() : $this
- setDebugLayout() : $this
- setDebugLayoutBlocks() : $this
- setDebugLayoutInline() : $this
- setDebugLayoutLines() : $this
- setDebugLayoutPaddingBox() : $this
- setDebugPng() : $this
- setDefaultFont() : $this
- setDefaultMediaType() : $this
- setDefaultPaperOrientation() : $this
- setDefaultPaperSize() : $this
- setDpi() : $this
- setFontCache() : $this
- setFontDir() : $this
- setFontHeightRatio() : $this
- setIsFontSubsettingEnabled() : $this
- setIsHtml5ParserEnabled() : $this
- setIsJavascriptEnabled() : $this
- setIsPhpEnabled() : $this
- setIsRemoteEnabled() : $this
- setLogOutputFile() : $this
- setPdfBackend() : $this
- setPdflibLicense() : $this
- setRootDir() : $this
- setTempDir() : $this
Properties
$adminPassword
private
string
$adminPassword
= "password"
Tags
$adminUsername
private
string
$adminUsername
= "user"
Tags
$chroot
dompdf's "chroot"
private
string
$chroot
Prevents dompdf from accessing system files or other files on the webserver. All local files opened by dompdf must be in a subdirectory of this directory. DO NOT set it to '/' since this could allow an attacker to use dompdf to read any files on the server. This should be an absolute path.
==== IMPORTANT ==== This setting may increase the risk of system exploit. Do not change this settings without understanding the consequences. Additional documentation is available on the dompdf wiki at: https://github.com/dompdf/dompdf/wiki
$debugCss
private
bool
$debugCss
= false
$debugKeepTemp
private
bool
$debugKeepTemp
= false
$debugLayout
private
bool
$debugLayout
= false
$debugLayoutBlocks
private
bool
$debugLayoutBlocks
= true
$debugLayoutInline
private
bool
$debugLayoutInline
= true
$debugLayoutLines
private
bool
$debugLayoutLines
= true
$debugLayoutPaddingBox
private
bool
$debugLayoutPaddingBox
= true
$debugPng
private
bool
$debugPng
= false
$defaultFont
The default font family
private
string
$defaultFont
= "serif"
Used if no suitable fonts can be found. This must exist in the font folder.
$defaultMediaType
html target media view which should be rendered into pdf.
private
string
$defaultMediaType
= "screen"
List of types and parsing rules for future extensions: http://www.w3.org/TR/REC-html40/types.html screen, tty, tv, projection, handheld, print, braille, aural, all Note: aural is deprecated in CSS 2.1 because it is replaced by speech in CSS 3. Note, even though the generated pdf file is intended for print output, the desired content might be different (e.g. screen or projection view of html file). Therefore allow specification of content here.
$defaultPaperOrientation
The default paper orientation.
private
string
$defaultPaperOrientation
= "portrait"
The orientation of the page (portrait or landscape).
$defaultPaperSize
The default paper size.
private
string
$defaultPaperSize
= "letter"
North America standard is "letter"; other countries generally "a4"
Tags
$dpi
Image DPI setting
private
int
$dpi
= 96
This setting determines the default DPI setting for images and fonts. The DPI may be overridden for inline images by explicitly setting the image's width & height style attributes (i.e. if the image's native width is 600 pixels and you specify the image's width as 72 points, the image will have a DPI of 600 in the rendered PDF. The DPI of background images can not be overridden and is controlled entirely via this parameter.
For the purposes of DOMPDF, pixels per inch (PPI) = dots per inch (DPI). If a size in html is given as px (or without unit as image size), this tells the corresponding size in pt at 72 DPI. This adjusts the relative sizes to be similar to the rendering of the html page in a reference browser.
In pdf, always 1 pt = 1/72 inch
$fontCache
The location of the DOMPDF font cache directory
private
string
$fontCache
This directory contains the cached font metrics for the fonts used by DOMPDF. This directory can be the same as $fontDir
Note: This directory must exist and be writable by the webserver process.
$fontDir
The location of the DOMPDF font directory
private
string
$fontDir
The location of the directory where DOMPDF will store fonts and font metrics Note: This directory must exist and be writable by the webserver process.
$fontHeightRatio
A ratio applied to the fonts height to be more like browsers' line height
private
float
$fontHeightRatio
= 1.1
$isFontSubsettingEnabled
Whether to enable font subsetting or not.
private
bool
$isFontSubsettingEnabled
= true
$isHtml5ParserEnabled
Use the more-than-experimental HTML5 Lib parser
private
bool
$isHtml5ParserEnabled
= false
$isJavascriptEnabled
Enable inline Javascript
private
bool
$isJavascriptEnabled
= true
If this setting is set to true then DOMPDF will automatically insert JavaScript code contained within <script type="text/javascript"> ... </script> tags.
$isPhpEnabled
Enable embedded PHP
private
bool
$isPhpEnabled
= false
If this setting is set to true then DOMPDF will automatically evaluate embedded PHP contained within <script type="text/php"> ... </script> tags.
==== IMPORTANT ==== Enabling this for documents you do not trust (e.g. arbitrary remote html pages) is a security risk. Embedded scripts are run with the same level of system access available to dompdf. Set this option to false (recommended) if you wish to process untrusted documents.
This setting may increase the risk of system exploit. Do not change this settings without understanding the consequences. Additional documentation is available on the dompdf wiki at: https://github.com/dompdf/dompdf/wiki
$isRemoteEnabled
Enable remote file access
private
bool
$isRemoteEnabled
= false
If this setting is set to true, DOMPDF will access remote sites for images and CSS files as required.
==== IMPORTANT ==== This can be a security risk, in particular in combination with isPhpEnabled and allowing remote html code to be passed to $dompdf = new DOMPDF(); $dompdf->load_html(...); This allows anonymous users to download legally doubtful internet content which on tracing back appears to being downloaded by your server, or allows malicious php code in remote html pages to be executed by your server with your account privileges.
This setting may increase the risk of system exploit. Do not change this settings without understanding the consequences. Additional documentation is available on the dompdf wiki at: https://github.com/dompdf/dompdf/wiki
$logOutputFile
private
string
$logOutputFile
$pdfBackend
The PDF rendering backend to use
private
string
$pdfBackend
= "CPDF"
Valid settings are 'PDFLib', 'CPDF', 'GD', and 'auto'. 'auto' will look for PDFLib and use it if found, or if not it will fall back on CPDF. 'GD' renders PDFs to graphic files. ultimately determines which rendering class to instantiate based on this setting.
$pdflibLicense
PDFlib license key
private
string
$pdflibLicense
= ""
If you are using a licensed, commercial version of PDFlib, specify your license key here. If you are using PDFlib-Lite or are evaluating the commercial version of PDFlib, comment out this setting.
Tags
$rootDir
The root of your DOMPDF installation
private
string
$rootDir
$tempDir
The location of a temporary directory.
private
string
$tempDir
The directory specified must be writable by the webserver process. The temporary directory is required to download remote images and when using the PFDLib back end.
Methods
__construct()
public
__construct([array<string|int, mixed> $attributes = null ]) : mixed
Parameters
- $attributes : array<string|int, mixed> = null
Return values
mixed —get()
public
get(string $key) : mixed
Parameters
- $key : string
Return values
mixed —getAdminPassword()
public
getAdminPassword() : string
Return values
string —getAdminUsername()
public
getAdminUsername() : string
Return values
string —getChroot()
public
getChroot() : string
Return values
string —getDebugCss()
public
getDebugCss() : bool
Return values
bool —getDebugKeepTemp()
public
getDebugKeepTemp() : bool
Return values
bool —getDebugLayout()
public
getDebugLayout() : bool
Return values
bool —getDebugLayoutBlocks()
public
getDebugLayoutBlocks() : bool
Return values
bool —getDebugLayoutInline()
public
getDebugLayoutInline() : bool
Return values
bool —getDebugLayoutLines()
public
getDebugLayoutLines() : bool
Return values
bool —getDebugLayoutPaddingBox()
public
getDebugLayoutPaddingBox() : bool
Return values
bool —getDebugPng()
public
getDebugPng() : bool
Return values
bool —getDefaultFont()
public
getDefaultFont() : string
Return values
string —getDefaultMediaType()
public
getDefaultMediaType() : string
Return values
string —getDefaultPaperOrientation()
public
getDefaultPaperOrientation() : string
Return values
string —getDefaultPaperSize()
public
getDefaultPaperSize() : string
Return values
string —getDpi()
public
getDpi() : int
Return values
int —getFontCache()
public
getFontCache() : string
Return values
string —getFontDir()
public
getFontDir() : string
Return values
string —getFontHeightRatio()
public
getFontHeightRatio() : float
Return values
float —getIsFontSubsettingEnabled()
public
getIsFontSubsettingEnabled() : bool
Return values
bool —getIsHtml5ParserEnabled()
public
getIsHtml5ParserEnabled() : bool
Return values
bool —getIsJavascriptEnabled()
public
getIsJavascriptEnabled() : bool
Return values
bool —getIsPhpEnabled()
public
getIsPhpEnabled() : bool
Return values
bool —getIsRemoteEnabled()
public
getIsRemoteEnabled() : bool
Return values
bool —getLogOutputFile()
public
getLogOutputFile() : string
Return values
string —getPdfBackend()
public
getPdfBackend() : string
Return values
string —getPdflibLicense()
public
getPdflibLicense() : string
Return values
string —getRootDir()
public
getRootDir() : string
Return values
string —getTempDir()
public
getTempDir() : string
Return values
string —isFontSubsettingEnabled()
public
isFontSubsettingEnabled() : bool
Return values
bool —isHtml5ParserEnabled()
public
isHtml5ParserEnabled() : bool
Return values
bool —isJavascriptEnabled()
public
isJavascriptEnabled() : bool
Return values
bool —isPhpEnabled()
public
isPhpEnabled() : bool
Return values
bool —isRemoteEnabled()
public
isRemoteEnabled() : bool
Return values
bool —set()
public
set(array<string|int, mixed>|string $attributes[, null|mixed $value = null ]) : $this
Parameters
- $attributes : array<string|int, mixed>|string
- $value : null|mixed = null
Return values
$this —setAdminPassword()
public
setAdminPassword(string $adminPassword) : $this
Parameters
- $adminPassword : string
Return values
$this —setAdminUsername()
public
setAdminUsername(string $adminUsername) : $this
Parameters
- $adminUsername : string
Return values
$this —setChroot()
public
setChroot(string $chroot) : $this
Parameters
- $chroot : string
Return values
$this —setDebugCss()
public
setDebugCss(bool $debugCss) : $this
Parameters
- $debugCss : bool
Return values
$this —setDebugKeepTemp()
public
setDebugKeepTemp(bool $debugKeepTemp) : $this
Parameters
- $debugKeepTemp : bool
Return values
$this —setDebugLayout()
public
setDebugLayout(bool $debugLayout) : $this
Parameters
- $debugLayout : bool
Return values
$this —setDebugLayoutBlocks()
public
setDebugLayoutBlocks(bool $debugLayoutBlocks) : $this
Parameters
- $debugLayoutBlocks : bool
Return values
$this —setDebugLayoutInline()
public
setDebugLayoutInline(bool $debugLayoutInline) : $this
Parameters
- $debugLayoutInline : bool
Return values
$this —setDebugLayoutLines()
public
setDebugLayoutLines(bool $debugLayoutLines) : $this
Parameters
- $debugLayoutLines : bool
Return values
$this —setDebugLayoutPaddingBox()
public
setDebugLayoutPaddingBox(bool $debugLayoutPaddingBox) : $this
Parameters
- $debugLayoutPaddingBox : bool
Return values
$this —setDebugPng()
public
setDebugPng(bool $debugPng) : $this
Parameters
- $debugPng : bool
Return values
$this —setDefaultFont()
public
setDefaultFont(string $defaultFont) : $this
Parameters
- $defaultFont : string
Return values
$this —setDefaultMediaType()
public
setDefaultMediaType(string $defaultMediaType) : $this
Parameters
- $defaultMediaType : string
Return values
$this —setDefaultPaperOrientation()
public
setDefaultPaperOrientation(string $defaultPaperOrientation) : $this
Parameters
- $defaultPaperOrientation : string
Return values
$this —setDefaultPaperSize()
public
setDefaultPaperSize(string $defaultPaperSize) : $this
Parameters
- $defaultPaperSize : string
Return values
$this —setDpi()
public
setDpi(int $dpi) : $this
Parameters
- $dpi : int
Return values
$this —setFontCache()
public
setFontCache(string $fontCache) : $this
Parameters
- $fontCache : string
Return values
$this —setFontDir()
public
setFontDir(string $fontDir) : $this
Parameters
- $fontDir : string
Return values
$this —setFontHeightRatio()
public
setFontHeightRatio(float $fontHeightRatio) : $this
Parameters
- $fontHeightRatio : float
Return values
$this —setIsFontSubsettingEnabled()
public
setIsFontSubsettingEnabled(bool $isFontSubsettingEnabled) : $this
Parameters
- $isFontSubsettingEnabled : bool
Return values
$this —setIsHtml5ParserEnabled()
public
setIsHtml5ParserEnabled(bool $isHtml5ParserEnabled) : $this
Parameters
- $isHtml5ParserEnabled : bool
Return values
$this —setIsJavascriptEnabled()
public
setIsJavascriptEnabled(bool $isJavascriptEnabled) : $this
Parameters
- $isJavascriptEnabled : bool
Return values
$this —setIsPhpEnabled()
public
setIsPhpEnabled(bool $isPhpEnabled) : $this
Parameters
- $isPhpEnabled : bool
Return values
$this —setIsRemoteEnabled()
public
setIsRemoteEnabled(bool $isRemoteEnabled) : $this
Parameters
- $isRemoteEnabled : bool
Return values
$this —setLogOutputFile()
public
setLogOutputFile(string $logOutputFile) : $this
Parameters
- $logOutputFile : string
Return values
$this —setPdfBackend()
public
setPdfBackend(string $pdfBackend) : $this
Parameters
- $pdfBackend : string
Return values
$this —setPdflibLicense()
public
setPdflibLicense(string $pdflibLicense) : $this
Parameters
- $pdflibLicense : string
Return values
$this —setRootDir()
public
setRootDir(string $rootDir) : $this
Parameters
- $rootDir : string
Return values
$this —setTempDir()
public
setTempDir(string $tempDir) : $this
Parameters
- $tempDir : string