CSS

CSS PDF class

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

From Cell

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