STI to TXT
Your presentation never leaves your browser, and nothing is downloaded to make this work. An OpenDocument file is a ZIP of XML and your browser can already unzip; the rest is reading.
The words off the slides, in the order they are on them.
This is the common need behind “convert my presentation”: somebody wants the script, not the deck. Each slide keeps its heading and its bullets, indented to the level they were nested at, and the speaker notes are kept apart so you can take them or leave them. That last part is the whole job: notes live inside the slide in the file, and a converter that walks the text hands you the presenter's private remarks as though they were on the screen.
The speaker notes are inside the slide
This is the one thing about the format that catches every
converter written in an afternoon. A presentation's notes are not a
separate file or a separate section: presentation:notes is a
child of the slide, holding frames and paragraphs shaped exactly
like the slide's own.
So the obvious reader — unzip, find every
text:p, take the text — hands you back every slide with
the presenter's private remarks glued onto the end of it. Nothing errors.
Nothing looks wrong. The notes simply become part of the talk, and the
first anybody knows is when they read it.
Here they are read separately, counted, and left out unless you ask for them. The count is on screen either way, because “this deck had eleven paragraphs of notes and you have not got them” is worth knowing.
And a run of spaces is not spaces
OpenDocument does not store repeated spaces as
characters. Two or more become one
<text:s text:c="6"/> element, a tab becomes
<text:tab/> and a line break inside a paragraph becomes
<text:line-break/>. Take only the character data and
“Q1 Q2” comes out as
“Q1Q2” — a silent corruption that reads like a typo in
the original. All three are expanded here, and tested against a file
odfpy wrote.
What an OpenOffice.org 1.x file is
StarOffice 6, StarOffice 7 and OpenOffice.org 1.x wrote these between 2000 and 2005. OpenOffice 2.0 replaced them with OpenDocument — the .odt, .ods and .odp everything uses now — and LibreOffice has been able to read them but not write them since version 4.3. Nothing current produces one, which is exactly why people still have them and nothing will open them.
It is almost OpenDocument, and the gap is small and specific. The namespaces are the old http://openoffice.org/2000/… ones, there is no mimetype entry in the package — the type lives in META-INF/manifest.xml, and in an office:class attribute the specification put there for the purpose — and, the one that matters, the content sits directly inside <office:body> with no wrapper round it. OpenDocument added <office:text>, <office:spreadsheet>, <office:presentation> and <office:drawing>.
That last one is why a converter written by resemblance can hand back an empty file rather than an error: it looks for an element that was never there and finds nothing. What this page does is put the missing element back and then read the file as the OpenDocument it almost is. Everything inside — the paragraphs, the tables, the draw pages — is named identically.
All of that is read from the OpenOffice.org XML File Format technical reference, version 2, December 2002, and not from the file looking similar. What has not been done is said plainly: no file written by a real OpenOffice.org 1.x has been read here. There is none to test against on the machine this was built on, so it is built to the published specification. If yours does not open, that is worth knowing about.
What does not come across
The layout. A slide is boxes at coordinates; this is a document that reads top to bottom, so two columns become one after the other. Backgrounds, master-slide furniture, transitions and animations have nowhere to go. Pictures, charts and embedded objects are counted and named but not carried, because they are separate files inside the package.
Page numbers, dates and footers are dropped on purpose: they are marked as furniture in the file, and repeating “Slide 4 of 20” through a transcript helps nobody.
Where to go next
- STI to Markdown — the same file, another way out
- STI to HTML — the same file, another way out
- SXI to TXT — the template, which is the same format