Page MenuHomePhabricator

Export of SVG images to PDF or PS
Closed, DeclinedPublicFeature

Description

It would be nice to have the possibility to export SVG images to further formats like PDF or PS.

Since most (if not all) of the currently supported SVGConverters (http://www.mediawiki.org/wiki/Manual:$wgSVGConverters) support a multitude of output formats implementation should be possible without too much effort.


Version: 1.21.x
Severity: enhancement

Details

Reference
bz45640

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 22 2014, 1:13 AM
bzimport set Reference to bz45640.
bzimport added a subscriber: Unknown Object (MLST).

Beyond being kind of cool, what is the usecase for this? (Or more to the point is this something that would be widely useful?)

There is currently a request on German Wikipedia for such a feature, that's how I got to the idea (http://de.wikipedia.org/wiki/Wikipedia_Diskussion:WikiProjekt_SVG#PDF-Exportm.C3.B6glichkeit_f.C3.BCr_SVG-Dateien).

Personally I initially thought, that the feature wasn't needed, too (it's simple to convert the file yourself if you need to)

Now I think there could actually be some demand for it:

  • It's hard to import SVG into many widely used third party programs (e.g. OpenOffice, PowerPoint, etc.) therefore most people currently probably use a prerendered PNG versions loosing quality.
  • A common Windows installation isn't equipped with a software able to display (except Internet Explorer) or even edit SVG files. Therefore many people don't now how to use SVG whereas PDF is a common format nowadays.
  • Finally it seems like a feature to come "for free", since everything to convert SVG to PNG is already there and conversion to PDF would only need a small change in the command line call.
  • It's hard to import SVG into many widely used third party programs (e.g.

OpenOffice, PowerPoint, etc.) therefore most people currently probably use a
prerendered PNG versions loosing quality.

I don't see the connection to exporting to PDF or PS, and we have PNG export in place already.

  • A common Windows installation isn't equipped with a software able to

display
(except Internet Explorer) or even edit SVG files. Therefore many people
don't
now how to use SVG whereas PDF is a common format nowadays.

PNG is too, so again I wonder.

  • Finally it seems like a feature to come "for free", since everything to

convert SVG to PNG is already there and conversion to PDF would only need a
small change in the command line call.

Still a good reason is welcome. "Just because we can" is nice but creates maintenance costs when things break.

You can't argue that we didn't need PDF or PS export because we already had PNG export. PDF/PS is vector based, PNG is rasterized.

Sure, all these things *work* with PNG, but do you *want* to do them with PNG? If you've got a vector source at hand, you should use it. It provides much better quality while maintaining a substantially smaller file size.

A further example (I consider my reasons above still valid) where PDF/PS export would come in handy is LaTeX. The newer pdftex compiler accepts PDFs natively, the older latex compiler requires PS/EPS. They're both not able to handle SVG, latex can't even handle PNG.

Saying "PNG fits all" wasn't my intention (sorry if it came across like that).

I was rather after finding a good argument for PDF/PS, and am wondering if PDF import is that much better than SVG import in mentioned applications indeed.
(Side note: latexmk handles PNG - I can embed PNG files in my LaTeX files).

tuxyso wrote:

For sure: PNG is well supported in LaTeX but is unable to produce high quality PDF (with zoom possibility). I often use PDF export of OpenOffice to create high quality vector output and embedd it into my LaTeX document. Thus it would be very useful (not only for LaTeX users) to have a compiler-independent vector output of an SVG file. I think there are good reasons to offer an additional vector graphic output. If you look at high quality Epaper versions of newspaper like the FAZ in Germany visualizations are always embedded as vector graphic and not as bitmap.

Workaround:

  • open SVG file in browser
  • print to PDF
Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 11:14 AM
Aklapper removed a subscriber: wikibugs-l-list.
TheDJ subscribed.

I don't think we will ever do this. MediaWiki is not a general purpose image conversion engine (We should be careful of feature creep). External tools already handle this kind of thing and tools forge tools can be made if absolutely needed. To boot, SVG support is pretty common right now.