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 !
MacBook Pro (13-inch, Mid 2010) - 2.4 GHz Intel Core 2 Duo - 8 GB 1067 MHz DDR3 - VIDIA GeForce 320M 256 MB

MacOS High Sierra 10.13.6  - Affinity Designer + Affinity Photo + Affinity Publisher + Snagit 2019 + Camtasia 2018 + Movavi Video Editor Business 15

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 - FeedbackInstagram & Flickr

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.7.3, Affinity Designer 1.7.3, Affinity Publisher 1.7.3; macOS High Sierra 10.13.6 iMac (27-inch, Late 2012); 2.9GHz i5 CPU; NVIDIA GeForce GTX 660M; 8GB RAM
Affinity Photo 1.7.3.155 & Affinity Designer 1.7.3.1 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 13.1.2

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.7.1 ◆ Affinity Photo 1.7.1 ◆ OSX El Capitan

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

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.