Skip to content

svgViewBoxSize missing in v5.0 #230

Answered by codemasher
manuelKruesi asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, the viewboxSize has been removed because of the common misconception that it would change the size of the QR Image - the viewbox size changes only the canvas size of the SVG, not the size of the contents, see #222.
If you want to change the output size of the SVG (i.e. when CSS is not available), you need to set the width and height attributes on the <svg> element:

// we need to specify the "width" and "height" attributes so that Imagick knows the output size
$header = sprintf(
'<svg xmlns="http://www.w3.org/2000/svg" class="qr-svg %1$s" viewBox="%2$s" preserveAspectRatio="%3$s" width="%5$s"…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@codemasher
Comment options

@manuelKruesi
Comment options

@codemasher
Comment options

@manuelKruesi
Comment options

@codemasher
Comment options

Answer selected by codemasher
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