====== Open Office Export ====== ---- plugin ---- description: Exports a page to the Open Document format used by Open Office and other word processors author : Andreas Gohr, Aurélien Bompard email : andi@splitbrain.org, aurelien@bompard.org type : render, syntax lastupdate : 2008-05-05 compatible : 2007-06-26 and later depends : conflicts : similar : tags : export, odt, openoffice, word, opendocument, pdf ---- This plugin allows you to export a page to the [[wp>OpenDocument]] format used by [[http://www.openoffice.org|Open Office]] and other word processors. This is especially useful when you need to print or to give a single page to a customer (Hint: Open Office can also export to PDF). This plugin was initially developed by [[andi@splitbrain.org|Andreas Gohr]], and is now maintained by [[http://aurelien.bompard.org|Aurelien Bompard]]. Feel free to contact me by mail if you have questions, since I'm not monitoring this page. ===== Download ===== * [[http://gauret.free.fr/fichiers/dokuwiki/dokuwiki-odt-20080507.tgz|dokuwiki-odt-20080507.tgz]] -- Spanish translation * [[http://gauret.free.fr/fichiers/dokuwiki/dokuwiki-odt-20080505.tgz|dokuwiki-odt-20080505.tgz]] -- support for Dokuwiki 2008-05-05 * [[http://gauret.free.fr/fichiers/dokuwiki/dokuwiki-odt-20080408.tgz|dokuwiki-odt-20080408.tgz]] -- template support (and a few fixes) * {{:plugin:odt-plugin-2008-02-19.tgz}} -- some style fixes * {{plugin:odt-plugin-2007-10-26.tgz}} -- initial upload Alternatively get the plugin through [[wp>git (software)|Git]] with this command: "''git clone http://aurelien.bompard.org/projects/dokuwiki/odt.git''". This plugin works with Dokuwiki 2007-06-26 and later. ===== Usage ===== To make a single page exportable you can add the following macro to the page: ~~ODT~~ A better way is to integrate an export button into your [[:Template|template]]. Use the following to add another button in the upper or bottom button row of the default template((In ''/lib/tpl/default/main.php'', there are two divs that contain some buttons: ''
'' and ''
''. Just insert the html code inside one of the two divs (left or right) ))
Or use this for a simple 16x16 icon somewhere in your template: ODT Export ===== Customizing ===== There are three ways of customizing how the output will look like : * Modify the export of the [[syntax]] page. Then open the result with a ZIP-Archive tool and replace the provided styles.xml with the one from your document. * Use the OpenOffice feature to load the styles from an existing file or template : * export your page in ODT, and open it in OpenOffice, * bring up the styles panel (F11), * click on the top-right icon, * choose "Load styles..." in the menu, * select all the checkboxes on the bottom (**including** "overwrite"), * click "From file..." on the bottom right and select your customized file, or select an existing template in the list. * Use a pre-made template, see the following section for details on this (new) feature. ==== Templates support ==== You may use templates to export your document. A template is a regular ODT file, as produced by OpenOffice (for example, not tested with other ODT-supporting applications). In your wiki page, add the following code: {{odt>template:your template file name.odt}} and upload your template to the wiki using the media manager. By defaut, you must put it in an '':odt'' namespace (Meaning an "odt" directory right below the root in your wiki). The folder name can be configured using the admin page. The exported page will be added after the content of your template. If you include the string ''DOKUWIKI-ODT-INSERT'' in the template, the wiki page will be inserted there (replacing the string). :!: Warning : the ''DOKUWIKI-ODT-INSERT'' string **must not** be formatted in any way. To do that, select the line with this string, go to the "Format" menu, and click on the "Default Format" option (the first one). ===== Other plugins ===== If you use other syntax plugins, their output may not appear in the exported ODT document: those plugins must be modified to support the ODT output format. However, some plugins already support it. ==== User-defined fields support ==== Together with the [[plugin:fields|fields plugin]], you can store data in user-defined fields in your page, and recall this data from anywhere in your document (even in the headers and footers). See the [[plugin:fields|fields plugin documentation page]] for more information. In OpenOffice, user-defined fields are accessible using the Insert menu -> Field -> Other, "Variables" tab, and "User fields" section on the left. This is very useful for document references, project names, etc. ==== Notes ==== The nice-looking notes provided by the [[plugin:note|note]] plugin are exported to ODT. You need at least version 2008-02-17 of the note plugin for ODT support. ==== Include ==== The [[plugin:include|include]] plugin will let you generate a single ODT file from multiple wiki pages, just like for XHTML. Support for the ODT format will be [[http://bugs.chimeric.de/index.php?do=details&task_id=2|included in the next release]], which should be imminient. In the meantime, you can use [[http://gauret.free.fr/fichiers/dokuwiki/dokuwiki-include-odt.patch|this patch]]. ==== Math2 ==== The [[plugin:math2|math2]] plugin will let you insert mathematical formulae in a wiki page. Support for the ODT format which should be [[plugin:math2#discussion|imminent]]. In the meantime, you can apply [[plugin:math2#odt|this code]]. ==== Chem ==== The [[plugin:chem]] plugin formats a molecular formula by using %%%% tag. The latest version supports to export ODT format. ===== Translations ===== The plugin is translated into English, German, French and Italian. Thanks a lot to the translators, new languages are very welcome ! ===== Bugs ===== Hi ! Thank for this tremendous plug-in :-) i'm trying to use the {odt>template:file.odt} syntax. Le plugin finds the template file but i get the following error Fatal error: Cannot instantiate non-existent class: directoryiterator in /some/path/dokuwiki/inc/ZipLib.class.php on line 67 any idea ? --- //daamien// Are you using PHP4 ? This feature in the plugin requires at least PHP5. --- //[[aurelien@bompard.org|Aurélien Bompard]] 2008/08/07 22:18// ===== Discussion ===== It is possible to IMPORT odt back into Dokuwiki? Yes, have a look on http://www.linux.com/articles/41545 --- // OOo User 2008-02-19 09:52// Though, it looks like the latest version of writertools for OOo has removed dokuwiki conversion. Will someone write a short example how to integrate export button into template? I tried to do it myself, but CSS, PHP, HTML are unfamilar for me. Template consist of 9 files of different types. Which file should be modified? Thanks. --- //[[publicmail@mail.ru|Alexander]] 2008-02-29 17:57// > In ''/lib/tpl/default/main.php'', there are two divs that contain some buttons: ''
'' and ''
''. Just insert the html code provided in this page once and inside one of the two divs (left or right). If it doesn't please you, try another place. > Now it is wise not to edit this default template file but proceed as stated on [[:devel:templates|this page]]. > --- //[[christophegragnic@yahoo.fr|Grahack]] 2008-03-02 10:02// In a Dokuwiki-installation version 2008-05-05 I encounter following small problem: If dokuwiki creates from combined characters some extended html characters (e.g. ->, --, ---, <-), my OpenOffice 2.3 reports "format error discovered in the file in sub-document content.xml at 65,0 (row,col)". If such characters are not in the text, no problem (beside this small problem, a really nice plugin) while updating, I didn't update entities.conf ... with utf8 thingies instead of html-entities it does works :-) ---//[[http://www.unixwitch.de|Hella]] 2008-05-20 00:32// I've got odt working, but it won't export pages included using plugin:include. I've just downloaded include, and it seems to have the patch already applied. Is there something else I need to do? Thanks! ---//Chris 2008-05-28 17:10// > There's just been discovered something else missing in the include plugin in order to get it work with the odt plugin. We're impleting it soonish (1-2 days) - I'll leave a note here once it's done! --- //[[chi@chimeric.de|Michael Klier]] 2008/05/28 23:43// >> I don`t want to be pressing or anything, but is there any update on the include plugin? -- Dolphin > Scheduled on my TODO list for this weekend ;-) (promised + sorry for the delay). --- //[[chi@chimeric.de|Michael Klier]] 2008/06/13 10:40// > Done! You can fetch the plugin from the download link at [[plugin:include]]. --- //[[chi@chimeric.de|Michael Klier]] 2008/06/15 16:16// > Downloaded and working! Thanks a lot for your effort -- Dolphin >> Is there a way to properly export pages using plugin:source? ---//[[sylvain.bonneau@c-s.fr|Sylvain Bonneau]] 2008/05/30// >> >> I will probably be able to tweak the [[plugin:source]] plugin to work with the ODT format, however I don't think I'll be able to make the syntax highlighting work. The file will be included verbatim, in a "Preformatted" block. Is that OK with you ? Feel free to email me, I don't monitor this page (hell, we're coworkers !!! :) ) --- //[[aurelien@bompard.org|Aurélien Bompard]] 2008/08/07 22:21// Great work on this plugin. I can't seem to get it to save the formatting from the wiki, ie bold, italic, headings... Is there something I need to do in my template to get it to do that? Also how can I get the page title to be included in the template, not just as the name of the file ? ---//[[sean.escriva@gmail.com|SME]] 2008/06/03// Thanks for the plugin - has anyone been able to get it to export with an OTT template, not just using particular styles or a style set? --kathryn Thanks for this plugin! Downloaded, added the button in ACH template and works :-) -- at least now, and I'm not using the template feature yet ;-) --- //[[werner.flamme@ufz.de|Werner Flamme]] 2008/09/04 21:29 CEST// I can't open the result of the export. Both OpenOffice and StarOffice report, that the file is corrupted. Afer repairing them, they are empty. Any suggestions? Stephan Lamprecht >>Thanks for the GREAT plugin. works out of the box in no time! Is there any means of specifying the template in the link rather than the wiki code? I'd prefer a single modification to my template, like >> rather than having to put the required line in all pages... and having users messing with it. ---//[[berteh@hotmail.com|Berteh]] 2008/10/22// >> >for now I hacked the plugin to add a "template" option in config: > >add to odt/conf/default.php $conf['tpl_template'] = 'my_custom_template.odt'; //comment this line to not use any template add to odt/conf/metadata.php $meta['tpl_template'] = array('string'); edit function document_end() in odt/renderer.php: (line 250) function document_end(){ + if (!$this->template) { // if no template chosen in current page, get default template from config + $this->template=$this->getConf("tpl_template"); + } + if ($this->template) { // template chosen hope this helps, feel free to correct this code if you spot errors. ---//[[berteh@hotmail.com|Berteh]] 2008/10/22// --- //[[penn.shadow@gmail.com|Penn]] 2008-02-29 17:57// Odf2txt fails to recognize file generated by the plugin: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=501457 //unknown// The plugin works nice. :-) I have a minor issue with the tables: It would be nice to have the style set correctly: * "Table Heading" for table heads * "Table Content" for anything else so I can configure the style in my ODT template and have the export look right without manual changes. //Tux 2008-11-03 04:46//