Skip to main content
Participant
October 27, 2019
Question

Problems using Adobe Illustrator to Create SVG Path with Javascript

  • October 27, 2019
  • 2 replies
  • 746 views

Hello,

 

I have created a path using Adobe Illustrator and am loading it into SVG Javascript as a function. The path comes out from the image I am using as the following path: M0,0h106.67v98.67H0V0z 

 

For some reason the image shows up as a black square and does not have the image as shown when creating Compound Path. What would be the next step to try to make the image show up properly, the javascript I am using looks like such:

 

var svg = createElement( 'svg', {},
createElement( 'path', { d: 'M0,0h106.67v98.67H0V0z' } )
);

 

I created the Compund Path by doing the following in Adobe Illustrator:

Deselect everything

Select >> Object >> Clipping Masks

Select >> All

Object >> Clipping Mask >> Make

Object >> Compound Path >> Make

Edit >> Copy

Paste into Text file copy path from svg text from Adobe Illustrator

What am I doing wrong?

 

It should have more numbers on it than just M

something like this M150 0 L75 200 L225 200 Z

 

    This topic has been closed for replies.

    2 replies

    renél80416020
    Inspiring
    October 27, 2019

    Salut!

    Il faudrait donner une copie d'écran pour aider à comprendre la question..

    Les trais chemins suivants sont identiques:

    <path d="M0,0h106.67v98.67H0z"/>
    <path d="M0,0l106.67,0l0,98.67l-106.67,0Z" />
    <path d="M0,0L106.67,0L106.67,98.67L0,98.67Z" />

    un rectangle 98.67 x 106.67 calé en haut et à gauche du plan de travail

    de eloleere

    renél80416020
    Inspiring
    October 27, 2019

    Impossible de corriger le message ??? (il paraît que le cite est moderne, enfin d'après les concepteurs)

    Lire

    Les trois chemins suivants sont identiques:

    de elleere

    Participant
    October 28, 2019

    Hello,

     

    I managed to use Gimp to and set To Path but the path shows up as black square and not the png image that was orignally created by Adobe Illustrator.

    Mylenium
    Legend
    October 27, 2019

    Open the file in Inkscape, re-save it from there and use the resulting code snippets. It's usually not worth trying to fix AI's crooked SVG code the hard way...

     

    Mylenium

    Participant
    October 27, 2019

    I've never tried inkscape, is this the recommended way to create this type of path needed for svg?

    Participant
    October 27, 2019

    I tried converting to shape and it created a rectangle that had no coloring on the field. I will attempt with Inkscape.