Jump to content
Mindflow

Preserve document units in SVG export

Recommended Posts

When drawing elements to be cut on a laser cutter, setting up a document in mm is very helpful. Unfortunately, the common interchange file format for this kind of device is SVG. While the file format supports measurements in defined units, Designer converts to pixels during the export, which means that after import, the dimensions have to be recalculated.

Therefore, it would be great to have the option to preserve the units from the document during export, such that a 50x150mm rectangle is exported just as such.

 

Share this post


Link to post
Share on other sites

Yes please!

 

I've run into this exact problem. Right now Affinity Designer can export with pixel dimensions (when "set viewBox" is unchecked) or with height="100%" width="100%" (when "set viewBox" is enabled). I'd like to have a third option, to set the height and width using the actual dimensions of the artboard, in either mm or inches. (Ideally one could choose the unit in the SVG export options, but just using the document units would also be acceptable.)

 

Otherwise one has to play the "guess what dpi setting the software on the other end uses" game, which is never fun. (And even worse is when you need to open your SVG in multiple programs, which all assume different default dpi settings.)

Share this post


Link to post
Share on other sites

Same here. Please give us the possiblity to export in physical sizes with changeable DPI settings in the export panel too. Or at least convert the values that we put in mm to px. Now if we introduce a value that's not px, ignores it completely. Thanks!


Branding, Identity Design, UI/UX Design.    |    https://whitex.design

Share this post


Link to post
Share on other sites

Can we please get this in 1.7? When using AD to generate designs for a laser cutter (or any other CNC machine) it saves a ton of time and frustration if the SVG has real units. There's nothing worse than wasting a $20 piece of wood (and who knows how much time) because I didn't notice that the SVG was scaled wrong.

Share this post


Link to post
Share on other sites

I have found a workaround, of sorts: 

1. Set up the document units to pixels, and use pixel measurements in place of millimetres, e.g. if desired size is 100mm, make object 100px. 

2. Export the document using the export option in the file menu, select 'SVG (for web)'. Click 'More' for extra options. 

3.  Deselect 'Set viewBox'  and select 'Add line breaks'.  Export the file. 

4. Open the SVG file in a text/code editor and locate this line: 

<svg width="100px" height="100px" version="1.1"

5. Change the 'px' units to 'mm'. Save the document. 

6. Open the modified document in your desired software. 

This works with the software I have tested it with. 

Share this post


Link to post
Share on other sites

It seems that you can copy and paste SVG without loosing dimensional accuracy so you can copy your design and paste into Illustrator etc. But dimensional accuracy upon export would be best.

Share this post


Link to post
Share on other sites

I'm in the same boat, and have been experimenting. What I've found is that if you set the resolution to 96 dpi and turn all additional options to OFF (deselected), the SVG will output at 100% size. I haven't tested that thoroughly, but I managed to get it to work on one of my projects. Please let me know if that works for you too.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

Please note the Annual Company Closure section in the Terms of Use. These are the Terms of Use you will be asked to agree to if you join the forum. | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.