I have an app which creates a basic svg tile which is about 300 x 150px. I need to duplicate this tile, such that I can create a nice printout on two A4 pages, or a single A3 page. So, basically, I'm just doing page layout 101, in svg rather than Photoshop/whatever.
Can anyone give me any pointers on how to start this? At the moment, I'm doing it very naively:
This is more-or-less passable, but doesn't look good. Would it help to set up a canvas with a physical size of an A4 page? If I do this, I then have the problem that the tile is a complex graphic which I have currently created using pixel units. Even if I do this, the browser will presumably ignore the canvas size anyway. Or should I convert to pdf first? If I do this, I still need to work out how to set up an svg 'page' that will convert well to pdf. And do any tools actually support the svg 1.2 page stuff?
Note that I can't use Inkscape, since my svg code is entirely JavaScript.
To print a 1:1 scale copy of your room, you would need to scale (multiply) your SVG by 1 / worldToPrinterScaleFactor . To print a half-scale copy of your room, you would need to scale (multiply) your SVG by 0.5 / worldToPrinterScaleFactor .
You can use SVG files for some print work, particularly printing for clothing and crafting —but they're not compatible with enough devices to rely on them for day-to-day tasks.
❓ How can I resize a SVG image? First, you need to add a SVG image file: drag & drop your SVG image file or click inside the white area to choose a file. Then adjust resize settings, and click the "Resize" button. After the process completes, you can download your result file.
Don't use canvas for this!
The point of SVG is scalable graphics. You can just scale the SVG yourself in the browser and then print from there.
If you want to scale SVG then all you have to do is either apply a CSS scale:
http://jsfiddle.net/simonsarris/xYZyf/
Or an SVG scale:
http://jsfiddle.net/simonsarris/xYZyf/1/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With