export page background color to plain SVG format

Bug #166213 reported by Kees Cook on 2005-01-19
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Inkscape
Wishlist
Unassigned

Bug Description

Looks like during the routine that loads
share/inkscape/screens/* files (like the about.svg) the
document background color is ignored.

Tags: svg Edit Tag help

I don't see this. Please provide more details (exactly what
file, how loaded, what's the difference).

Kees Cook (kees) wrote :

I didn't think I described this very well. :)

I downloaded brisgeek's new about.svg. When I put it in
place, the about screen shows a white background (rather
than the brownish that was set for the background). The
about.svg currently in CVS has a brown rectangle behind
everything, added by me to work around the problem.

Did that help at all?

I see no difference between about.cpp loaded as a normal
file or via help>about. The bg is warm gray with white dirt
in both cases.

Bug Importer (bug-importer) wrote :

use this file as the about.svg, and you'll see it. The one
in CVS was modified to work around the problem.

http://andy.fitzsimon.com.au/about41.svg

Actually we need to switch from using sodipodi:namedview to
the background property which was added to SVG 1.2. When we
do that it'll fix this one too, because it will be processed
universally by the renderer (now the bg color is a separate
canvas item on the main canvas, but missing in other
canvasses such as the about box, hence this bug).

vonHalenbach (lustik) on 2007-12-14
Changed in inkscape:
importance: Low → Wishlist
status: New → Confirmed
Tom Davidson (tjd-mit) wrote :

Can someone attach another test file that has the background property? andy's link is dead...

Peter Williams (k-peter) wrote :

Even though this bug is more than five years old, it's still valid, as far as I can tell.

If you create a file in Inkscape, set its background color to something random (non-transparent blue, say), and export to Plain SVG, the exported file does not have a blue background. If you look at the XML, the background information is nowhere to be found.

In Inkscape's defense, the SVG spec seems to completely fall down on this basic functionality. The SVG 1.2 Tiny specification does define a "viewport-fill" property on the <svg> element that can be used to define a background fill: http://www.w3.org/TR/SVGTiny12/painting.html#viewport-fill-property .

However, it appears that SVG 2 is going to go another route: see the discussions at http://www.w3.org/2012/07/23-svg-minutes.html . The current plan appears to be that CSS styling will be used, and you can write <svg style="background-color: #abcdef">

I'm attaching two sample files gleaned from the specifications that I think should demonstrate the two techniques. Neither gets a colored background in EOG. The viewport-fill method doesn't work in Firefox. However, the CSS background test file does get a colored background when viewed in Firefox.

Given the current situation, exporting via the CSS background-color property seems like it should be better than nothing. Will unexpected properties cause other SVG viewers to freak out?

Peter Williams (k-peter) wrote :
summary: - implement SVG 1.2 "background" property
+ export page background color to plain SVG format
Peter Williams (k-peter) wrote :

One last comment: for the source of the background-color example and some related discussion, see https://svgwg.org/svg2-draft/single-page.html#color-ColorProperty .

Roul P. (perhelion1) wrote :

I mean this is a dupe of Bug #180890

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers