Error importing / opening SVG "an error occured while reading: invalid name for processing instruction - on line 2, column 6"

I have a SVG file with a number of layers in it. I can open in Inkskape, save as new SVG but I still get the same error in lightburn: “an error occured while reading: invalid name for processing instruction - on line 2, column 6”.

I can copy and paste a layer into a fresh inskape project and export and I believe I managed to copy out of inkscape and paste into Lightbun.

SVG is generated by an online CAD program and I really hope I can find out how to make the file compatible as any other way of getting shapes in will be un workable for complex designs.

Top|0x0

Make sure you are using Import to load the geometry into LightBurn, rather than Open. Although 'Open` should switch to importing an SVG file, apparently that process can fall off the rails.

Start by clicking the Import icon in the toolbar or selecting File → Import:

If that doesn’t improve the results, upload one of the offending SVGs so folks around here can take a look at it.

Thanks for your reply!

I’m trying to upload but it’s not working out too well, have trid to rename to .txt with no success…

I’ve tried import, open, I’ve also opened the file in a text editor, nothing looks obviously bad in the 2nd row, but I know nothing about SVG headers…

You don’t have to rename it.

Select
image

and upload your SVG

Top|0x0

Try it this way.

  1. Select the icon that is highlighted in yellow.
    image

  2. Navigate to where the SVG file is located. Mine is in a folder on my desktop called SVG.

  3. Select the file, and then select Open.

  4. Done
    Hello_World

  5. Then select Reply
    image

Top|0x0

Thank you, I understand and appreciate the spoon feeding…

I’ve moved file onto my PC and I’m trying to upload again. For good measure, I tried to load on my Lightburn here and still same error…

What program is creating the SVG?

Is this the result of uploading your svg?
image

If that’s the case can you open your svg in a text editor and paste a screenshot here?

it’s an online pattern creation platform ( for clothes making). I’ve just noticed that when trying to open in a browser, I’m getting the same error.

If there’s no simple answer to get this opening in Lightburn, I’ll close this thread as I’m not expecting support on a file that’s clearly not to spec for a variety of programs, strange what Inkscape opens it ok !

I’ll go back to the platform and ask them what’s going on…

Screenshot attached. I’ve just noticed that Notepad++ is highlighting something on line 2. I’m used to editing XMLs ( ones I know a lot about), SVGs I know nothing.

That’s great, thanks for that. It definitely looks like an svg file. I forgot that you said you could open it in Inkscape. Can you try appending a .txt extension and attempting to attach it again?

In Notepad, delete the characters on line 2 highlighted below and save.

I was working on trial and error removing code… removing the code you suggest has resulted in the following: Thank you!
Screenshot 2024-01-26 145111

Top|0x0

Renaming to .txt wasn’t removing the svg attribute ( I guess this forum uploader doesn’t like this SVG either so blocking it) I’ve exported out of Notepad++ as a text file again and it now looks good to upload!

Doesn’t look like you were able to upload.

SVG files are one of the few formats that the forum does allow you to upload. Usually any svg you upload is shown rendered inline like this:

Fill & Stroke test for LB

However if it is malformed or corrupted it might fail to parse it properly resulting in… well, I don’t know. I must admit that I thought that if you appended a .txt extension it would attach without parsing and rendering but I’ve just tested it and it still renders it as it did above!

You could try checking it with an svg validator or you could try running it through a sanitizer such as this one: https://svg.enshrined.co.uk/

EDIT:
You could also zip it up and then add the .txt extension to allow you to upload.

Fill & Stroke test for LB.zip.txt (751 Bytes)

Did you remove only the highlighted part? If you accidentally removed the <svg part, it might fail.
Actually, I would even suggest to remove everything up to the <svg part (ie. keep this part).

Did you resolve your issue with this @Gareth_W ?