PdfColorWriterInterface

Writes the PDF and Acrobat JavaScript color forms.

Namespace: Com\Tecnick\Color

interface PdfColorWriterInterface

Source: src/PdfColorWriterInterface.php:36

Writes the PDF and Acrobat JavaScript color forms.

Implemented by Pdf.

Methods

getColorObject()

Returns a color object from an HTML, CSS or Spot color representation.

public getColorObject(string $color, bool $allowSpot = true): ?Model

Parameters:

  • $color (string): HTML, CSS or Spot color to parse
  • $allowSpot (bool): True to resolve spot colors, false to force a device color.

Returns: ?Model

Source: src/PdfColorWriterInterface.php:95

getJsColorString()

Convert a color to an Acrobat JavaScript color string.

public getJsColorString(string $color): string

Parameters:

  • $color (string): color name or color object

Returns: string

Source: src/PdfColorWriterInterface.php:87

getPdfCmykComponents()

Get the CMYK color components format used in PDF documents.

public getPdfCmykComponents(string $color, bool $allowSpot = true): string

Parameters:

  • $color (string): HTML, CSS or Spot color to parse
  • $allowSpot (bool): True to resolve spot colors, false to force a device color.

Returns: string

Source: src/PdfColorWriterInterface.php:80

getPdfColor()

Get the color components format used in PDF documents.

public getPdfColor(
    string $color,
    bool $stroke = false,
    float $tint = 1,
    bool $allowSpot = true
): string

Parameters:

  • $color (string): HTML, CSS or Spot color to parse
  • $stroke (bool): True for stroking, false for non-stroking.
  • $tint (float): Intensity of the color (from 0 to 1). Spot colors only.
  • $allowSpot (bool): True to resolve (and register) spot colors, false to force a device color.

Returns: string

Source: src/PdfColorWriterInterface.php:46

getPdfFillColor()

Get the fill color components format used in PDF documents.

public getPdfFillColor(string $color, float $tint = 1, bool $allowSpot = true): string

Parameters:

  • $color (string): HTML, CSS or Spot color to parse
  • $tint (float): Intensity of the color (from 0 to 1). Spot colors only.
  • $allowSpot (bool): True to resolve (and register) spot colors, false to force a device color.

Returns: string

Source: src/PdfColorWriterInterface.php:64

getPdfRgbComponents()

Get the RGB color components format used in PDF documents.

public getPdfRgbComponents(string $color, bool $allowSpot = true): string

Parameters:

  • $color (string): HTML, CSS or Spot color to parse
  • $allowSpot (bool): True to resolve spot colors, false to force a device color.

Returns: string

Source: src/PdfColorWriterInterface.php:72

getPdfStrokeColor()

Get the stroked color components format used in PDF documents.

public getPdfStrokeColor(string $color, float $tint = 1, bool $allowSpot = true): string

Parameters:

  • $color (string): HTML, CSS or Spot color to parse
  • $tint (float): Intensity of the color (from 0 to 1). Spot colors only.
  • $allowSpot (bool): True to resolve (and register) spot colors, false to force a device color.

Returns: string

Source: src/PdfColorWriterInterface.php:55