Skip to content

SVG: read the x and y of a <use> as lengths - #2176

Merged
andersonhc merged 3 commits into
py-pdf:masterfrom
RavSinghChandan:svg-use-length-units
Nov 13, 2026
Merged

andersonhc merged 3 commits into
py-pdf:masterfrom
RavSinghChandan:svg-use-length-units

Conversation

@RavSinghChandan

Copy link
Copy Markdown

<use href="#square" x="20px" y="1in"/> fails with ValueError: could not convert string to float: '20px', in a group as in a <clipPath>: both read x and y with float(). They are lengths, and <svg>, <text> and <image> already read theirs with resolve_length(), as <use> now does.

test_svg_use_position_with_units and a new case in test_svg_clip_path_with_use_placement cover it; both fail without the change.

<use x="10px"> failed with ValueError: could not convert string to
float, in a group as in a <clipPath>, while <svg>, <text> and <image>
already read x and y with resolve_length().
@andersonhc
andersonhc merged commit 5738067 into py-pdf:master Nov 13, 2026
23 checks passed
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

Successfully merging this pull request may close these issues.

2 participants