SVG export background color and errors

If you are having problems with QCAD, post here. Please report bugs through our Bug Tracker instead.

Always attach your original DXF or DWG file and mentions your QCAD version and the platform you are on.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
slcasner
Junior Member
Posts: 21
Joined: Tue May 07, 2019 10:23 pm

SVG export background color and errors

Post by slcasner » Mon Jul 29, 2019 10:14 pm

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.
Attachments
white.svg
(1.92 MiB) Downloaded 610 times
white.png
white.png (460.15 KiB) Viewed 6947 times
wheelwriter.2.0.dxf
(2.46 MiB) Downloaded 580 times
qcad.png
qcad.png (602.48 KiB) Viewed 6947 times
black.svg
(1.92 MiB) Downloaded 601 times
black.png
black.png (440.8 KiB) Viewed 6947 times

slcasner
Junior Member
Posts: 21
Joined: Tue May 07, 2019 10:23 pm

Re: SVG export background color and errors

Post by slcasner » Tue Jul 30, 2019 5:08 pm

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.

User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

Re: SVG export background color and errors

Post by andrew » Wed Jul 31, 2019 9:52 am

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).

slcasner
Junior Member
Posts: 21
Joined: Tue May 07, 2019 10:23 pm

Re: SVG export background color and errors

Post by slcasner » Thu Aug 01, 2019 11:15 pm

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?

Post Reply

Return to “QCAD Troubleshooting and Problems”