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

Export SVG changed the dashed line

New Here ,
Mar 07, 2018 Mar 07, 2018

Hello,

I am using Illustrator CC 2015.1.0. I have dashed lines in my drawing for center line.

I have a script to align dashes to corners and path ends. This works fine. Then I have my drawing in Illustrator:

SVG1.jpg

I have to export the drawing in several formats, like png, jpg and svg.

The export to png and jpg is correct. But the export to svg is wrong.

The dashed line in the center is not correct. Look here:

SVG2.jpg

It seems, that the SVG Export adjust the dashes. What can I do?

Best regards

Harald

2.8K
Translate
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
Adobe
Community Expert ,
Mar 07, 2018 Mar 07, 2018

SVG doesn't support this alignment of dashes.

Translate
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
New Here ,
Mar 07, 2018 Mar 07, 2018

Thank you for this quick response.

That means, the SVG Export is not using the alignment of the Illustrator?

Translate
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 ,
Mar 07, 2018 Mar 07, 2018

The SVG standard does not support the alignment of dashes.

Translate
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
New Here ,
Mar 07, 2018 Mar 07, 2018

OK, so what can be the solution?

Can I convert the dashes to "normal" lines (Object->Expand)?

Translate
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 ,
Mar 07, 2018 Mar 07, 2018

Expanding them will outline the strokes.

You could try the adjust dashes script s.h's page : Scripts for Adobe Illustrator CS

Translate
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
New Here ,
Mar 07, 2018 Mar 07, 2018

I use exactly this script to adjust the dashes.

Translate
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 ,
Mar 07, 2018 Mar 07, 2018

Does this script not cut your path at dashes?

I did some test with it and IIRC it cut the path.

You can try and manually code it by using the dashoffset in your SVG code:

Using SVG stroke Attributes

Translate
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
New Here ,
Mar 07, 2018 Mar 07, 2018

I have done a lot of tests.

The SVG Export works, when I use the adjusting of Illustrator with these buttons in the Stroke menu:

Dash.png

When I use the Javascript function then it does not work.

But I cannot use the Illustrator function, because it is not scriptable.

What is the solution?

Translate
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 ,
Mar 07, 2018 Mar 07, 2018
LATEST

You might want to ask over in the scripting forum if someone has a solution for you:

https://forums.adobe.com/community/illustrator/illustrator_scripting

Translate
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