Skip navigation

Two weeks ago, I had the privilege to work on a fun project using company time – it was Novell HackWeek again. So I teamed up with friend & colleague Fridrich to finally get OOo its long-deserved built-in SVG import – in fact, this is the most voted-for feature of the whole project.

So we started off of kendy’s work in ooo-build, and hacked up a native C++ component (the external implementation unfortunately has strong dependencies on Java5 and Batik, and is GPL-licensed – but great work, and a piece still superior in import quality) that sucks in a DOM tree from the SVG file, subverts that into a temporary container for ODF styles (which, unfortunately, needs to be written before referencing them in a flat ODF file), and then pushes out events for a SAX parser, which has the nice side effect of making standalone svg-odf conversion trivial (in fact, a svg2odf command line tool is on my disk). This stuff has been committed to ooo-build.

What’s working? See for yourself:

tiger.png

lion.png

What’s missing yet: text and gradients are clearly very noticeably lacking – though this is luckily totally unapparent from the screenshots 😉

We’ll keep working on this in our spare time, so there’ll hopefully be updates soonish. It would just be great to take advantage of the vast amount of svg cliparts out there – without needing to convert them to png, as OOo currently does…

Advertisements

13 Comments

  1. Guys, you are my heroes!

  2. It’s great to see work on the SVG import, but (as I’ve tried to highlight in the issue-report) svg *import* is not the route to “svg support” (and besides, the SVG-import extension works very well).

    To really help SVG-support in OOo, then what’s required is a native SVG renderer. This would enable users to embed SVG images in documents *without* having to convert them to OOo-Draw primitives. This is the *only* way to preserve the round-trip fidelity of the image (as soon as you convert to Draw primitives, you’ve changed the document irrevocably). I.e. I want to be able to use SVG in Writer like I use PNG images.

    Right now, there NO standard vector format for images in (text) documents (there’s GDI images or OLE Draw objects but these aren’t standard outside OOo).

    The distinction between support for SVG as an image-type in writer is quite different from svg-import into Draw.

  3. Hi thorsten, that’s really cool to know that there is work going on the SVG import! Thanks.

  4. Go Thorsten Go. It rocks!

  5. Wonderful!

    But could someone please remove the page with the bug votes? It has not been
    updated since 2006, and it looks completely different today.

    (i mean http://qa.openoffice.org/iz_votes.html)

  6. @bryan: you’re right, of course – but still, this is the right direction, no? Other than that, with the to-be-3.0 status of the Draw/Impress core, supporting more svg features natively is entirely possible

    @ralph: ugh. indeedly. I should rather check my sources next time…

  7. Awsome! I really hope that something along those lines will make it into the stable. Integration of graphics are a constant pain, especially in linux, where no proper vector graphics format except svg appears to work properly. Rock on! and keep up the good work!

  8. For a chemist there is on Linux no good and convenient editor to write chemical publications with text and graphical chemistry formulas. I know on Linux at least four chemical editors, which can export reaction equations in SVG format.

    OOo would be *the editor* for chemistry, when it could import SVG in Writer (especially as Copy/Paste).

    Where is a forum to discuss it with the OOo developer ?

    Once more: Rock on! and keep up the good work!

  9. The best place to discuss things is probably the enhancement request: http://www.openoffice.org/issues/show_bug.cgi?id=2497

    Other than that, you’re welcome to ask on #go-oo or #dev.openoffice.org at freenode (IRC).

  10. It’s realy a good work thorstenb but I’m agree with bryan and what I waiting for is a native SVG renderer.
    Open source is suppose to be much standard compliant than non-free software, svg is a greate standard, OOo is a great piece off software but the open source chain is broken because the lack of svg support in OOo!

  11. pidou46: not sure what you’re aiming at. there’s a bunch of excellent FLOSS svg authoring tools, e.g. Inkscape, and also good renderers, e.g. librsvg. the point about this project was to map svg to odf (which is unfortunately not lossless).

  12. Hi,

    I know this is quite a old blog entry, but it’s the only result I’ve found on Google..
    I’d like to convert my SVG file into an ODF (.odg) file. You mentioned a tool called svg2odf, is this tool somewhere available? Or do you know another way to do this (on CLI or through a library)?

    Thanks a lot.


One Trackback/Pingback

  1. […] in OpenOffice.org So, got some time to work on SVG import again. Gradients are now working pretty good (within the limits of OOo/ODF, of course), basic text […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: