Skip to content

Commit 7ffbaff

Browse files
committed
draft svg getSetSVG
1 parent d4fc3d6 commit 7ffbaff

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

src/SVG.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3825,4 +3825,44 @@ public function addSVG(
38253825

38263826
return $soid;
38273827
}
3828+
3829+
/**
3830+
* Get the PDF output string to print the specified SVG object.
3831+
*
3832+
* @param int $soid SVG Object ID (as returned by addSVG).
3833+
* @param float $xpos Abscissa (X coordinate) of the upper-left Image corner in user units.
3834+
* @param float $ypos Ordinate (Y coordinate) of the upper-left Image corner in user units.
3835+
* @param float $width Image width in user units.
3836+
* @param float $height Image height in user units.
3837+
* @param float $pageheight Page height in user units.
3838+
*
3839+
* @return string Image PDF page content.
3840+
*/
3841+
public function getSetSVG(
3842+
int $soid,
3843+
float $xpos,
3844+
float $ypos,
3845+
float $width,
3846+
float $height,
3847+
float $pageheight,
3848+
): string {
3849+
if (empty($this->svgobjs[$soid])) {
3850+
throw new PdfException('Unknown SVG ID: ' . $soid);
3851+
}
3852+
3853+
$out = $this->svgobjs[$soid]['out'];
3854+
3855+
foreach ($this->svgobjs[$soid]['child'] as $chid) {
3856+
$out .= $this->getSetSVG(
3857+
$chid,
3858+
$xpos,
3859+
$ypos,
3860+
$width,
3861+
$height,
3862+
$pageheight,
3863+
);
3864+
}
3865+
3866+
return $out;
3867+
}
38283868
}

0 commit comments

Comments
 (0)