Bug 694088

Summary: "svg" device results SVG syntax errors of the form '...'#000000
Product: Ghostscript Reporter: jsmeix
Component: Other DriverAssignee: Default assignee <ghostpdl-bugs>
Status: RESOLVED WONTFIX    
Severity: normal CC: henry.stiles
Priority: P4    
Version: 9.07   
Hardware: PC   
OS: Linux   
Customer: Word Size: ---
Attachments: /tmp/hello.ps
/tmp/hello.svg as produced by Ghostscript
My manually fixed /tmp/hello.svg

Description jsmeix 2013-05-21 14:33:19 UTC
Created attachment 9728 [details]
/tmp/hello.ps

I made a SVG file using

# echo "Hello" | a2ps -1 -o /tmp/hello.ps
# gs -sDEVICE=svg -sOutputFile=/tmp/hello.svg -dNOPAUSE -dBATCH /tmp/hello.ps

When I try to display /tmp/hello.svg in my Firefox browser,
Firefox cannot display it and shows those syntax errors:

XML Parsing Error: not well-formed
Location: file:///tmp/hello.svg
Line Number 7, Column 18:
<g  stroke='none'#000000>
-----------------^

XML Parsing Error: not well-formed
Location: file:///tmp/hello.svg
Line Number 184, Column 21:
<g  stroke='#f5f5f5'#000000 stroke-width='83.333328'>
--------------------^

XML Parsing Error: not well-formed
Location: file:///tmp/hello.svg
Line Number 187, Column 21:
<g  stroke='#000000'#000000 stroke-width='2.916667'>
--------------------^

I fixed those syntax errors manually one by one and this is the diff:
---------------------------------------------------------------------------
7c7
< <g  stroke='none'#000000>
---
> <g  stroke='none'>
184c184
< <g  stroke='#f5f5f5'#000000 stroke-width='83.333328'>
---
> <g  stroke='#f5f5f5' stroke-width='83.333328'>
187c187
< <g  stroke='#000000'#000000 stroke-width='2.916667'>
---
> <g  stroke='#000000' stroke-width='2.916667'>
---------------------------------------------------------------------------
I.e. I removed the #000000 addendums after the '...'
and now Firefox can display the SVG file.
Comment 1 jsmeix 2013-05-21 14:34:25 UTC
Created attachment 9729 [details]
/tmp/hello.svg as produced by Ghostscript
Comment 2 jsmeix 2013-05-21 14:35:18 UTC
Created attachment 9730 [details]
My manually fixed /tmp/hello.svg
Comment 3 Henry Stiles 2013-05-21 14:51:05 UTC
Ghostscript svgwrite is soon to be deprecated.  All SVG activity (reading, writing) is in development under the MuPDF project.  The enhancement for writing is being tracked here:http://bugs.ghostscript.com/show_bug.cgi?id=694089.
Comment 4 jsmeix 2013-05-23 07:31:46 UTC
Only for the log, this one is a related issue:
http://bugs.ghostscript.com/show_bug.cgi?id=693922