QuestPDF icon indicating copy to clipboard operation
QuestPDF copied to clipboard

Plotly.Net generated SVGs misinterpreted

Open jaguarxii opened this issue 1 month ago • 3 comments

Describe the bug Some SVGs generated from Plotly.Net that contain "newline" in text are misinterpreted.

To Reproduce Using the following samples simple_pie_20240530_1149

simple_bar_20240530_1149

after embeding to a document:

    column.Item().Border(2, Unit.Mil).Padding(2, Unit.Millimetre)
        .AlignCenter()
        .Width(150, Unit.Millimetre)
        .Svg(svgBarChart)
        ;

    column.Item().Border(2, Unit.Mil).Padding(2, Unit.Millimetre)
        .AlignCenter()
        .Width(100, Unit.Millimetre)
        .Svg(svgPieChart)
        ;

the images should mantain its structure, but the labels are not quite right

image

Expected behavior image

I have found that the tags that include "em" untis, are misinterpreted

<tspan class="line" dy="0em" x="250" y="250">Simple</tspan>
<tspan class="line" dy="1.3em" x="250" y="250">pie chart</tspan>

image

If I change them by removing its units I get the right result:

<tspan class="line" dy="0em" x="250" y="250">Simple</tspan>
<tspan class="line" dy="50" x="250" y="250">pie chart</tspan>

image

Environment QuestPDF 2024.3.10 Window 11 / Debian 12 dotnet 8

Aditional Also, the font described in the chart "Nunnito" is not embeded in the file, as it was described in the issue #777

jaguarxii avatar May 30 '24 17:05 jaguarxii