SVG Import issue

Hello everyone,

I am using Ignition 8.1.33 and gabbed an SVG off google. I've opened the SVG using Inkscape, did Path -> Simplify, then saved the image as "Plain SVG." When I import to Ignition I get the following error: "Error parsing SVG file"

"RuntimeException: Unsupport SVG version '1'

Ignition v8.1.33 (b2023101913)
Java: Azul Systems, Inc. 17.0.8"

Anyone got any ideas why I can't import this SVG? Thanks in advance...

It will be anyone's guess without seeing what you have. Perhaps upload?

I usually save as optimized SVG, but plain should work as well.

The SVG library we use looks like it only supports SVG versions 1.1 and 1.2.

I don't use Inkscape personally, but it looks like there's an option in the Save As... menu to export as 1.1 (and maybe 1.2?)

1 Like

Thanks Kathy.

I am using Inkscape v1.3.2. The "Save As" dialog did not contain that option at first. I had to go to Edit > Preferences > Interface > Windows and then select "GTK Open/Save dialogs."

After turning on the GTK, I then had the option available in the "Save As" dialog to "export as SVG 1.1..."

Unfortunately, I am getting the same error still.

Can you post the full text of the error (use the code formatting feature in this forum)? Also open the SVG in a text editor and post the first part of the XML where it has the doctype.

java.lang.RuntimeException: Unsupport SVG version '1'
	at org.apache.batik.anim.dom.SAXSVGDocumentFactory.getDOMImplementation(SAXSVGDocumentFactory.java:327)
	at org.apache.batik.dom.util.SAXDocumentFactory.startElement(SAXDocumentFactory.java:640)
	at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
	at org.apache.batik.dom.util.SAXDocumentFactory.createDocument(SAXDocumentFactory.java:453)
	at org.apache.batik.dom.util.SAXDocumentFactory.createDocument(SAXDocumentFactory.java:357)
	at org.apache.batik.anim.dom.SAXSVGDocumentFactory.createDocument(SAXSVGDocumentFactory.java:226)
	at com.inductiveautomation.factorypmi.designer.workspace.DropHandler$SvgImporter.parseSvg(DropHandler.java:307)
	at com.inductiveautomation.factorypmi.designer.workspace.DropHandler$SvgImporter.run(DropHandler.java:336)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)

Ignition v8.1.33 (b2023101913)
Java: Azul Systems, Inc. 17.0.8
<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<svg
   width="646.66669"
   height="486.66666"
   viewBox="0 0 38.800001 29.199999"
   version="1"
   enable-background="new 0 0 48 48"
   id="svg1"
   sodipodi:docname="checkmark2.svg"
   inkscape:version="1.3.2 (091e20e, 2023-11-25, custom)"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:svg="http://www.w3.org/2000/svg">
  <sodipodi:namedview
     id="namedview1"
     pagecolor="#ffffff"
     bordercolor="#000000"
     borderopacity="0.25"
     inkscape:showpageshadow="2"
     inkscape:pageopacity="0.0"
     inkscape:pagecheckerboard="0"
     inkscape:deskcolor="#d1d1d1"
     inkscape:zoom="1.652439"
     inkscape:cx="322.85609"
     inkscape:cy="242.97417"
     inkscape:window-width="1920"
     inkscape:window-height="1009"
     inkscape:window-x="1912"
     inkscape:window-y="-8"
     inkscape:window-maximized="1"
     inkscape:current-layer="svg1" />
  <defs
     id="defs1" />
  <polygon
     fill="#43a047"
     points="17,35.7 7.4,26.1 4.6,29 17,41.3 43.4,14.9 40.6,12.1 "
     id="polygon1"
     transform="translate(-4.6,-12.1)"
     style="image-rendering:auto" />
</svg>

I was able to get it imported. When looking at the SVG in a text editor, I changed Version="1" to Version="1.1" and the import worked fine. Thanks, Kathy, for your help. Much appreciated!

1 Like