print in svg creates ps-file

Bug #412698 reported by hannibal
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Mozilla Firefox
Confirmed
Unknown
firefox-3.5 (Ubuntu)
Confirmed
Undecided
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
firefox-3.5:
  Installiert: 3.5.2+nobinonly-0ubuntu2
  Kandidat: 3.5.2+nobinonly-0ubuntu2
  Versions-Tabelle:
 *** 3.5.2+nobinonly-0ubuntu2 0
        500 http://archive.ubuntu.com karmic/main Packages
        100 /var/lib/dpkg/status

Revision history for this message
In , Daniel Holbert (dholbert) wrote :

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.

STEPS TO REPRODUCE:
 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.

VERSION INFO:
 * 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

Revision history for this message
In , Daniel Holbert (dholbert) wrote :

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

Revision history for this message
In , Daniel Holbert (dholbert) wrote :

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.

Revision history for this message
In , Ventnor-bugzilla (ventnor-bugzilla) wrote :

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.

Revision history for this message
In , Roc-ocallahan (roc-ocallahan) wrote :

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

Revision history for this message
In , Ventnor-bugzilla (ventnor-bugzilla) wrote :

Ah, of course.

Revision history for this message
In , Ventnor-bugzilla (ventnor-bugzilla) wrote :

Created attachment 410112
Patch

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
Revision history for this message
In , Karlt (karlt) wrote :

Looks like we are not compiling cairo-png.c

Revision history for this message
madbiologist (me-again) wrote :

Until the mozilla bug linked above ( https://bugzilla.mozilla.org/show_bug.cgi?id=525998 ) is fixed, the SVG output option will be removed from Firefox's print dialog. See https://bugzilla.mozilla.org/show_bug.cgi?id=546093 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
Revision history for this message
In , Kurosawa Takeshi (takenspc) wrote :

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.

Revision history for this message
In , Mh+mozilla (mh+mozilla) wrote :

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

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

Revision history for this message
In , Mh+mozilla (mh+mozilla) wrote :

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

Revision history for this message
In , Kurosawa Takeshi (takenspc) wrote :

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

http://library.gnome.org/devel/gtk/unstable/GtkPrintUnixDialog.html#GtkPrintCapabilities

Changed in firefox:
status: Confirmed → Unknown
Changed in firefox:
status: Unknown → Confirmed
Revision history for this message
In , Bug-husbandry-bot (bug-husbandry-bot) wrote :
Changed in firefox:
importance: Medium → Unknown
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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