print in svg creates ps-file

Bug #412698 reported by hannibal on 2009-08-12
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Mozilla Firefox
firefox-3.5 (Ubuntu)
Mozilla Team
Nominated for Karmic by hannibal

Bug Description

I want to print a website to svg, but get a ps-file.
Print in svg works in gedit and eog, so it must be a problem with firefox.
Print in pdf/ps works.

$ lsb_release -rd
Description: Ubuntu karmic (development branch)
Release: 9.10

$ apt-cache policy firefox-3.5
  Installiert: 3.5.2+nobinonly-0ubuntu2
  Kandidat: 3.5.2+nobinonly-0ubuntu2
 *** 3.5.2+nobinonly-0ubuntu2 0
        500 karmic/main Packages
        100 /var/lib/dpkg/status

In Ubuntu Karmic, the Gnome "print" dialog's print-to-file mode includes an option for SVG output (along with PS and PDF). However, if I select this mode in Firefox, the resulting ".svg" file *actually* contains postscript.

 1. File | Print
 2. Select "Print To File" from the printer list
 3. Select "SVG" as the Output Format, and enter in a name for the file.
 4. Examine the resulting file

EXPECTED RESULTS: Outputted file should be an SVG (or, "SVG" output mode should not be available)
ACTUAL RESULTS: Examining the text of the outputted file shows that it's actually a postscript file.

 * Ubuntu 9.10
 * Gnome 2.28.1
 * Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.3a1pre) Gecko/20091030 Minefield/3.7a1pre

I just tried printing "about:blank" once as Postscript and once as SVG, and the outputted files were identical. (aside from the "%%CreationDate:" header)

Created attachment 409789
screenshot: print dialog with SVG output option

Here's a screenshot of the print dialog that I get from Firefox, with "SVG" available as an output format.

SVG is a new format in the print dialog we don't handle yet. I'm wondering if there's a way for us to tell GTK we don't support it.

We can support it. We just need to use the cairo SVG backend.

Ah, of course.

Created attachment 410112

This hould work in theory, but I can't get it to compile because it keeps giving this error during libxul linking:

In function `_cairo_svg_surface_emit_composite_pattern':
cairo-svg-surface.c:(.text+0x1cc0): undefined reference to `INT__moz_cairo_surface_write_to_png_stream'

I don't know how we build Cairo and I don't have the time right now to deal with it. Does anyone who understands this knows what's going on?

Changed in firefox-3.5 (Ubuntu):
assignee: nobody → Andreas Käser (bugs-launchpad-net-ubuntu-firefox)
status: New → Confirmed
assignee: Andreas Käser (bugs-launchpad-net-ubuntu-firefox) → Mozilla Team (mozillateam)
Changed in firefox:
status: Unknown → Confirmed

Looks like we are not compiling cairo-png.c

madbiologist (me-again) wrote :

Until the mozilla bug linked above ( ) is fixed, the SVG output option will be removed from Firefox's print dialog. See for details. This change should be included in Firefox 3.6.2, scheduled for release on 30th March 2010. This change is also slated for Firefox 3.5.9.

Changed in firefox:
importance: Unknown → Medium

Created attachment 476819
Updated patch

* Some libpng features which are disabled currently are enabled to compile cairo-png.c

* Use SVG 1.2 to adopt what gtk applications do.
Using SVG 1.1, cairo fallbacks almost contents and only renders last page.
Using SVG 1.2, cairo uses less fallback images and generates multi-page SVG using the SVG Print 1.2 elements.
# I wonder if there are any implementation of the SVG Print 1.2.

> --- a/widget/src/gtk2/nsPrintDialogGTK.cpp
> +++ b/widget/src/gtk2/nsPrintDialogGTK.cpp
> @@ -209,18 +209,16 @@ nsPrintDialogWidgetGTK::nsPrintDialogWid

IMHO it would be better to keep these set and add the SVG variant, in case Gtk+ adds yet another format (in which case not specifying anything would bring up the new unsupported format in the print dialog, like it happened when SVG was added in Gtk+)

BTW, the originally reported issue is gone with bug 546093. This bug is now about allowing SVG as an output format.

Hmm, GTK+ lacks a constant to specify whether application supports SVG output.

Changed in firefox:
status: Confirmed → Unknown
Changed in firefox:
status: Unknown → Confirmed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.