Print This Post Print This Post

Guitar Chord Diagrams in SVG? – Part 3

Now! Embed SVG chords directly in OpenOffice.Org Writer Documents!

Update 19th June 2012: Python SVG Chord generator code now available

Previous posts on this subject can be accessed by the following mini-menu:

The most-asked-for feature in OpenOffice.Org has been SVG – Scalable Vector Graphics, and this has now been done in version 3.4.
As a taster, check out the embedded PDF below:

The document is available as a PDF download here: SVG Chord Example
My original OpenOffice.Org Writer (v3.4) document is here:

If you haven’t got at least an Acrobat reader on your machine, then you won’t be able to see what is embedded below.

To TOP of Page

To say that I am pleased, would be a serious understatement – I’m delighted.
I also have an apology to make. In the last (part 2) post on SVG chords, I said any further material would be added there. What I didn’t bargain for was how quickly my wishes would be answered.

A few words on the subject. First the implementor’s Blog post makes interesting reading, and can be found here:

In it, he mentions that both the supplied svg and png file are embedded as graphics, so that the odt (Writer document) file can be read by older versions of OpenOffice. I’ve checked this out in the content.xml file, and you can examine this for yourself – each chord is held within a frame:

Each svg file is also embedded in it’s entirety, including any copyright notices and comments, which is encouraging. The A9 chord for example is located, with the others in the Pictures sub-directory of the odt (zip) archive:
though, as you can see, the original file-name has not been preserved.

Further Work

My existing chord generator uses PHP, which normally means scripts have to be run on an http server. To make manufacturing chords a little easier, I’m converting the php code to Python, which will run natively on all platforms, without having to use an http server – watch this space!

Update 19th June 2012
I’ve re-written the PHP Chord Generator in Python, so you can now generate SVG chords without recourse to an http server.
Check out the example chords on this web page:
(Note that your browser must support SVG.)
Any/all of the chords content can be examined by open in another tab and examining the source. (or downloading and examining in a text editor)
The chord generator class file is here:
and the test file here:
The code was built and run on Python v2.7 on Windows XP/SP3.

I hope to provide examples of automating the production of a SFBV songsheet using the SVG chords shortly.

Copy the code below to your web site.
  • Share/Bookmark
Free PDF    Send article as PDF   

Comments are closed.