Skip to content

How to resize a image or path object? #136

Answered by spakin
jdschwam asked this question in Q&A
Discussion options

You must be logged in to vote

I see two mistakes in the preceding code. First,

hx_y = 5

should be

hc_y = 5

Second, in

horse_cow_obj.transform ='translate(%s, %s), first= True' % (hc_x, hc_y)

the transform method accepts either an inkex.Transform or a string that can be used to construct an inkex.Transform. Neither of those recognize first=True. You were probably thinking of

horse_cow_obj.translate((hc_x, hc_y), first=True)

If you're targeting 25mm × 25mm objects, see Unit conversions in the Simple Inkscape Scripting documentation and also the documentation for Inkscape's inkex.units module. Those may facilitate targeting an absolute size.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jdschwam
Comment options

Answer selected by jdschwam
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants