Page 1 of 1

SVG export background color and errors

Posted: Mon Jul 29, 2019 10:14 pm
by slcasner
Is there any way to control the background color in an SVG export? I have the background for the graphics view and for printing set to black, but the background is still white when the SVG export is viewed in Firefox or Safari. Furthermore, even with the preference "Prevent white on white/black on black display" not set, the white lines are exported as black.

I found in https://stackoverflow.com/questions/112 ... ot-element that there are several ways to express the background color in SVG with varying degrees of adoption. I observe that just adding ";background-color:black" to the style item in the svg element at the top of the file renders the background as desired in both Firefox and Safari. Of course, it is also necessary to replace all the drawing elements having color #000000 with #ffffff. So I can fix this with a sed script, but it also seems like a straightforward enhancement to QCAD.

There are some other problems with the SVG output that are not easily edited. A solid fill between two concentric arcs gets rendered as a very low-resolution representation of the arc composed of filled triangles that don't fill the space between the arcs and extend outside of the inner arc. See the attached screenshots of the QCAD window and the white- and black-background versions of the SVG file rendered in Firefox, as well as the source DXF and SVG files. Also, there are three dimension labels that are rendered incorrectly: the black/white labels 4.1 and 4.9 near the center of the drawing should be in the dimension layer color light blue, and the black/white label 1.5 written vertically to the left of the USB & RS232 INTERFACE text belongs to a layer that is supposed to be hidden.

I'm using QCAD Pro 3.22.1.0 on MacOS 10.14.4.

Re: SVG export background color and errors

Posted: Tue Jul 30, 2019 5:08 pm
by slcasner
One more deviation in the SVG output relative to the graphics view that I forgot to mention is that the font for the dimension labels is set to "standard" or "Standard" rather than "Arial" like the major text items.

Re: SVG export background color and errors

Posted: Wed Jul 31, 2019 9:52 am
by andrew
slcasner wrote:
Mon Jul 29, 2019 10:14 pm
Is there any way to control the background color in an SVG export?
No, this is not currently supported (i.e. the background is always transparent).

Re: SVG export background color and errors

Posted: Thu Aug 01, 2019 11:15 pm
by slcasner
Andrew, sorry for mixing multiple topics in one post, but do you have any comment on the other anomalies in the SVG output that I identified?