Display an SVG Image

Below is a code example downloading the svg from icomoon, pasting in the svg in text format with the only change sizing down the width and height:

<?php $svgIcon='<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 512 512">
<g id="icomoon-ignore">
</g>
<path d="M256 512c-141.2 0-256-114.8-256-256s114.8-256 256-256c141.2 0 256 114.8 256 256s-114.8 256-256 256v0zM471.9 291c-7.5-2.4-67.7-20.3-136.2-9.3 28.6 78.6 40.2 142.6 42.5 155.9 49-33.2 84-85.7 93.7-146.6v0zM341.4 457.6c-3.3-19.2-15.9-86-46.6-165.8-0.5 0.2-1 0.3-1.4 0.5-123.4 43-167.7 128.5-171.6 136.5 37.1 28.9 83.7 46.2 134.2 46.2 30.3 0 59.2-6.2 85.4-17.4v0zM93.5 402.5c5-8.5 65-107.8 177.7-144.3 2.8-0.9 5.7-1.8 8.6-2.6-5.5-12.4-11.5-24.9-17.7-37.1-109.1 32.7-215.1 31.3-224.7 31.2-0.1 2.2-0.1 4.4-0.1 6.7 0 56.1 21.3 107.4 56.2 146.1v0zM42 211.5c9.8 0.1 99.9 0.5 202.2-26.6-36.2-64.4-75.3-118.6-81.1-126.5-61.2 28.9-107 85.3-121.1 153.1v0zM204.8 43.7c6 8.1 45.8 62.2 81.6 128 77.8-29.1 110.7-73.4 114.6-79-38.6-34.3-89.4-55.1-145-55.1-17.6 0.1-34.8 2.2-51.2 6.1v0zM425.3 118.1c-4.6 6.2-41.3 53.2-122.1 86.2 5.1 10.4 10 21 14.5 31.7 1.6 3.8 3.2 7.5 4.7 11.3 72.8-9.1 145.1 5.5 152.3 7-0.5-51.6-19-99-49.4-136.2v0z"></path>
</svg>';
$svgIcon= '@'.$svgIcon;?>
<tcpdf method="ImageSVG" <?= /* @noEscape */ $block->getEncodedParams([$svgIcon]) ?> />

And you would add this into the template file directly that drive the pdf output. Please see more details on this here

Theme support / Additional layout customisations


Still need help? Contact Us Contact Us