Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG images cannot use text inside #184

Open
qarmin opened this issue Aug 26, 2024 · 1 comment
Open

SVG images cannot use text inside #184

qarmin opened this issue Aug 26, 2024 · 1 comment

Comments

@qarmin
Copy link

qarmin commented Aug 26, 2024

Usvg dependency supports embedding text inside svg, but printpdf not

Svg used to test behavior

<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg">
  <circle cx="50" cy="50" r="40" stroke="black" stroke-width="3" fill="red" />
  <text x="50" y="55" font-size="20" text-anchor="middle" fill="white">A</text>
</svg>

image

image

@fschutt
Copy link
Owner

fschutt commented Nov 2, 2024

Yeah, this is a pretty normal problem since PDF handles fonts / text specially. You'd have to first use a SVG library to convert the text to paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants