Jump to content
angusware

Affinity Designer SVG export with reliable scale

Recommended Posts

I am trying to export SVG files from Affinity Designer and bring them into a range of programs for generating tabs / notches and then outputting for laser cutting. 

 

In Adobe Illustrator it is very simple - you set the document units to mm, design something with specific dimensions, and export your SVG. What comes out will be interpreted by other software, and by the laser cutter at the exact dimensions. 

 

With Affinity Designer, I've spent hours troubleshooting and digging through the forums and no matter what I do dimensions seem to vary depending on the DPI and all sorts of other options, and even slices of objects with the same height will export at different dimensions. It makes it practically impossible to predict what size your object will be. (as an aside, I thought DPI was completely irrelevant to vector - why is it even an option in a vector format?!)

 

So is reliable scale something Affinity Designer just can't do? How are people delivering documents for print if they don't know how the printer will interpret the dimensions of their final files? 

 

I dumped Creative Cloud, bought the Affinity hoping to replace AI and now am faced with going back to Creative Cloud and getting stung with higher fees as a result of leaving. For my line of work this seems like really simple stuff... 

 

 

Share this post


Link to post
Share on other sites

Hi @angusware I once had the same size problems but it was with PNG files, so what I did was simple, I used the export option in the file menu not the export persons. 

The export option seems to preserve the correct size. 

Even though now I have no problem with my export persona, I prefer to deliver using the export option for output like PDF, PNG and some specific jpeg. 

Try and see if it helps 


Never be the Same Again !
---
Dell Precision T3500 
Intel Xeon W3530 @ 2.80GHz + 12GiB 1333 MHz DDR3
AMD Radeon HD 5450 with 1GiB RAM
Windows 10 Pro x64 20H2 + LibreOffice 7

My well suited Set of Apps [Production only]
* Affinity Suite [Designer + Photo + Publisher]
* Camtasia 2020 + Inkscape 1.0.2 beta + Blender 2.92 Beta

Share this post


Link to post
Share on other sites

I don't know the answer to why they ask for the dpi when exporting a svg, but when choosing eps or pdf it tells me in breaks "Nothing will be rasterised" right next to the dpi-input-field. Would any other format also work for you? Good luck, really hope you can stay out away from the dark Cloud.

Share this post


Link to post
Share on other sites

Some relevant links and information that may help others understand and troubleshoot.

https://www.w3.org/TR/SVG/coords.html

https://www.w3.org/TR/SVG2/coords.html

SVG settings on File > Export...

For PDF, SVG and EPS file formats:

  • Rasterize—select an option for rasterizing design elements which are unsupported by the file format. Select from the pop-up menu:
    • Nothing—no elements within the design are rasterized on export, therefore unsupported elements are not included in the exported file.
    • Everything—all elements within the design are rasterized for a resulting exported file which perfectly matches your original design.
    • Unsupported properties—only unsupported elements are rasterized in the exported file.
  • Downsample images—select whether to downsample raster images within the design.
  • Above—if this set DPI is exceeded by raster design elements, those elements will be rasterized down to this set DPI. This option is dependent on the Downsample images option being active.
  • Use document resolution—ensures the export is the same DPI as the current project's setting.
  • Use DPI—overrides the current project's resolution setting for the export. The exported image's DPI is set using the adjacent input box
  • Allow JPEG compression—when selected, rasterized design elements will be compressed to decrease exported file size. If this option is off, rasterized design elements will be exported as uncompressed.

For SVG file format:

  • Export text as curves—when selected, the text in the resulting file will be drawn as curves (therefore displaying precisely as intended, even if viewed on a device without the used fonts installed). However, this option will increase file size, and text won't be editable as text or available to "text to speech" in other apps. If this option is off, text will be exported as text and the viewing device will need the used fonts installed for it to be viewed correctly.
  • Longer text spans—when selected, text is placed relative to previous lines of text (therefore producing smaller file sizes and simpler file structures). If this option is off, text is placed with absolute coordinates.
  • Use hex colours—when selected, colours in the exported file are expressed as RGB Hex values (therefore reducing file size but less human-readable). If this option is off, colours are exported as standard RGB values.
  • Flatten transforms—when selected, transformed objects are 'fixed' in the exported file. This allows for the file to be viewed more accurately across applications. If this option is off, objects remain dynamically transformed to allow for more flexible editing.
  • Use tile patterns—when selected, rasterized areas may be converted to a vector shape with a filled bitmap to give smoother, sharper edges. However, this might not be supported by some apps. If this option is off, objects will exist as singular elements within the exported file.
  • Set viewBox—when selected, the exported file includes coordinates and dimensions which define the view box of the image. If this option is off, no view box data is included in the exported file. The export area is used to define the view box.
  • Add line breaks—when selected, the code in the exported file will be optimized for human viewing and reading. If this option is off, the image will be exported with code on a single line which will make the file size significantly smaller.

For SVG and EPS file formats:

  • (Use) Relative coordinates—when selected, objects in the exported file have relative positions for maximum editability. If this option is off, object positions are fixed to create a file which is optimized for viewing.

 


iMac 27" Late 2015 Fully Loaded, iMac 27" Mid 2011 both running High Sierra 10.13.6 - Affinity Designer/Photo & Publisher - Illustrator CC, Inkscape, Blender, Sketchup, Pepakura Designer, MTC, Pixelmator & Pixelmator Pro + more... XP-Pen Artist-22E, - iPad Pro 12.9 B|  

Affinity Help - Affinity Desktop Tutorials - Feedback - FAQ - most asked questions

Share this post


Link to post
Share on other sites
19 hours ago, hannah said:

I don't know the answer to why they ask for the dpi when exporting a svg ...

Probably because svg supports embedded bitmap elements as well as vectors, shapes, etc.


Affinity Photo 1.9.0, Affinity Designer 1.9.0, Affinity Publisher 1.9.0;  2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.8.4.186 & Affinity Designer 1.8.4.4 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 14.0.1

Share this post


Link to post
Share on other sites

Thanks for all the suggestions. I am still investigating this. 

Unfortunately going through the export menu rather than persona doesn't change things. For example, I am unable to get anything to work with this web app, which I use all the time with Illustrator and Inkscape files:  

https://clementzheng.github.io/joinery/

The app imports the file with pixels, rather than mm as the units. I think the problem is that, regardless of the document units, Affinity Designer exports SVG with pixels as the units. 

On 5/23/2018 at 9:48 AM, R C-R said:

Probably because svg supports embedded bitmap elements as well as vectors, shapes, etc.

Regarding DPI - the DPI used when exporting changes the scale this web app interprets the SVG at, meaning that the DPI is affecting non-raster objects within an SVG. 

The same issues apply with every piece of vector-based laser cutting software I have thrown Affinity designer-exported files at. Again, AI, Inkscape etc. files handle this just fine. 

Is this a bug? A missing feature? I have never encountered these issues with other vector illustration software before, and it seems other users have had trouble too:

https://forum.affinity.serif.com/index.php?/topic/46934-preserve-document-units-in-svg-export/

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

the workaround works, but why do we need so many workarounds in AD?

DXF, Warp, SVGs that import... all of these work great and have for years in inkscape. The more I use AD the more I want to use something else. This is not what we were sold. BTW warp and DXF were on the "roadmap" for over four years - that's ridiculous.

Share this post


Link to post
Share on other sites
On ‎5‎/‎22‎/‎2018 at 4:10 AM, Uncle Mez said:

Hi @angusware I once had the same size problems but it was with PNG files, so what I did was simple, I used the export option in the file menu not the export persons. 

The export option seems to preserve the correct size. 

Even though now I have no problem with my export persona, I prefer to deliver using the export option for output like PDF, PNG and some specific jpeg. 

Try and see if it helps 

As well as you guys have problems with PNG and SVG formats I have the same issue with PDF (probably with the exporting as a whole) and even not using Export persona doesn!t help at all unfortunately.

 

Now I'm putting my hand up that I am another one with the same problem and would like to ask AFFINITY GUYS  to help us. I don't want any workarounds.

I just don't understand why is this happening, doesn't make sense to me. I want to understand it, if it can't be simply solved

Thank you! =]

Share this post


Link to post
Share on other sites

I'm new to Affinity Designer. Like many I'm sure, we are looking to escape the Adobe tyranny. However, our work flow is important and the more seamless a transition the better. However, like all of you here, exporting to SVG file format to import into a 3rd party CNC program (or other) is wrought with difficulties. Vector designs went seamlessly using Illustrator but not with AD - anything I did via AD ended up importing really, really small. I did not want to have to rescale in my CNC software as I took painstaking efforts to make sure I did that in AD (or AI). Alas, a big thank you to @angusware for his solution. Albeit I found a few minor mods that seemed to work just fine too. So below are my slightly amended instructions in hopes it saves someone else max. time trying different permutations to try and figure this out. Btw - it is July 17, 2019 and I'm brand new to the Affinity ecosystem, so this problem clearly continues to this day as I see many on this thread were posting over the last year or two. Hopefully the folks at Serif will rectify this in coming releases.

1. Select “New Document” from the pull down menu.

2. Set up the document units to pixels to use pixel measurements in place of millimetres,

3. When creating your vector object, and by way of example, if desired size is 100mm square, make the object 100 pixels square (ie. 1:1 ratio).

4. Save the document in AD’s native file format for future use or edits.

5. Export the document using the export option in the file menu.

6. Select 'SVG (for web)'. Click 'More' for extra options. 

7.  Deselect 'Set viewBox'  and select 'Add line breaks' (I also tried unselecting 'Add line breaks' and it also worked, in other words, didn't seem to impact either way).

8. Export the file.

9. Import into your 3rd party CNC/laser cutting program

NOTE: I excluded the code/text editing instructions angusware referenced in his workaround, this apparently was not required at my end. And I'm thankful for this. Maybe the absence of having to do this was suited to the 3rd party CNC software I'm running? Who knows, however, if you get away with having to do it, great . . . . it's one less step!

Cheers!

Share this post


Link to post
Share on other sites

Well let's give as a hint that SVG is an editable textual format and thus can be altered, modified and changed with plain text editors. So you can always inspect the generated SVG code and if needed apply some size/scaling changes. In order to get some insights about SVG and it's scaling handling the following is a good read ...


☛ Affinity Designer 1.9.1 ◆ Affinity Photo 1.9.1 ◆ OSX El Capitan

Share this post


Link to post
Share on other sites

Figured I'd chime in here and on some other threads I've been to recently, hopefully if anyone is searching for what I was, they will end up here.  I was having issues taking my vector designs from Affinity Designer in SVG into a program called Sheetcam for operating my cnc plasma.  I could not get the scale to remain where I wanted it.  As much as Inkscape got me started in vector design, I didn't want to have to run my designs through just to make a DXF (which still didn't import perfectly anyway) so I tried using pixels, mm, changing the DPI, but it wasn't working.  In the end, I just did some math to see what the factor was that Sheetcam was changing my designs by.  Obviously I had to make sure the units were the same in each program on export and import as well. My 10 inch square imported at roughly 10.6667.  So I just divided what it should be, by what it was. and came up with .9375.  Sheet cam gives you an option at every import to select the scale to import in.  So Instead of picking 1:1 I make it 1:.9375 and it's perfect.  

I'd like to understand why this works the way it does, whether DPI affects this or not, but I'm content to be able to use my drawings in inches and with the scaling trick.

 

 

Share this post


Link to post
Share on other sites

I cannot believe this is still an issue... after so many years. Gosh. I just went back to Adobe as Affinity is the most frustrating experience ever. So many workarounds, so many bugs. Even in the 90`s Adobe had already more intuitive and better functioning software than Affinity has today 🤦🏻‍♂️ 

Share this post


Link to post
Share on other sites
18 hours ago, MortalWombat said:

I cannot believe this is still an issue... after so many years. Gosh. I just went back to Adobe as Affinity is the most frustrating experience ever. So many workarounds, so many bugs. Even in the 90`s Adobe had already more intuitive and better functioning software than Affinity has today 🤦🏻‍♂️ 

I found a method, I think maybe earlier in this thread, that has settings for exporting the SVG in a way the machines will like. But yeah, Affinity is a disappointment in this regard. Not unlike MS Excel and it's insistence that it knows my data better than I do and changes my values into dates and whatever else it feels. People have been screaming about this for decades now and MS just refuses to do something as simple as add a checkbox that says "Leave my damn data alone"!

Screen Shot 2021-02-10 at 8.38.11 AM.png

Share this post


Link to post
Share on other sites
On 2/11/2021 at 12:47 AM, dgd said:

I found a method, I think maybe earlier in this thread, that has settings for exporting the SVG in a way the machines will like. But yeah, Affinity is a disappointment in this regard. Not unlike MS Excel and it's insistence that it knows my data better than I do and changes my values into dates and whatever else it feels. People have been screaming about this for decades now and MS just refuses to do something as simple as add a checkbox that says "Leave my damn data alone"!

Thanks for posting this, it worked for me.

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.