Format conversion: Difference between revisions
moves pandoc to the top of the list |
m Text replacement - "<(\/?)source" to "<$1syntaxhighlight" Tags: Mobile edit Mobile web edit |
||
| Line 17: | Line 17: | ||
Basically following the information at http://www.xml.com/lpt/a/1638, create a local macro, and run it from the command line: | Basically following the information at http://www.xml.com/lpt/a/1638, create a local macro, and run it from the command line: | ||
< | <syntaxhighlight lang="bash"> | ||
ooffice2 -invisible "macro:///Standard.MyConverters.SaveAsOOO(/home/greg/projects/slides/executive.ppt)" | ooffice2 -invisible "macro:///Standard.MyConverters.SaveAsOOO(/home/greg/projects/slides/executive.ppt)" | ||
</ | </syntaxhighlight> | ||
(Note that OOO is just shorthand for OpenOffice.Org) | (Note that OOO is just shorthand for OpenOffice.Org) | ||
But, that process failed to create a good document.... When I tried to open the document, OpenOffice hung. After killing OO, and restarting it, OO would try to recover the document, but it would fail to bring up the document after the recovery. Searching the web, it turns out that exporting the following System variable will heal Impress (the snippet below will add it to your current environment and also your bash configuration file for future logins) | But, that process failed to create a good document.... When I tried to open the document, OpenOffice hung. After killing OO, and restarting it, OO would try to recover the document, but it would fail to bring up the document after the recovery. Searching the web, it turns out that exporting the following System variable will heal Impress (the snippet below will add it to your current environment and also your bash configuration file for future logins) | ||
< | <syntaxhighlight lang="bash"> | ||
echo 'export MALLOC_CHECK_=2' >> ~/.bashrc && source ~/.bashrc | echo 'export MALLOC_CHECK_=2' >> ~/.bashrc && source ~/.bashrc | ||
</ | </syntaxhighlight> | ||
The following bash script will do a batch interactive conversion of any given directory, finding all Microsoft PowerPoint, Doc and Excel files. | The following bash script will do a batch interactive conversion of any given directory, finding all Microsoft PowerPoint, Doc and Excel files. | ||
< | <syntaxhighlight lang="bash"> | ||
#!/bin/bash | #!/bin/bash | ||
| Line 66: | Line 66: | ||
exit 0 | exit 0 | ||
</ | </syntaxhighlight> | ||
I do believe the converter will work in tandem with a PHP script that I'm developing, even if there is no guarantee that the resulting file will be usable or faithful to the original. In order to get the PHP script to work you need to daemonize OpenOffice, which means that you have to give it a virtual frame buffer. Additionally you need to have the python interpreter installed and the python UNO bridge | I do believe the converter will work in tandem with a PHP script that I'm developing, even if there is no guarantee that the resulting file will be usable or faithful to the original. In order to get the PHP script to work you need to daemonize OpenOffice, which means that you have to give it a virtual frame buffer. Additionally you need to have the python interpreter installed and the python UNO bridge | ||
< | <syntaxhighlight lang="bash"> | ||
sudo apt-get update && sudo apt-get install xvfb python python-uno | sudo apt-get update && sudo apt-get install xvfb python python-uno | ||
</ | </syntaxhighlight> | ||
| Line 86: | Line 86: | ||
To convert an HTML document to MediaWiki syntax, you can simply issue a command like | To convert an HTML document to MediaWiki syntax, you can simply issue a command like | ||
< | <syntaxhighlight lang="bash"> | ||
pandoc --from html --to mediawiki foo.html --output foo.wiki.txt | pandoc --from html --to mediawiki foo.html --output foo.wiki.txt | ||
</ | </syntaxhighlight> | ||
=== Wiki To PDF === | === Wiki To PDF === | ||