File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -30,15 +30,16 @@ function Convert-SvgToMxLibrary {
3030 Get-ChildItem - Path $InputFolder - Filter * .svg | ForEach-Object {
3131 $file = $_
3232 $svgContent = Get-Content - Path $file.FullName - Raw
33- $encodedSvg = [System.Uri ]::EscapeDataString($svgContent )
34- $imageUri = " data:image/svg+xml,$encodedSvg "
33+ $bytes = [System.Text.Encoding ]::UTF8.GetBytes($svgContent )
34+ $base64 = [Convert ]::ToBase64String($bytes )
35+ $image = " data:image/svg+xml,$base64 "
3536
3637 $xml = @"
3738<mxGraphModel>
3839 <root>
3940 <mxCell id="0"/>
4041 <mxCell id="1" parent="0"/>
41- <mxCell id="2" value="" style="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image=$imageUri " vertex="1" parent="1">
42+ <mxCell id="2" value="" style="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image=$image " vertex="1" parent="1">
4243 <mxGeometry width="$GeometryWidth " height="$GeometryHeight " as="geometry"/>
4344 </mxCell>
4445 </root>
You can’t perform that action at this time.
0 commit comments