Saving Plain SVG with viewBox extension

Bug #169966 reported by Strank-users
6
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Wishlist
Unassigned

Bug Description

This is a small and simple output extension (in Python) that provides for
saving Plain svg, without width and height attributes. Instead it adds a
viewBox.

Such svg files are actually scalable when embedded in websites.

I use this as a stop-gap measure until the standard svg output method
supports options for different width/height viewBox combinations (and
preserveAspectRatio).

(to use: put both files into share/extensions/)

cheers,
stefan

Tags: saving viewbox

Related branches

Revision history for this message
Strank-users (strank-users) wrote :

Originator: YES

File Added: svg_viewBox_output.inx

Revision history for this message
vonHalenbach (lustik) wrote :

Thank you for this extention!

Changed in inkscape:
importance: Undecided → Wishlist
status: New → Triaged
Revision history for this message
Martin d'Anjou (point14) wrote :

I uploaded a modification to the extension proposed above. It uses org.inkscape.output.svg.inkscape instead or org.inkscape.output.svg.plain. I do not claim to understand how this whole thing works, but I can see that the "plain" format has stores much less information in the file and I wanted to keep that information.

My uploads are called svg_viewBox_output2.inx and svg_viewBox_output2.py so they can be installed without interfering with the other one.

Revision history for this message
Martin d'Anjou (point14) wrote :

The second upload.

Revision history for this message
jazzynico (jazzynico) wrote :

The upcoming 0.48 version already (committed yesterday!) has an Optimized SVG output (scour.py) which can replace width and height by a viewbox, almost exactly the same way you did (with some extra tests).
Anyway, thanks for this update and the time spent improving it!

Changed in inkscape:
milestone: none → 0.48
status: Triaged → Fix Committed
jazzynico (jazzynico)
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

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