Documentation

Svg
in package

SVG class modified for mPDF version >= 6.0

Works in pixels as main units - converting to PDF units when outputing to PDF string and on returning size

Tags
author

Ian Back

author

sylvain briand (syb@godisaduck.com), modified by rick trevino (rtrevino1@yahoo.com)

link
http://www.godisaduck.com/svg2pdf_with_fpdf
link
http://rhodopsin.blogspot.com

Table of Contents

Properties

$colorConverter  : ColorConverter
$cssManager  : CssManager
$intext  : mixed
$kp  : mixed
$languageToFont  : LanguageToFontInterface
$mpdf  : Mpdf
ATM marked as public in spite of xml handling callbacks
$otl  : Otl
$pathBBox  : mixed
$scriptToLanguage  : ScriptToLanguageInterface
$sizeConverter  : SizeConverter
$spxstart  : mixed
$spystart  : mixed
$subPathInit  : mixed
$svg_attribs  : array<string|int, mixed>
holds all attributes of root <svg> tag
$svg_error  : mixed
$svg_font  : array<string|int, mixed>
Holds content of SVG fonts defined in image
$svg_gradient  : array<string|int, mixed>
contient les infos sur les gradient fill du svg classé par id du svg
$svg_info  : array<string|int, mixed>
contenant les infos du svg voulue par l'utilisateur
$svg_shadinglist  : array<string|int, mixed>
contient les ids des objet shading
$svg_string  : string
contenant le tracage du svg en lui même.
$svg_style  : array<string|int, mixed>
contenant les style de groupes du svg
$textanchor  : mixed
$textjuststarted  : mixed
$textlength  : mixed
$textoutput  : mixed
$texttotallength  : mixed
$textXorigin  : mixed
$textYorigin  : mixed
$txt_data  : string
holds string info to write txt to image
$txt_style  : array<string|int, mixed>
$xbase  : mixed
$ybase  : mixed
$dashesUsed  : mixed
$imageProcessor  : ImageProcessor
$inDefs  : mixed
$kf  : mixed
$lastcommand  : mixed
$lastcontrolpoints  : mixed

Methods

__construct()  : mixed
Arcto()  : mixed
CalcVectorAngle()  : mixed
characterData()  : mixed
ConvertSVGSizePixels()  : mixed
ConvertSVGSizePts()  : mixed
ImageSVG()  : mixed
analise le svg et renvoie aux fonctions precedente our le traitement
markScriptToLang()  : mixed
mergeStyles()  : string
SVGs made with Adobe Illustrator use a style tag and classes instead of inline styles See: https://github.com/mpdf/mpdf/issues/450
svg_overflow()  : mixed
svgAddGradient()  : mixed
svgDefineStyle()  : mixed
svgDefineTxtStyle()  : mixed
svgEllipse()  : mixed
fonction retracant les <ellipse /> et <circle /> le cercle est tracé grave a 4 bezier cubic, les poitn de controles sont deduis grace a la constante kappa * rayon
svgGradient()  : mixed
svgImage()  : mixed
svgOffset()  : mixed
svgPath()  : mixed
svgPolygon()  : mixed
svgPolyline()  : mixed
svgRect()  : mixed
svgStyle()  : mixed
svgText()  : mixed
svgWriteString()  : mixed
xml_svg2pdf_end()  : mixed
xml_svg2pdf_start()  : mixed
computeBezierBoundingBox()  : mixed
testIntersect()  : mixed
testIntersectCircle()  : mixed

Properties

$intext

public mixed $intext

$kp

public mixed $kp

$mpdf

ATM marked as public in spite of xml handling callbacks

public Mpdf $mpdf

$pathBBox

public mixed $pathBBox

$spxstart

public mixed $spxstart

$spystart

public mixed $spystart

$subPathInit

public mixed $subPathInit

$svg_attribs

holds all attributes of root <svg> tag

public array<string|int, mixed> $svg_attribs

$svg_error

public mixed $svg_error

$svg_font

Holds content of SVG fonts defined in image

public array<string|int, mixed> $svg_font

$svg_gradient

contient les infos sur les gradient fill du svg classé par id du svg

public array<string|int, mixed> $svg_gradient

$svg_info

contenant les infos du svg voulue par l'utilisateur

public array<string|int, mixed> $svg_info

$svg_shadinglist

contient les ids des objet shading

public array<string|int, mixed> $svg_shadinglist

$svg_string

contenant le tracage du svg en lui même.

public string $svg_string

$svg_style

contenant les style de groupes du svg

public array<string|int, mixed> $svg_style

$textanchor

public mixed $textanchor

$textjuststarted

public mixed $textjuststarted

$textlength

public mixed $textlength

$textoutput

public mixed $textoutput

$texttotallength

public mixed $texttotallength

$textXorigin

public mixed $textXorigin

$textYorigin

public mixed $textYorigin

$txt_data

holds string info to write txt to image

public string $txt_data

$txt_style

public array<string|int, mixed> $txt_style

$xbase

public mixed $xbase

$ybase

public mixed $ybase

$dashesUsed

private mixed $dashesUsed

$inDefs

private mixed $inDefs

$kf

private mixed $kf

$lastcommand

private mixed $lastcommand

$lastcontrolpoints

private mixed $lastcontrolpoints

Methods

__construct()

public __construct(Mpdf $mpdf, Otl $otl, CssManager $cssManager, ImageProcessor $imageProcessor, SizeConverter $sizeConverter, ColorConverter $colorConverter, LanguageToFontInterface $languageToFont, ScriptToLanguageInterface $scriptToLanguage) : mixed
Parameters
$mpdf : Mpdf
$otl : Otl
$cssManager : CssManager
$imageProcessor : ImageProcessor
$sizeConverter : SizeConverter
$colorConverter : ColorConverter
$languageToFont : LanguageToFontInterface
$scriptToLanguage : ScriptToLanguageInterface

Arcto()

public Arcto(mixed $x1, mixed $y1, mixed $x2, mixed $y2, mixed $rx, mixed $ry, mixed $angle, mixed $largeArcFlag, mixed $sweepFlag) : mixed
Parameters
$x1 : mixed
$y1 : mixed
$x2 : mixed
$y2 : mixed
$rx : mixed
$ry : mixed
$angle : mixed
$largeArcFlag : mixed
$sweepFlag : mixed

CalcVectorAngle()

public CalcVectorAngle(mixed $ux, mixed $uy, mixed $vx, mixed $vy) : mixed
Parameters
$ux : mixed
$uy : mixed
$vx : mixed
$vy : mixed

characterData()

public characterData(mixed $parser, mixed $data) : mixed
Parameters
$parser : mixed
$data : mixed

ConvertSVGSizePixels()

public ConvertSVGSizePixels([mixed $size = 5 ][, mixed $maxsize = 'x' ]) : mixed
Parameters
$size : mixed = 5
$maxsize : mixed = 'x'

ConvertSVGSizePts()

public ConvertSVGSizePts([mixed $size = 5 ]) : mixed
Parameters
$size : mixed = 5

ImageSVG()

analise le svg et renvoie aux fonctions precedente our le traitement

public ImageSVG(mixed $data) : mixed
Parameters
$data : mixed

markScriptToLang()

public markScriptToLang(mixed $html) : mixed
Parameters
$html : mixed
Tags
todo

reuse as much code from Mpdf::markScriptToLang as possible

mergeStyles()

SVGs made with Adobe Illustrator use a style tag and classes instead of inline styles See: https://github.com/mpdf/mpdf/issues/450

public mergeStyles(string $data) : string

This function brutally copies the styles inline ( Currently only looks for classes as a selector )

Parameters
$data : string

svg contents

Tags
author

Antonio Norman - softcodex.ch

Return values
string

svg contents

svg_overflow()

public svg_overflow(mixed $x, mixed $y) : mixed
Parameters
$x : mixed
$y : mixed

svgAddGradient()

public svgAddGradient(mixed $id, mixed $array_gradient) : mixed
Parameters
$id : mixed
$array_gradient : mixed

svgDefineStyle()

public svgDefineStyle(mixed $critere_style) : mixed
Parameters
$critere_style : mixed

svgDefineTxtStyle()

public svgDefineTxtStyle(mixed $critere_style) : mixed
Parameters
$critere_style : mixed

svgEllipse()

fonction retracant les <ellipse /> et <circle /> le cercle est tracé grave a 4 bezier cubic, les poitn de controles sont deduis grace a la constante kappa * rayon

public svgEllipse(mixed $arguments) : mixed
Parameters
$arguments : mixed

svgGradient()

public svgGradient(mixed $gradient_info, mixed $attribs, mixed $element) : mixed
Parameters
$gradient_info : mixed
$attribs : mixed
$element : mixed

svgImage()

public svgImage(mixed $attribs) : mixed
Parameters
$attribs : mixed

svgOffset()

public svgOffset(mixed $attribs) : mixed
Parameters
$attribs : mixed

svgPath()

public svgPath(mixed $command, mixed $arguments) : mixed
Parameters
$command : mixed
$arguments : mixed

svgPolygon()

public svgPolygon(mixed $arguments) : mixed
Parameters
$arguments : mixed

svgPolyline()

public svgPolyline(mixed $arguments[, mixed $ispolyline = true ]) : mixed
Parameters
$arguments : mixed
$ispolyline : mixed = true

svgRect()

public svgRect(mixed $arguments) : mixed
Parameters
$arguments : mixed

svgStyle()

public svgStyle(mixed $critere_style, mixed $attribs, mixed $element) : mixed
Parameters
$critere_style : mixed
$attribs : mixed
$element : mixed

svgText()

public svgText() : mixed

svgWriteString()

public svgWriteString(mixed $content) : mixed
Parameters
$content : mixed

xml_svg2pdf_end()

public xml_svg2pdf_end(mixed $parser, mixed $name) : mixed
Parameters
$parser : mixed
$name : mixed

xml_svg2pdf_start()

public xml_svg2pdf_start(mixed $parser, mixed $name, mixed $attribs) : mixed
Parameters
$parser : mixed
$name : mixed
$attribs : mixed

computeBezierBoundingBox()

private computeBezierBoundingBox(mixed $start, mixed $c) : mixed
Parameters
$start : mixed
$c : mixed

testIntersect()

private testIntersect(mixed $x1, mixed $y1, mixed $x2, mixed $y2, mixed $x3, mixed $y3, mixed $x4, mixed $y4) : mixed
Parameters
$x1 : mixed
$y1 : mixed
$x2 : mixed
$y2 : mixed
$x3 : mixed
$y3 : mixed
$x4 : mixed
$y4 : mixed

testIntersectCircle()

private testIntersectCircle(mixed $cx, mixed $cy, mixed $cr) : mixed
Parameters
$cx : mixed
$cy : mixed
$cr : mixed

        
On this page

Search results