• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Help with placing svg exported from illustrator

Explorer ,
May 26, 2021 May 26, 2021

Copy link to clipboard

Copied

Hi, could somebody please explain why an svg created in illustrator with responsive unticked on export imports into indesign just fine (no margin), but when created with responsive ticked adds a margin around the image. I'm happy to save them with responsive unticked, but thought it might be better to create one responsive svg that I can use in my InDesign documents and online at varying sizes.

 

Thanks

Daniel

TOPICS
Bug , How to , Import and export , Publish online

Views

505

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 26, 2021 May 26, 2021

Copy link to clipboard

Copied

Since you have a workaround already (creating two versions of the SVG, one for InDesign and one for online), it doesn't seem like a serious issue. However, if you want InDesign to change the way it handles SVG, you'll need to submit a Feature Request at the InDesign UserVoice website where it will be seen by product managers and engineers:

 

https://indesign.uservoice.com/forums/601021-adobe-indesign-feature-requests

 

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 03, 2021 Jun 03, 2021

Copy link to clipboard

Copied

Hi Steve, thank you for your suggestion, i will have a look at the link provided.

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 03, 2021 Jun 03, 2021

Copy link to clipboard

Copied

Hi dw62059930,

how large exactly is the margin you see?

And are you sure that you do not see a small amount of margin when you export the SVG from Illustrator the other way?
From my tests InDesign, not Illustrator!, will add a margin of 1 Pt on all sides of a placed SVG from Illustrator.

You cannot change that directly. To make that perfect you will have to edit the SVG code.

 

For any tests: What exact version of Illustrator and InDesign are you using?

 

Regards,
Uwe Laubender

( ACP )

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 04, 2021 Jun 04, 2021

Copy link to clipboard

Copied

Hi, yes it was about 1pt on all sides of a responsive svg. I have since decided to size my svg files to the correct size rather than use responsive.

 

I'm on CC so it's the most recent version of each – illustrator CC 25.2.3 and InDesign CC 16.2.1

 

My next question is that upon exporting to a fixed layout ePub in InDesign, files that are used more than once at the exact same size with no effects applied are duplicated in the image folder with the epub file, is there a way for it to reference the same image rather than create duplicates?

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 04, 2021 Jun 04, 2021

Copy link to clipboard

Copied

Hi Daniel,

could you show screenshots of your save or export options for SVG with Illustrator where you detect no margins at all when placing with InDesign?

 

Checked one of my posts from 2019 where I detected some issues with margins:
https://community.adobe.com/t5/indesign/now-import-svg-in-indesign/m-p/10717683#M159403

 

I said back then:

"Illustrator is using viewBox entries. But InDesign will ignore them.

[InDesign] adds always 0.5 Pt on every edge of the placed contents."

 

I'll have to test in the most recent versions of Illustrator and InDesign if something has changed and the issue is fixed. Or if I simply used the wrong method to export to SVG from Illustrator.

 

Thanks,
Uwe Laubender

( ACP )

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 04, 2021 Jun 04, 2021

Copy link to clipboard

Copied

Hi Daniel,

I now can explain the why behind your question in your inital post. And thank you very much that you noticed the difference with option Responsive enabled or disabled!

 

In short: width and height statements are done before the viewBox entry with option Responsive unchecked.

InDesign cannot read out the viewBox statement. It relies on the width and height statements when placing the SVG.

Assumption: If only a viewBox statement is there InDesign calculates the size by calculating the size of every object in the SVG code and adds a 0.5 Pt margin around ( or resizes the object to the added overall size ). Don't know why. A bug?

 

More details:

Just did an artboard in Illustrator, sized 100 x 100 Pt with a rectangle exactly sized 100 x 100 Pt.

Exported it in two ways to SVG:

 

[1] Option Responsive checked; that was checked by default

The following code was exported:

<svg id="Ebene_1" data-name="Ebene 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><style>.cls-1{fill:#ffed00;}</style></defs><rect class="cls-1" width="100" height="100"/></svg>

 

[2] Option Responsive unchecked. The code is different:

<svg id="Ebene_1" data-name="Ebene 1" xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><defs><style>.cls-1{fill:#ffed00;}</style></defs><rect class="cls-1" width="100" height="100"/></svg>

 

width and height statements are done before the viewBox entry.

 

That's exact the same thing I did by editing the code in 2019. I added a width and height statement using a text editor without knowing that unchecking the export option "Responsive" would do the same thing.

 

For all who are reading this:

If you need exact values when placing an exported SVG on an InDesign page, uncheck option Responsive when exporting to SVG. Or add the width and height statements by editing the SVG code with a text editor.

Do not open the SVG in Illustrator to save it differently. SVG is an endformat, it's not an exchange format!

 

From my German Adobe Illustrator 2021 version 25.2.3:

 

AI-Export-SVG-Responsive-UnChecked.PNG

 

As far as I now can tell, this option is already available with previous versions of Illustrator 2020, 2019, 2018. Also with Illustrator 2017 where the option was named "Interactive" ( at least in my German Illustrator ).

 

Cool. One riddle solved, thanks Daniel!

 

Regards,
Uwe Laubender

( ACP )

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 07, 2021 Jun 07, 2021

Copy link to clipboard

Copied

LATEST

Thank you so much for the detailed response, It's interesting that you found out about viewbox statement, I will stick to exporting as a non responsive svg to avoid the 0.5 margin you explained above. It's interesting to see the difference in the code, so thanks for taking the time to write this out.

 

Do you happen to know why InDesign exports duplicates of an image inside the image folder of the epub? It seems inconsistant about how many copies it does, just say I have the logo in the epub 10 times at the same size, sometimes it will create 3 duplicates and other times it could be more or less without changing anything. Can I get it to use the same image everytime in a fixed layout epub?

 

Thanks

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines