When exporting an SVG image to PDF, polylines with stroke-dasharray
are rendered incorrectly — the dash pattern is not applied.
Additionally, polylines with a stroke-width
exhibit visual artifacts such as pixelation or inconsistent thickness.
Step by step instructions or code snippets how to reproduce the problem
If there's no black line with no stroke-dasharray - the red line in a bottom looks correct
test_svg_line_stroke.svg
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xml="http://www.w3.org/XML/1998/namespace" width="500" height="400" viewBox="0, 0, 500, 400" preserveAspectRatio="xMinYMin" transform="scale(1)">
<polyline points="100, 100 400, 100" stroke-width="7" stroke-dasharray="40 40" style="fill:none;stroke:#FF0000;" />
<polyline points="100, 200 400, 200" stroke-width="5" style="fill:none;stroke:#000000;" />
<polyline points="100, 300 400, 300" stroke-width="7" stroke-dasharray="40 40" style="fill:none;stroke:#FF0000;" />
</svg>
test_svg_line_stroke.svg - svg source file
test_svg_line_stroke.trdp - report with a picture box with SVG image
test_svg_line_stroke.pdf - generated PDF file