Jump to content

Recommended Posts

Posted

I'm struggeling a bit with the export size of SVG files.
When I export slices of the size 100px x 100px (unsing document settings) and re-import the SVG files they come up with a size of 416.7px x 416.7px. Since we are looking at px (device independent units) this should be completely independent from the document res. (dpi).

Anyone got a clue what to do to get a SVG file same as the original size?

Cheers,
Timo

 

And yes, I'm aware that SVG files/vector files are lossless sclable - so you can always argue "Who cares" ... but for certain purposes this is a problem (e.g. CAD systems)

CRM.png.a048d588572393102ac3cc403bfa8af7.png

 i7-12700KF, 3.60 GHz, 32GB RAM, SSD, NVIDIA GeForce RTX 3070, Wacom Intuos 4 Tablet, Windows 11 Pro - AP, AD and APublisher V1 and V2
https://www.timobierbaum.com

  • Staff
Posted

Could you share a sample file that illustrates the problem?

I just created a new document, pixel units, 100x100 pixels in size, added a curve and exported to SVG. I can open that SVG and everything is the correct size, as expected (attached for your reference)

Thanks,
Matt

sample100px.afdesign sample100px.svg

Posted
20 minutes ago, DarkClown said:

When I export slices of the size 100px x 100px (unsing document settings) and re-import the SVG files they come up with a size of 416.7px x 416.7px.

300/72 = 4.167

Alfred spacer.png
Affinity Designer/Photo/Publisher 2 for Windows • Windows 10 Home/Pro
Affinity Designer/Photo/Publisher 2 for iPad • iPadOS 17.5.1 (iPad 7th gen)

  • Staff
Posted
9 minutes ago, Return said:

@MattP drag the exported svg back into the document it will import as 72 dpi.

clipimage.thumb.jpg.0da17c9e395cedef1fa7fe0199e7b185.jpg

 

 

Definitely true - but this is placing a 72dpi SVG into a 300dpi document. I'm happy with this behaviour as it is correct (edit: at least, arguably, lol!) - but if you open the SVG you'll see it create a 72dpi document at the anticipated 100x100 pixel size :)

  • Staff
Posted
24 minutes ago, Alfred said:

300/72 = 4.167

As Alfred points out, this does imply that the original document is at 300dpi. Try working from a 72dpi document - I'm assuming it will then export as intended?

Posted

OK, that solves the problem ... Looks like the dpi information is not exported within the SVG file so AD is not able to determine the proper dimensions and assumes 72dpi.

What brings me to another nasty behaviour: The pure SVG file is nested in a folderstructure that limits visibility of the exported svg to the artboard. Is there a way (setting) to prevent that and just get the desired SVG - unnested in folders and curves?

CRM.png.a048d588572393102ac3cc403bfa8af7.png

 i7-12700KF, 3.60 GHz, 32GB RAM, SSD, NVIDIA GeForce RTX 3070, Wacom Intuos 4 Tablet, Windows 11 Pro - AP, AD and APublisher V1 and V2
https://www.timobierbaum.com

Posted

Draw a square of 100 x 100 mm in an empty AD document, export SVG with default settings (no rasterisation).
Then place the SVG in the same document. it is so huge that it can't even be selected or moved.

The page borders are part of the imported SVG, that should not be either.

I export SVG vector files for CNC software (Carbide Create) and always have to scale down. Not tragic of course. With Illustrator the size is ok.

Black 100x100mm square exported from AD and AI:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 3508 2481" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
    <g transform="matrix(1.51674,0,0,1.58398,-76.6186,-133.819)">
        <rect x="50.515" y="84.483" width="778.711" height="745.653"/>
    </g>
</svg>

The Square turned into a non-square rectangle. The same from AI:

<?xml version="1.0" encoding="UTF-8"?>
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="100mm" height="100mm" viewBox="0 0 283.46 283.46">
  <defs>
    <style>
      .cls-1 {
        fill: #231f20;
        stroke-width: 0px;
      }
    </style>
  </defs>
  <rect class="cls-1" width="283.46" height="283.46"/>
</svg>

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

Terms of Use | 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.