Table of contents
Namespace: Com\Tecnick\Pdf
abstract class CSS extends SVG
Extends: SVG
Source: src/CSS.php:77
CSS PDF class
Types
BorderStyle
array{
lineWidth: float,
lineCap: string,
lineJoin: string,
miterLimit: float,
dashArray: array<int>,
dashPhase: float,
lineColor: string,
fillColor: string,
cssBorderStyle?: string,
}
BorderStyleOpt
array{
lineWidth?: float,
lineCap?: string,
lineJoin?: string,
miterLimit?: float,
dashArray?: array<int>,
dashPhase?: float,
lineColor?: string,
fillColor?: string,
cssBorderStyle?: string,
}
TCSSBorderSpacing
array{
'H': float,
'V': float,
}
TCSSData
array{
'k': string,
'c': string,
's': string,
}
Methods
addGlobalCSS()
Append CSS content to the global CSS applied as a base stylesheet to all HTML rendering calls.
public addGlobalCSS(string $css): void
Parameters:
$css(string): CSS content without surrounding <style> tags, appended after the current global CSS.
Source: src/CSS.php:223
resetGlobalCSS()
Reset (clear) the global CSS so no base stylesheet is applied to HTML rendering calls.
public resetGlobalCSS(): void
Source: src/CSS.php:235
setDefaultCSSBorderSpacing()
Set the default CSS border spacing in user units.
public setDefaultCSSBorderSpacing(float $vert, float $horiz): void
Parameters:
$vert(float): Vertical space.$horiz(float): Horizontal space.
Source: src/CSS.php:194
setDefaultCSSMargin()
Set the default CSS margin in user units.
public setDefaultCSSMargin(float $top, float $right, float $bottom, float $left): void
Parameters:
$top(float): Top.$right(float): Right.$bottom(float): Bottom.$left(float): Left.
Source: src/CSS.php:164
setDefaultCSSPadding()
Set the default CSS padding in user units.
public setDefaultCSSPadding(float $top, float $right, float $bottom, float $left): void
Parameters:
$top(float): Top.$right(float): Right.$bottom(float): Bottom.$left(float): Left.
Source: src/CSS.php:180
setGlobalCSS()
Set the global CSS content applied as a base stylesheet to all HTML rendering calls.
The global CSS is injected as the lowest-priority author source, so any matching rule defined in the HTML document (inline style, embedded <style> or linked stylesheet) overrides it on equal specificity. Use !important within the global CSS to force precedence. The content is parsed with the same engine as document CSS, so @import, @media and @spot rules are supported.
public setGlobalCSS(string $css): void
Parameters:
$css(string): CSS content without surrounding <style> tags. Replaces any previously defined global CSS.
Source: src/CSS.php:212
Inherited members
From Base
- BORDERPOS_DEFAULT: The default relative position of the cell origin when the border is centered on the cell edge.
- BORDERPOS_EXTERNAL: The relative position of the cell origin when the border is external to the cell edge.
- BORDERPOS_INTERNAL: The relative position of the cell origin when the border is internal to the cell edge.
- ZEROCELL: Default values for cell.
- ZEROCELLBOUND: Default values for cell boundaries.
- $barcode: Barcode object.
- $cache: Cache object.
- $color: Color object.
- $encrypt: Encrypt object.
- $file: File object.
- $font: Font object.
- $graph: Graph object.
- $image: Image Import object.
- $markupFile: File object for markup-originated resources.
- $page: Page object.
- $pon: Current PDF object number.
- $uniconv: Unicode Convert object.
- defaultFileAllowedPaths(): Returns the default array of allowed file paths.
- defaultMarkupAllowedPaths(): Returns the default array of allowed file paths for markup-originated resources.
- enableDefaultPageContent(): Enable or disable the default page content.
- getWarnings(): Return the conformance warnings raised while the document was rendered.
- initClassObjects(): Initialize dependencies class objects.
- setPDFVersion(): Set the PDF version (check PDF reference for valid values).
- setRTL(): Set the default document language direction.
- toPoints(): Convert user units to internal points unit.
- toUnit(): Convert internal points to user unit.
- toYPoints(): Convert vertical user value to internal points unit.
- toYUnit(): Convert vertical internal points value to user unit.
From Cell
- setDefaultCellBorderPos(): Sets the default cell border position.
- setDefaultCellMargin(): Set the default cell margin in user units.
- setDefaultCellPadding(): Set the default cell padding in user units.
From SVG
- addSVG(): Add a new SVG image and return its object ID.
- getSetSVG(): Get the PDF output string to print the specified SVG object.
- setLink(): Create a link annotation in the specified rectangular area.
From Text
- addArtifactContent(): Add non-semantic content wrapped as Artifact marked-content.
- addPage(): Add a new page (wrapper function for $this->page->add()).
- addTaggedFigureContent(): Add non-text graphical content as a tagged Figure block in PDF/UA mode.
- addTextCell(): Adds a text block inside a rectangular cell using relative coordinates.
- addTextCellXY(): Adds a text block inside a rectangular cell using absolute page coordinates.
- beginArtifact(): Open an Artifact marked-content block for non-semantic page content.
- beginStructElem(): Open a PDF/UA structure element bracket.
- defaultPageContent(): Sets the page common content like Header and Footer.
- enableZeroWidthBreakPoints(): Enable or disable automatic line breaking points after some non-letter character types.
- endArtifact(): Close an Artifact marked-content block opened by beginArtifact().
- endStructElem(): Close the current PDF/UA structure element bracket.
- getLastBBox(): Returns the last text fragment bounding box as {x, y, w, h} (left, top, width, height).
- getLastCellBBox(): Returns the last Cell bounding box as {x, y, w, h} (left, top, width, height).
- getLastTextBBox(): Returns the last Text bounding box as {x, y, w, h} (left, top, width, height).
- getTextCell(): Returns the PDF code to render a text block inside a rectangular cell.
- getTextLine(): Returns the PDF code to render a single line of text.
- loadTexHyphenPatterns(): Returns an array of hyphenation patterns.
- resumePdfUaTagging(): Resume structure tagging, restoring the mode returned by suspendPdfUaTagging().
- setCurrentPage(): Set the current page number (move to the specified page).
- setTexHyphenPatterns(): Sets the hyphen patterns for text.
- suspendPdfUaTagging(): Suspend structure tagging and marked-content recording.