pax_global_header00006660000000000000000000000064125473332500014516gustar00rootroot0000000000000052 comment=b02c77cc669715858a2e6a658cb1988e5e89cf3b unoconv-0.7/000077500000000000000000000000001254733325000130535ustar00rootroot00000000000000unoconv-0.7/AUTHORS000066400000000000000000000000341254733325000141200ustar00rootroot00000000000000Dag Wieers unoconv-0.7/CHANGELOG.md000066400000000000000000000234631254733325000146740ustar00rootroot00000000000000# Change Log ## [Unreleased](https://github.com/dagwieers/unoconv/tree/HEAD) [Full Changelog](https://github.com/dagwieers/unoconv/compare/0.6...HEAD) **Implemented enhancements:** - python3 compatibility [\#107](https://github.com/dagwieers/unoconv/issues/107) - Preserve the original timestamp, ownership and permissions [\#31](https://github.com/dagwieers/unoconv/issues/31) **Fixed bugs:** - On Mac OSX + LibreOffice 4.3 Not working [\#221](https://github.com/dagwieers/unoconv/issues/221) - dyld: Library not loaded: /usr/local/libodep/lib/libintl.8.dylib [\#128](https://github.com/dagwieers/unoconv/issues/128) - unoconv: option --export must not have an argument [\#93](https://github.com/dagwieers/unoconv/issues/93) - Configuration of LibreOffice is changed [\#15](https://github.com/dagwieers/unoconv/issues/15) **Closed issues:** - unoconv: Cannot find a suitable office installation on your system. [\#236](https://github.com/dagwieers/unoconv/issues/236) - Libreoffice GraphicImport error [\#234](https://github.com/dagwieers/unoconv/issues/234) - display\(\) method used by --show should not output to stderr [\#223](https://github.com/dagwieers/unoconv/issues/223) - not generating content [\#217](https://github.com/dagwieers/unoconv/issues/217) - UNO IllegalArgument during import phase: Source file cannot be read. Unsupported URL [\#215](https://github.com/dagwieers/unoconv/issues/215) - can't find libreoffice 4.2.2.1 [\#195](https://github.com/dagwieers/unoconv/issues/195) - unoconv doesn't ouput UTF-8 text files on windows. [\#185](https://github.com/dagwieers/unoconv/issues/185) - --version [\#183](https://github.com/dagwieers/unoconv/issues/183) - uno bridge removed on ubuntu 13.10 [\#182](https://github.com/dagwieers/unoconv/issues/182) - Cannot Install in centos 6.5 [\#178](https://github.com/dagwieers/unoconv/issues/178) - My unoconv works perfectly in terminal using www-data, but no pdf file when executed through php [\#139](https://github.com/dagwieers/unoconv/issues/139) - weirdly quoted output [\#135](https://github.com/dagwieers/unoconv/issues/135) - please add LICENSE file [\#105](https://github.com/dagwieers/unoconv/issues/105) **Merged pull requests:** - Add a extra search path on MacOS X for OpenOffice [\#250](https://github.com/dagwieers/unoconv/pull/250) ([vittala](https://github.com/vittala)) - document --version option in help output [\#200](https://github.com/dagwieers/unoconv/pull/200) ([mmariani](https://github.com/mmariani)) - Add -F|--field to update user-defined fields before exporting document [\#193](https://github.com/dagwieers/unoconv/pull/193) ([raphink](https://github.com/raphink)) - Preserve timestamps and permissions [\#179](https://github.com/dagwieers/unoconv/pull/179) ([vincentbernat](https://github.com/vincentbernat)) - Resolves: fdo\#70309 can't write bytes direct to stdout in python3 [\#170](https://github.com/dagwieers/unoconv/pull/170) ([caolanm](https://github.com/caolanm)) - add Microsoft Works \(.wps\) import filter [\#159](https://github.com/dagwieers/unoconv/pull/159) ([josiasmontag](https://github.com/josiasmontag)) - Find LibreOffice 4.1 on MacOSX [\#154](https://github.com/dagwieers/unoconv/pull/154) ([zopyx](https://github.com/zopyx)) - set format based on extension [\#151](https://github.com/dagwieers/unoconv/pull/151) ([urg](https://github.com/urg)) - make sure LOdev gets new param styles [\#144](https://github.com/dagwieers/unoconv/pull/144) ([clkao](https://github.com/clkao)) - Update README.asciidoc [\#140](https://github.com/dagwieers/unoconv/pull/140) ([simkimsia](https://github.com/simkimsia)) - \#133 fix export to non existent directory [\#134](https://github.com/dagwieers/unoconv/pull/134) ([gazofnaz](https://github.com/gazofnaz)) - Add XLSX support [\#131](https://github.com/dagwieers/unoconv/pull/131) ([josiasmontag](https://github.com/josiasmontag)) - Third attempt to make pull request for fixing issue \#120 [\#127](https://github.com/dagwieers/unoconv/pull/127) ([peterdemin](https://github.com/peterdemin)) - Fix documentation typos [\#117](https://github.com/dagwieers/unoconv/pull/117) ([ojwb](https://github.com/ojwb)) - Add python 3 support [\#111](https://github.com/dagwieers/unoconv/pull/111) ([xrmx](https://github.com/xrmx)) ## [0.6](https://github.com/dagwieers/unoconv/tree/0.6) (2012-09-10) [Full Changelog](https://github.com/dagwieers/unoconv/compare/0.5...0.6) **Implemented enhancements:** - unoconv --version fails to display revision number [\#82](https://github.com/dagwieers/unoconv/issues/82) - Issue with named ubuntu server and office listener. [\#80](https://github.com/dagwieers/unoconv/issues/80) **Fixed bugs:** - Permission in unoconv aren't applied to PDF [\#75](https://github.com/dagwieers/unoconv/issues/75) - Improve 'make install' under MacOS X [\#63](https://github.com/dagwieers/unoconv/issues/63) - Starting listener fails with "No Info.plist file in application bundle or no NSPrincipalClass in the Info.plist file" [\#60](https://github.com/dagwieers/unoconv/issues/60) - selinux.txt not a valid asciidoc document [\#53](https://github.com/dagwieers/unoconv/issues/53) - Installation under Windows? "Cannot find a suitable office installation" [\#52](https://github.com/dagwieers/unoconv/issues/52) - Unoconv version check is incorrect, fails on older LibreOffice [\#50](https://github.com/dagwieers/unoconv/issues/50) - Not working on Mac [\#27](https://github.com/dagwieers/unoconv/issues/27) **Closed issues:** - r [\#76](https://github.com/dagwieers/unoconv/issues/76) **Merged pull requests:** - added explicit check in Listener\(\) if soffice is already running on given \(host, port\) [\#74](https://github.com/dagwieers/unoconv/pull/74) ([vpa](https://github.com/vpa)) - Python path variable using env [\#72](https://github.com/dagwieers/unoconv/pull/72) ([petross](https://github.com/petross)) - Endless recursion fix for windows... [\#71](https://github.com/dagwieers/unoconv/pull/71) ([vpa](https://github.com/vpa)) - Random seg.faults in unoconv [\#67](https://github.com/dagwieers/unoconv/pull/67) ([vpa](https://github.com/vpa)) ## [0.5](https://github.com/dagwieers/unoconv/tree/0.5) (2012-04-16) [Full Changelog](https://github.com/dagwieers/unoconv/compare/0.4...0.5) **Implemented enhancements:** - Missing DocTypes?! [\#36](https://github.com/dagwieers/unoconv/issues/36) - Convert after launching listener [\#30](https://github.com/dagwieers/unoconv/issues/30) - Close after launching listener [\#29](https://github.com/dagwieers/unoconv/issues/29) - Deprecated command [\#14](https://github.com/dagwieers/unoconv/issues/14) - extrapath for LO on OpenBSD [\#8](https://github.com/dagwieers/unoconv/issues/8) **Fixed bugs:** - pyuno.so location not inserted into sys.path on Gentoo [\#46](https://github.com/dagwieers/unoconv/issues/46) - unoconv doesn't work anymore on Fedora 17 [\#45](https://github.com/dagwieers/unoconv/issues/45) - Launching with single/double hyphen [\#28](https://github.com/dagwieers/unoconv/issues/28) - LibreOffice 3.5.0 crashes when using python UNO [\#26](https://github.com/dagwieers/unoconv/issues/26) - uno.RuntimeException: URP-Bridge: disposed\(tid=3\) Unexpected connection closure [\#22](https://github.com/dagwieers/unoconv/issues/22) - Exception if file doesn't exist [\#17](https://github.com/dagwieers/unoconv/issues/17) - com.sun.star.beans.PropertyValue may not yet been imported when Options initializing [\#16](https://github.com/dagwieers/unoconv/issues/16) - unoconv: Cannot find the pyuno library in sys.path and known paths. [\#4](https://github.com/dagwieers/unoconv/issues/4) - unoconv: UnoException during conversion [\#3](https://github.com/dagwieers/unoconv/issues/3) **Closed issues:** - Unable to run unoconv from PHP [\#42](https://github.com/dagwieers/unoconv/issues/42) - Change/force the document encoding during conversion \(UTF-8\) [\#33](https://github.com/dagwieers/unoconv/issues/33) - SElinux Problems When Running Indirectly [\#19](https://github.com/dagwieers/unoconv/issues/19) - JPEG export filter seems to have a size limit [\#13](https://github.com/dagwieers/unoconv/issues/13) - LibreOffice should use SVG natively [\#11](https://github.com/dagwieers/unoconv/issues/11) - unoconv needs 2 times to connect to LibreOffice [\#7](https://github.com/dagwieers/unoconv/issues/7) - Support for .docx conversion [\#1](https://github.com/dagwieers/unoconv/issues/1) **Merged pull requests:** - Fix a typo in unoconv manual page. [\#41](https://github.com/dagwieers/unoconv/pull/41) ([vincentbernat](https://github.com/vincentbernat)) - Daemon [\#38](https://github.com/dagwieers/unoconv/pull/38) ([lars-sh](https://github.com/lars-sh)) - SElinux Problems When Running Indirectly [\#21](https://github.com/dagwieers/unoconv/pull/21) ([dks](https://github.com/dks)) - int values in export filters [\#9](https://github.com/dagwieers/unoconv/pull/9) ([damycra](https://github.com/damycra)) - Option --no-launch [\#6](https://github.com/dagwieers/unoconv/pull/6) ([eagleas](https://github.com/eagleas)) - Add extrapath for official rpm [\#5](https://github.com/dagwieers/unoconv/pull/5) ([eagleas](https://github.com/eagleas)) - Add support for libreoffice [\#2](https://github.com/dagwieers/unoconv/pull/2) ([graaff](https://github.com/graaff)) ## [0.4](https://github.com/dagwieers/unoconv/tree/0.4) (2010-10-20) [Full Changelog](https://github.com/dagwieers/unoconv/compare/0.3...0.4) ## [0.3](https://github.com/dagwieers/unoconv/tree/0.3) (2007-09-01) [Full Changelog](https://github.com/dagwieers/unoconv/compare/0.2...0.3) ## [0.2](https://github.com/dagwieers/unoconv/tree/0.2) (2007-05-20) [Full Changelog](https://github.com/dagwieers/unoconv/compare/0.1...0.2) ## [0.1](https://github.com/dagwieers/unoconv/tree/0.1) (2007-05-19) \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*unoconv-0.7/COPYING000066400000000000000000000431101254733325000141050ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. unoconv-0.7/ChangeLog000066400000000000000000000134601254733325000146310ustar00rootroot00000000000000* 0.7 - released 2015-07-09 - Ported to Python 3 (Riccardo Magliocchetti) - Update Indexes (eg. TOC) during conversion (Peter Demin) - Added XLSX support (Josias Montag) - Fix output to non-existing directory - Ensure that LibreOfficeDev release are using new long options (Chia-liang Kao) - Set output format based on output filename extension (Patrick McAndrew) - Accept 'office' as binary on MacOSX (Andreas Jung) - Added Microsoft WPS import filter (Josias Montag) - Fix --stdout output on Python 3 (Caolán McNamara) - Added -F/--field option to update user fields during conversion (Raphaël Pinson) - Added OpenOffice search path on MacOSX (Vittal Aithal) - Cycle through all images references before conversion - Added --preserve option to preserve timestamp and permissions (Vincent Bernat) - Added --stdin option to read from standard input - Accept remote URLs as input filename - Fix exit code 81 and recover from initial failure (Daniel Vandersluis) - Improve documentation related to error codes and using unoconv with Nginx/Apache/PHP * 0.6 - released 2012-09-10 - Implement debugging output (-vvv) - Fixes to office comparison - Documentation improvements - Improvements to Windows support (Volker Paulsen) - Improvements to MacOSX support (Scott Prahl) - Improvements to FreeBSD support (Peter) - Fix for random segfaults with OpenOffice/LibreOffice (Volker Paulsen) - Reliability check for unoconv listener (Volker Paulsen) - Fix Text Encoded filter definition (Samuele Kaplun) - Improve code quality according to pylint (Samuele Kaplun) - Fix for export plugin options (-e) - Change to how import plugin options (-i) work (incompatible change) - Use 127.0.0.1 instead of localhost to avoid potential resolver problems (Maik Penz) * 0.5 - released 2012-04-16 - Improve handling of LD_LIBRARY_PATH (Paul Polak) - Change to how -o/--output/--outputpath works (can now output to filenames too) - Added LibreOffice support (Hans de Graaff) - Replaced OpenOffice by LibreOffice in source code and documentation - Automatically look for installed LibreOffice and OpenOffice binaries/libraries - Switch to LibreOffice python binary to load matching pyuno library - Show Office location when using -v -v - Fix a problem when not using UNO_PATH and LibreOffice (Daniel Díaz) - Improvements to Windows support (Miklos Vajna) - Improvements to MacOS X support (Troels Knak-Nielsen) - Improvements to OpenBSD support - Improvements to Gentoo support (David E. Narváez) - Added -n/--no-launch option to prevent lanuching new office instance (Alexander Oryol) - Fix for LibreOffice double-hyphen options since LibreOffice >= 3.4 (Lars Knickrehm) - Deal with integer values in export filters (Steven Davidson) * 0.4 - released 2010-10-20 - Now properly check if there is a GUI attached and terminate() or -unaccept instance - Added official OpenOffice path '/opt/openoffice*/program' - Added support for OpenOffice on Windows (*redacted*) - Added --pipe option to communicate with UNO pipe (*redacted*) - Added -o/--outputpath option to modify the output path (*redacted*) - Added support for MediaWiki output (txt) - Added OpenOffice path to LD_LIBRARY_PATH env var - Added -nofirstwizard to ooffice invocations - Improved the unoconv manpage - Added proper exitcode (Alan D. Salewski) - Fixed the license conflict between COPYING and header, the license is GPL, not LGPL - Give a proper error when a library was found, but failed to get imported - Make errors somewhat more identifiable - Added -T/--timeout to try to connect every 0.5 second until timeout has reached default: 3 secs) - Fixed a typo in bydoctype() (Hugo Lopes) - Updated filter list based on OpenOffice 3.1 - Added Unified Office Format (uot/uos/uop) support - Update indexes when converting (Winfried Rohr) - Find soffice.bin binary (once) similarly to finding uno library - Use soffice.bin binary instead of soffice wrapper so we can more reliable terminate the process - Added -e/--export to set export filter options (eg. PageRange, Quality, UseLosslessCompression, ...) - Added -i/--import to set import filter options (eg. utf8) - Use subprocess module instead of os.spawnvp for better Windows compatibility - Added docs/filters.txt with information about import and export filters - Added official OpenOffice path for MacOSX (Jeff Harmon) - First update links, then indexes (Nicolae Mihalache) - More improvements to OpenOffice support on Windows (*redacted*) - Improve terminating OpenOffice on Windows (*redacted*) - Support OpenOffice installations on Windows on drive-letters other than C: (*redacted*) - Allow to apply a style template during conversion - Improvements to stdout and stderr messages consistency - Updated documentation * 0.3 - released 2007-08-31 - Determine doctype from input filename (if not specified) - Created a seperate class and allow to use as a library (like DocumentConverter.py) - Makefile now adds symlinks for different ODF formats like eg, odt2pdf or odp2pdf - Added MacOSX NeoOffice path '/Applications/NeoOffice.app/Contents/program' (Peter Stevens) - Added OpenSUSE 10 OpenOffice path '/usr/lib*/ooo*/program' (Leo Eraly) - Start and stop OpenOffice automatically when needed (Matthieu Moy) - Added --listener option to make OpenOffice accept client requests (Matthieu Moy) - Changed -b option to -f option to match a2x options - Add unoconv manual page * 0.2 - released 2007-05-20 - Added support for almost 100 graphics, presentation and spreadsheet documents - Added -d/--doctype option to specify the document type - Added -v/--verbose to show more information - Added Gentoo oofice path '/usr/lib/openoffice/program' (Peter Draho) - Show proper error when file does not exist (Peter Draho) - Make long options work :) - If format is not recognized, scan by extension - Use glob to find possible location of pyuno - Option -d/--doctype now affects -l/--list * 0.1 - released 2007-05-19 - Initial release unoconv-0.7/Makefile000066400000000000000000000074271254733325000145250ustar00rootroot00000000000000# In some dists (e.g. Ubuntu) bash is not the default shell. Statements like· # # cp -a etc/rear/{mappings,templates} ... # # assumes bash. So its better to set SHELL # SHELL=/bin/bash DESTDIR = OFFICIAL = name = unoconv version := $(shell awk "/^__version__ *= */ { gsub(/^__version__[ ]*=[ ']*|[ ']*$$/,\"\"); print}" $(name)) ### Get the branch information from git git_date := $(shell git log -n 1 --format="%ai") git_ref := $(shell git symbolic-ref -q HEAD) git_branch ?= $(lastword $(subst /, ,$(git_ref))) git_branch ?= HEAD #date := $(shell date --date="$(git_date)" +%Y%m%d%H%M) #release_date := $(shell date --date="$(git_date)" +%Y-%m-%d) date := $(shell echo "$(git_date)" | sed -e 's/[-: ]//g' | cut -c1-12) release_date := $(shell echo "$(git_date)" | cut -c1-10 ) prefix = /usr sysconfdir = /etc bindir = $(prefix)/bin sbindir = $(prefix)/sbin libdir = $(prefix)/lib datadir = $(prefix)/share mandir = $(datadir)/man localstatedir = /var specfile = packaging/rpm/$(name).spec distversion = $(version) debrelease = 0 rpmrelease = %nil ifeq ($(OFFICIAL),) distversion = $(version)-git$(date) debrelease = 0git$(date) rpmrelease = .git$(date) endif .PHONY: all install doc clean to_doc = odt2doc ooxml2doc to_html = odt2html to_odp = ppt2odp to_ods = xls2ods to_odt = doc2odt sdw2odt sxw2odt ooxml2odt to_pdf = doc2pdf odp2pdf ods2pdf odt2pdf ooxml2pdf to_ppt = odp2ppt to_other = odt2rtf odt2txt odt2xhtml odt2xml odt2bib odt2docbook odt2lt odt2sdw odt2sxw links = $(to_doc) $(to_html) $(to_odp) $(to_ods) $(to_odt) $(to_pdf) $(to_ppt) $(to_other) all: doc @echo "__version__ = $(version)" @echo "There is nothing to be build. Try install !" help: @echo -e "unoconv make targets:\n\ \n\ install - Install unoconv (may replace files)\n\ dist - Create tar file\n\ rpm - Create RPM package\n\ \n\ unoconv make variables (optional):\n\ \n\ DESTDIR= - Location to install to\n\ OFFICIAL= - Build an official release\n\ " man: @echo -e "\033[1m== Prepare manual ==\033[0;0m" $(MAKE) -C doc man doc: @echo -e "\033[1m== Prepare documentation ==\033[0;0m" $(MAKE) -C doc docs ifneq ($(git_date),) rewrite: @echo -e "\033[1m== Rewriting $(specfile) ==\033[0;0m" sed -i.orig \ -e 's#^Source:.*#Source: $(name)-$(distversion).tar.gz#' \ -e 's#^Version:.*#Version: $(version)#' \ -e 's#^%define rpmrelease.*#%define rpmrelease $(rpmrelease)#' \ -e 's#^%setup.*#%setup -q -n $(name)-$(distversion)#' \ $(specfile) # sed -i.orig \ -e 's#^Version:.*#Version: $(version)-$(debrelease)#' \ $(dscfile) restore: @echo -e "\033[1m== Restoring $(specfile) and $(rearbin) ==\033[0;0m" mv -f $(specfile).orig $(specfile) else rewrite: @echo "Nothing to do." restore: @echo "Nothing to do." endif doc-install: $(MAKE) -C doc install install: install -d -m0755 $(DESTDIR)$(bindir) install -d -m0755 $(DESTDIR)$(mandir)/man1/ install -p -m0755 unoconv $(DESTDIR)$(bindir)/unoconv install -p -m0644 doc/unoconv.1 $(DESTDIR)$(mandir)/man1/unoconv.1 install-links: $(links) $(filter %,$(links)): ln -sf unoconv $(DESTDIR)$(bindir)/$@ ### Remove odp because size > 300kB dist: clean man rewrite $(name)-$(distversion).tar.gz restore $(name)-$(distversion).tar.gz: @echo -e "\033[1m== Building archive $(name)-$(distversion) ==\033[0;0m" git checkout $(git_branch) git ls-tree -r --name-only --full-tree $(git_branch) | \ tar -czf $(name)-$(distversion).tar.gz --transform='s,^,$(name)-$(distversion)/,S' --files-from=- rpm: dist @echo -e "\033[1m== Building RPM package $(name)-$(distversion) ==\033[0;0m" rpmbuild -tb --clean \ --define "_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" \ --define "debug_package %{nil}" \ --define "_rpmdir %(pwd)" $(name)-$(distversion).tar.gz clean: rm -f README*.html make -C tests clean unoconv-0.7/README.adoc000066400000000000000000000247121254733325000146460ustar00rootroot00000000000000= Automated conversion and styling using LibreOffice Dag Wieers Universal Office Converter (unoconv) is a command line tool to convert any document format that LibreOffice can import to any document format that LibreOffice can export. It makes use of the LibreOffice's UNO bindings for non-interactive conversion of documents. _For practical reasons we mention LibreOffice, but OpenOffice is supported by unoconv as well._ == Installing unoconv unoconv can be installed using packages coming from your distribution, or simply by copying the unoconv python script to your system. If you installed unoconv by hand, make sure you have the required LibreOffice or OpenOffice packages installed. A hard requirement is the UNO python bindings which are often inside a subpackage named +libreoffice-pyuno+ or +libobasis4.4-pyuno+. Various sub-packages are needed for specific import or export filters, e.g. XML-based filters require the xsltfilter subpackage, e.g. +libobasis4.4-xsltfilter+. IMPORTANT: Neglecting these requirements will cause unoconv to fail with unhelpful and confusing error messages. == How does unoconv work ? unoconv starts its own office instance (if it cannot find an existing listener) that it then uses. There are some challenges to do this correctly, but in general this works fine. Typically you would convert an ODT document to PDF by running: unoconv -f pdf some-file.odt == Start your own unoconv listener However, you can always start an instance yourself at the default port 2002 (or specify another port with -p/--port) and after use you can tear it down: ---- unoconv --listener & sleep 20 unoconv -f pdf *.odt unoconv -f doc *.odt unoconv -f html *.odt kill -15 %- ---- It is also possible to use a listener or LibreOffice instance that accepts connections on another system and use it from unoconv remotely. This way the conversion tasks are performed on a dedicated system instead of on the client system. This works only if you have a shared filesystem mounted at the same location. == Python and pyuno incompatibilities Beware that the pyuno python module needs to be compiled with the exact same version of python that you are using to load it. A lot of people that run into problems loading pyuno are actually using a precompiled LibreOffice that they downloaded somewhere and is incompatible with the python version on their system. To solve this issue, the project's office suite ships with its own python interpreter located in the 'program' directory, this one should work flawlessly. The most recent unoconv works around this issue by automatically detecting incompatibilities, and restarting itself using a compatible python (the same one that ships with LibreOffice). You can influence the automatic detection by setting the +UNO_PATH+ environment variable to point to an alternative LibreOffice installation, e.g.: UNO_PATH=/opt/libreoffice4.4 unoconv -f pdf some-file.odt But you can also force another python by using it to execute unoconv, e.g.: /opt/libreoffice4.4/program/python.bin unoconv -f pdf some-file.odt or on MacOS X: /Applications/LibreOffice.app/Contents/MacOS/python unoconv -f pdf some-file.odt or on Windows: C:\Program Files (x86)\LibreOffice 4.4\program\python.exe unoconv -f pdf some-file.odt TIP: If you plan to use unoconv extensively (or in an automated fashion) it is more efficient to use the correct python interpreter directly. Or event put it directly in the Shebang (the first line) of the unoconv script ! == Using unoconv with no X display Since OpenOffice 2.3 you do not need an X display for starting ooffice. However you may need the openoffice.org-headless package from your distribution. Since LibreOffice 2.4 nothing special is needed, running in headless mode does not require X. For any older OpenOffice releases, remember that ooffice requires an X display, even when using it in headless mode. One solution is to use Xvfb to create a headless X display for ooffice. - http://www.oooforum.org/forum/viewtopic.phtml?t=11890 - http://www.wonko.be/2008/01/09/running-openoffice-headless-on-debian - http://ward.vandewege.net/writings/200510auto_doc_conv/ - http://www.artofsolving.com/node/10 == Using unoconv with MacOS X LibreOffice 3.6.0.1 or later is required to use unoconv under MacOS X. This is the first version distributed with an internal python script that works. No version of OpenOffice for MacOS X (3.4 is the current version) works because the necessary internal files are not included inside the application. == Problems running unoconv from Nginx/Apache/PHP Some people have had difficulties using unoconv through webservices. Here is a list of probable causes and recommendations: - Use the latest version of unoconv (or GitHub master branch) - Use the most recent stable release of LibreOffice (less memory, more stable, fewer crashes) - Use the native LibreOffice python binary to run unoconv - Hardcode this native python path in the unoconv script shebang (or ensure PATH is set) - Ensure that the user running unoconv has write access to its HOME directory (ensure HOME is set) - Test with SELinux in permissive mode It is recomended to open the unoconv script and modify the very first line to point directly to your installed LibreOffice python binary, so replace this: #!/usr/bin/env python with something like this: #!/opt/libreoffice4.4/program/python == Conversion problems If you encounter problems converting files, it often helps to try again. If you are using a listener, restarting the listener may help as well. The reason for conversion failures are unclear, and they are not deterministic. unoconv is not the only project to have noticed problems with import and export filters using PyUNO. We assume these are related to internal state or timing issues that under certain conditions fail to correctly work. If you can reproduce the problem on a specific file, please take the time to open the file in LibreOffice directly and export it to the desired format. If this fails, it needs to be reported to the LibreOffice project directly. If that works, we need to know ! We are looking into this with the LibreOffice developers to: - Collaborate closer to find, report and fix unexpected failures - Allow end-users to increase debugging and improve reporting to the project == Troubleshooting instructions If you encounter a problem with converting documents using unoconv, please consider that this could be caused by a number of things: - incomplete LibreOffice installation - LibreOffice bug or regression specific to your version/distribution - LibreOffice import or export filter issue - problem related to stale lock files - problem related to the source document - problem related to permissions or SELinux - problem related to the python UNO bindings - problem related to the unoconv python script It is recommended to follow all of the below steps to pinpoint the problem: - if this is the first time you are using LibreOffice/OpenOffice, make sure you have all the required sub-packages installed, depending on the distribution this could be the +xsltfilter+, +headless+, +writer+, +calc+, +impress+ or +draw+ sub-packages. - check if there is no existing LibreOffice process running on the system that could interfere with proper functioning # pgrep -l 'office|writer|calc' - check that there are no stale lock files present, e.g. '.~lock.file.pdf#' or '.~lock.index.html#' - check that the LibreOffice instance handling UNO requests is not handling multiple requests at the same time - try using the latest unoconv release, or the latest version on Github at: https://github.com/dagwieers/unoconv/downloads - try the conversion by opening the file in LibreOffice and exporting it through LibreOffice directly - try unoconv with a different minor or major LibreOffice version to test whether it is a regression in LibreOffice - try to load the UNO bindings in python manually: * do this with the python executable that ships with the LibreOffice package/installer # /opt/libreoffice4.4/program/python.bin -c 'import uno, unohelper' * or alternatively, run the disribution python (with the distribution LibreOffice) # python -c 'import uno, unohelper' - try unoconv with a different python interpreter manually: # /opt/libreoffice4.4/program/python.bin unoconv -f pdf test-file.odt If you tried all of the above, and the issue still remains, the issue might still be related to import/export filters, LibreOffice or unoconv, so please report any information to reproduce the problem on the Github issue-tracker at: https://github.com/dagwieers/unoconv/issues And do mention that you already tried the above hints to troubleshoot the issue. == Interesting information If you're interested to help out with development, here are some pointers to interesting sources: - [Tutorial] Import uno module to a different Python install http://user.services.openoffice.org/en/forum/viewtopic.php?f=45&t=36370&p=166783 - UDK: UNO Development Kit http://udk.openoffice.org/ - Python-UNO bridge http://www.openoffice.org/udk/python/python-bridge.html - Python and OpenOffice.org http://wiki.services.openoffice.org/wiki/Python - OpenOffice.org developer manual http://api.openoffice.org/DevelopersGuide/DevelopersGuide.html - Framework/Article/Filter/FilterList OOo 2 1 http://wiki.services.openoffice.org/wiki/Framework/Article/Filter/FilterList_OOo_2_1 - Framework/Article/Filter/FilterList OOo 3 0 http://wiki.services.openoffice.org/wiki/Framework/Article/Filter/FilterList_OOo_3_0 == Other implementations Other implementations using python and UNO: - convwatch http://cgit.freedesktop.org/libreoffice/core/tree/bin/convwatch.py - oooconv https://svn.infrae.com/oooconv/trunk/src/oooconv/filters.py - officeshots.org http://code.officeshots.org/trac/officeshots/browser/trunk/factory/src/backends/oooserver.py - cloudooo http://svn.erp5.org/erp5/trunk/utils/cloudooo.handler/ooo/cloudooo/handler/ooo/ == Related tools Other tools that are useful or similar in operation: - Text based document generation: http://www.methods.co.nz/asciidoc/ - DocBook to OpenDocument XSLT: http://open.comsultia.com/docbook2odf/ - Simple (and stupid) converter from OpenDocument Text to plain text: http://stosberg.net/odt2txt/ - Another python tool to aid in converting files using UNO: http://www.artofsolving.com/files/DocumentConverter.py http://www.artofsolving.com/opensource/pyodconverter unoconv-0.7/doc/000077500000000000000000000000001254733325000136205ustar00rootroot00000000000000unoconv-0.7/doc/Makefile000066400000000000000000000007711254733325000152650ustar00rootroot00000000000000prefix = /usr datadir = $(prefix)/share mandir = $(datadir)/man adoctargets = $(shell echo *.adoc) htmltargets = $(patsubst %.adoc, %.html, $(adoctargets)) all: docs dist: docs man: unoconv.1 docs: unoconv.1 $(htmltargets) install: unoconv.1 install -Dp -m0644 unoconv.1 $(DESTDIR)$(mandir)/man1/unoconv.1 clean: rm -f unconv.1 *.html *.xml %.1.html: %.1.adoc asciidoc -d manpage $< %.1: %.1.xml xmlto man $< %.html: %.adoc asciidoc $< %.1.xml: %.1.adoc asciidoc -b docbook -d manpage $< unoconv-0.7/doc/errcode.adoc000066400000000000000000000041371254733325000161000ustar00rootroot00000000000000= LibreOffice error codes Since various people have reported issues using unoconv related to LibreOffice, it's clear we need to list the various errors and give some explanation. If you have more information to improve this document, let me know ! == How to decipher LibreOffice error codes Unfortunately the LibreOffice error codes is a combination of project area, error class and error code. The combination of these three provides some indication of what the cause is, although in most cases this is not conclusive. The authoritative source for ErrCodes are the following files: List of ErrCode classifications:: - http://docs.libreoffice.org/tools/html/errcode_8hxx_source.html List of other related ErrCode classifications:: - http://docs.libreoffice.org/svtools/html/sfxecode_8hxx.html - http://docs.libreoffice.org/svtools/html/soerr_8hxx.html ---- 01234567012345670123456701234567 || || ||| || | Warning || || | | || || || | Dynamic || || | | || || | Subsystemarea| || | | || | | || | | || | Class| | | | | | | | Code ---- == UnoException ErrCode === 283 Binary: 000:00001:00011011 Area: 0 (ERRCODE_AREA_TOOLS) Class: 1 (ERRCODE_CLASS_ABORT) Code: 27 (ERRCODE_IO_ABORT) === 1287 Binary: 000:00101:00000111 Area: 0 (ERRCODE_AREA_TOOLS) Class: 5 (ERRCODE_CLASS_ACCESS) Code: 7 (ERRCODE_IO_ACCESSDENIED) === 2074 Binary: 000:01000:00011010 Area: 0 (ERRCODE_AREA_TOOLS) Class: 8 (ERRCODE_CLASS_PARAMETER) Code: 26 (ERRCODE_IO_INVALIDPARAMETER) === 3088 Binary: 000:01100:00010000 Area: 0 (ERRCODE_AREA_TOOLS) Class: 12 (ERRCODE_CLASS_WRITE) Code: 16 (ERRCODE_IO_CANTWRITE) === 19468 -- ERRCODE_SFX_DOCUMENTREADONLY Binary: 010:01100:00001100 Area: 2 (ERRCODE_AREA_SFX) Class: 12 (ERRCODE_CLASS_WRITE) Code: 12 (ERRCODE_IO_NOTSUPPORTED) unoconv-0.7/doc/filters.adoc000066400000000000000000000226511254733325000161260ustar00rootroot00000000000000= Import and export filters == Import filter options See also: * http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Spreadsheets/Filter_Options[Spreadsheet filter options] == Generic export filter options [width="100%",cols="5,^2,^2,10",options="header"] |========================================================== |Option name |Type |Default |Description |Size | | | |========================================================== == PDF export filter options See also: * http://wiki.services.openoffice.org/wiki/API/Tutorials/PDF_export[API/Tutorials/PDF export] * http://specs.openoffice.org/appwide/pdf_export/PDFExportDialog.odt[PDF Export Dialog Specification] [width="100%",cols="5,^2,^2,10",options="header"] |========================================================== |Option name |Type |Default |Description |AllowDuplicateFieldNames |boolean|False |Specifies whether multiple form fields exported are allowed to have the same field name. Since: OOo 3.3 [DEV300_m65] (See http://www.openoffice.org/issues/show_bug.cgi?id=103932[i103932]) |CenterWindow |boolean|False |Specifies that the PDF viewer window is centered to the screen when the PDF document is opened. |Changes |integer|4 | *0*:Not permitted *1*:Inserting, deleting and rotating pages *2*:Filling in form fields *3*:Commenting, filling in form fields *4*:Any except extracting pages |ConvertOOoTargetToPDFTarget|boolean|False |Specifies that the target documents with .od[tpgs] extension, will have that extension changed to .pdf when the link is exported to PDF. The source document remains untouched. |DisplayPDFDocumentTitle |boolean|True |Specifies that the title of the document, if present in the document properties, is displayed in the PDF viewer window title bar. |DocumentOpenPassword |string | |This is the password that allows the user to open the PDF file is "EncryptFile" is set to true. |EnableCopyingOfContent |boolean|True |Specifies that the pages and the document content can be extracted to be used in other documents (copy and paste). |EnableTextAccessForAccessibilityTools|boolean|True |Specifies that the document content can be extracted to be used in accessibility applications. |EncryptFile |boolean|False |If true, selects to encrypt the PDF document with a password. The PDF file can be opened only when the user enters the correct password. |ExportBookmarks |boolean|True |Specifies if bookmarks are exported to PDF. |ExportBookmarksToPDFDestination|boolean|False |Specifies that the bookmarks contained in the source OpenOffice.org file should be exported to the PDF file as Named Destination (see PDF 1.4 section 8.2.1). |ExportFormFields |boolean|True |Specifies whether form fields are exported as widgets or only their fixed print representation is exported. |ExportLinksRelativeFsys |boolean|False |Specifies that the file system related hyperlinks (file:// method) present in the document will be exported as relative to the source document location. |ExportNotes |boolean|False |Specifies if notes are exported to PDF. |ExportNotesPages |boolean|False |Specifies if notes pages are exported to PDF. (Notes pages are available in Impress documents only). |FirstPageOnLeft |boolean|False |Used with the value 3 of the PageLayout property when the first page (odd) should be on the left side of the screen. |FormsType |integer|0 |Specifies the submitted format of a PDF form. *0*:FDF format *1*:PDF format *2*:HTML format *3*:XML format |HideViewerMenubar |boolean|False |Specifies whether to hide the PDF viewer menubar when the document is active. |HideViewerToolbar |boolean|False |Specifies whether to hide the PDF viewer toolbar when the document is active. |hideViewerWindowControls |boolean|False |Specifies whether to hide the PDF viewer controls when the document is active. |InitialPage |integer|1 |Specifies the page on which a PDF document should be opened in the viewer application. |InitialView |integer|0 |Specifies how the PDF document should be displayed when opened. *0*:meaning neither outlines or thumbnails, *1*:meaning the document is opened with outline pane opened, *2*:meaning the document is opened with thumbnail pane opened |IsAddStream |boolean|False |Specifies that a stream is inserted to the PDF file which contains the original document for archiving purposes. This option is active only if the PDF Import extension is installed. |IsSkipEmptyPages |boolean|False |Specifies that automatically inserted empty pages are suppressed. This option is active only if storing Writer documents. |Magnification |integer|0 |Specifies the action to be performed when the PDF document is opened *0*:meaning opens with default zoom magnification *1*:meaning opens magnified to fit the entire page within the window *2*:meaning opens magnified to fit the entire page width within the window *3*:meaning opens magnified to fit the entire width of its boundig box within the window (cuts out margins) *4*:means with a zoom level given in the “Zoom” property. |MaxImageResolution |integer|300 |If the property If the property ReduceImageResolution is set to true all images will be reduced to the given value in DPI. Possible values: *75*, *150*, *300*, *600*, *1200* |OpenBookmarkLevels |integer|-1 |Specifies how many bookmark levels should be opened in the reader application when the PDF gets opened. -1 means all levels, non-negative numbers mean the respective number of levels. |OpenInFullScreenMode |boolean|False |Specifies that the PDF viewer window is opened full screen, on top of all windows. |PageLayout |integer|0 |Specifies the page layout to be used when the document is opened. *0*:meaning display the pages according to the reader configuration *1*:meaning display one page at a time *2*:meaning display the pages in one column *3*:meaning display the pages in two columns odd pages on the right, to have the odd pages on the left the FirstPageOnLeft properties should be used as well. |PageRange |string | |If this property is set, it indicates the range of pages to be printed. If you want to print all the pages, leave this property unset. If you want to export a selection, leave this property unset, setting only the property Selection. |PDFViewSelection |integer|0 |Specifies the way the exported PDF will be viewed (experienced) by the user. *0*:specifies that the PDF will be exported with all the links external to the document treated as URI. *1*:specifies that the PDF will be exported in order to be viewed through a PDF reader application only. Valid only if not exporting to PDF/A-1 (e.g. SelectPdfVersion not set to 1). *2*:specifies that the PDF will be exported in order to be viewed through an Internet browser, using the PDF plug-in provided with it. The bookmark of the URI will be rendered compatible with the target bookmark generated with OOo PDF Export feature (see ExportBookmarksToPDFDestination property). |PermissionPassword |string | |This is the password that allows the user to access some permissions restricted if "RestrictPermissions" is set to true. |Printing |integer|2 | *0*:Not permitted *1*:Low resolution only(150 DPI) *2*:Maximum Resolution allowed |Quality |integer|90 |Specifies quality of the JPG export. A higher value results in higher quality and file size. Specifies quality of the JPG export. A higher value results in higher quality and file. *1*:represents lowest value that can be used. The lower the value, the less good is the compression quality and the bigger is be the file size *100*:represents highest value that can be used. The higher the value, the better is the compression quality and the smaller is the file size. (1 - 100) |ReduceImageResolution |boolean|False |Specifies if the resolution of each image is reduced to the resolution specified by the property MaxImageResolution. |ResizeWindowToInitialPage |boolean|False |Specifies that the PDF viewer window is opened full screen when the document is opened. |RestrictPermissionPassword|boolean|False |If true, selects to restrict some permissions. The permissions can be changed only when the user enters the correct password. |Selection |any? | |An any corresponding to the current selection in the document. |SelectPdfVersion |integer|0 |Specifies the PDF version to emit. *0*:PDF 1.4 *1*:PDF/A-1 (ISO 19005-1:2005) |UseLosslessCompression |boolean|False |Specifies if graphics are exported to PDF using a lossless compression eg. PNG or if they are compressed using the JPEG format. |UseTaggedPDF |boolean|False |Determines if PDF are created by using special tags also known as Tagged PDF. |UseTransitionEffects |boolean|False |Specifies slide transitions are exported to PDF. This option is active only if storing Impress documents. |Watermark |string | |Specifies the text for a watermark to be drawn on every page of the exported PDF file. |Zoom |integer|100 |Specifies the zoom level a PDF document is opened with. Only valid if "Magnification" is set to "4". |=========================================================== unoconv-0.7/doc/formats.adoc000066400000000000000000000475611254733325000161400ustar00rootroot00000000000000### The most current list of filters on LibreOffice can be found using: xmllint --format /opt/libreoffice3.5/share/registry/*.xcd xmlstarlet sel -T -t -m "/oor:data/oor:component-data/node[@oor:name='Filters']/node" \ -v "concat(prop[@oor:name='DocumentService'],'|',@oor:name,'|',prop[@oor:name='Flags'],'|',prop[@oor:name='UIName'],'|',prop[@oor:name='Extensions'],'|')" \ -n /opt/libreoffice3.5/share/registry/*.xcd ### This is a current list of formats known by Openoffice: ### from http://wiki.services.openoffice.org/wiki/Framework/Article/Filter/FilterList_OOo_3_0 ### Also see: ### http://wiki.services.openoffice.org/wiki/Documentation/OOo3_User_Guides/Getting_Started/File_formats ### com.sun.star.text.TextDocument 1|OpenOffice.org 1.0 Text Document|StarOffice XML (Writer)|X|X|-|-| IMPORT EXPORT TEMPLATE OWN ALIEN PREFERED 2|StarWriter 4.0|StarWriter 4.0|X|X|-|-| IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER 3|HTML Document (OpenOffice.org Writer)|HTML (StarWriter)|X|X|-|-| IMPORT EXPORT ALIEN ASYNCHRON 4|StarWriter 3.0 Template|StarWriter 3.0 Vorlage/Template|X|X|-|-| IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER 5|StarWriter 4.0 Template|StarWriter 4.0 Vorlage/Template|X|X|-|-| IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER 6|StarWriter 5.0 Template|StarWriter 5.0 Vorlage/Template|X|X|-|-| IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER 7|Microsoft Word 95 Template|MS Word 95 Vorlage|X|-|-|-| IMPORT TEMPLATE TEMPLATEPATH ALIEN 8|Microsoft Word 97/2000/XP Template|MS Word 97 Vorlage|X|-|-|-| IMPORT TEMPLATE TEMPLATEPATH ALIEN 9|OpenOffice.org 1.0 Text Document Template|writer_StarOffice_XML_Writer_Template|X|X|-|-| IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 10|ODF Text Document|writer8|X|X|-|-| IMPORT EXPORT TEMPLATE OWN DEFAULT PREFERED 11|Microsoft Word 2003 XML|MS Word 2003 XML|X|X|-|-| IMPORT EXPORT ALIEN 3RDPARTYFILTER 12|Microsoft Excel 95 (OpenOffice.org Writer)|MS Excel 95 (StarWriter)|X|-|-|X| IMPORT ALIEN NOTINFILEDIALOG NOTINCHOOSER 3RDPARTYFILTER 13|Lotus 1-2-3 1.0 WIN (OpenOffice.org Writer)|Lotus 1-2-3 1.0 (WIN) (StarWriter)|X|-|-|X| IMPORT ALIEN NOTINFILEDIALOG NOTINCHOOSER 3RDPARTYFILTER 14|Lotus 1-2-3 1.0 DOS (OpenOffice.org Writer)|Lotus 1-2-3 1.0 (DOS) (StarWriter)|X|-|-|X| IMPORT ALIEN NOTINFILEDIALOG NOTINCHOOSER 3RDPARTYFILTER 15|WordPerfect Document|WordPerfect|X|-|X|-| IMPORT ALIEN USESOPTIONS 3RDPARTYFILTER PREFERED 16|Rich Text Format|Rich Text Format|X|X|-|-| IMPORT EXPORT ALIEN PREFERED 17|StarWriter 1.0|StarWriter 1.0|X|-|-|-| IMPORT ALIEN 3RDPARTYFILTER 18|PDF - Portable Document Format|writer_pdf_Export|-|X|-|-| EXPORT ALIEN 3RDPARTYFILTER 19|Microsoft Word 2007 XML Template|MS Word 2007 XML Template|X|-|-|-| IMPORT TEMPLATE TEMPLATEPATH ALIEN 3RDPARTYFILTER 20|StarWriter 3.0|StarWriter 3.0|X|X|-|-| IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER 21|ODF Text Document Template|writer8_template|X|X|-|-| IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN 22|BibTeX|BibTeX_Writer|-|X|-|-| EXPORT ALIEN 3RDPARTYFILTER 23|StarWriter 5.0|StarWriter 5.0|X|X|-|-| IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER PREFERED 24|Microsoft Word 6.0|MS WinWord 6.0|X|X|-|-| IMPORT EXPORT ALIEN 25|StarWriter DOS|StarWriter DOS|X|-|-|-| IMPORT ALIEN 3RDPARTYFILTER 26|Text Encoded|Text (encoded)|X|X|-|-| IMPORT EXPORT ALIEN 27|Unified Office Format text|UOF text|X|X|-|-| IMPORT EXPORT ALIEN 3RDPARTYFILTER 28|Microsoft Word 95|MS Word 95|X|X|-|-| IMPORT EXPORT ALIEN 29|Microsoft Word 97/2000/XP|MS Word 97|X|X|-|-| IMPORT EXPORT ALIEN PREFERED 30|Hangul WP 97|writer_MIZI_Hwp_97|X|-|-|-| IMPORT ALIEN 3RDPARTYFILTER 31|LaTeX 2e|LaTeX_Writer|-|X|-|-| EXPORT ALIEN 3RDPARTYFILTER 32|Microsoft Excel 5.0 (OpenOffice.org Writer)|MS Excel 5.0 (StarWriter)|X|-|-|X| IMPORT ALIEN NOTINFILEDIALOG NOTINCHOOSER 3RDPARTYFILTER 33|XHTML|XHTML Writer File|-|X|-|-| EXPORT ALIEN 3RDPARTYFILTER 34|Text|Text|X|X|-|-| IMPORT EXPORT ALIEN PREFERED 35|Microsoft Word 2007 XML|MS Word 2007 XML|X|-|-|-| IMPORT ALIEN 3RDPARTYFILTER 36|T602 Document|T602Document|X|-|X|-| IMPORT ALIEN USESOPTIONS 3RDPARTYFILTER PREFERED 37|MediaWiki|MediaWiki|-|X|-|-| EXPORT ALIEN 3RDPARTYFILTER 38|Microsoft Excel 4.0 (OpenOffice.org Writer)|MS Excel 4.0 (StarWriter)|X|-|-|X| IMPORT ALIEN NOTINFILEDIALOG NOTINCHOOSER 3RDPARTYFILTER 39|DocBook|DocBook File|X|X|-|-| IMPORT EXPORT ALIEN 3RDPARTYFILTER 40|Microsoft WinWord 5|MS WinWord 5|X|-|-|-| IMPORT ALIEN 41|StarWriter 2.0|StarWriter 2.0|X|-|-|-| IMPORT TEMPLATE ALIEN 3RDPARTYFILTER ### com.sun.star.text.WebDocument 1|Help content|writer_web_HTML_help|X|-|-|X| IMPORT INTERNAL NOTINFILEDIALOG NOTINCHOOSER ASYNCHRON READONLY 2|HTML Document|HTML|X|X|-|-| IMPORT EXPORT ASYNCHRON PREFERED 3|StarWriter 3.0 (OpenOffice.org Writer/Web)|StarWriter 3.0 (StarWriter/Web)|-|X|-|-| EXPORT TEMPLATE ALIEN 3RDPARTYFILTER 4|StarWriter 4.0 (OpenOffice.org Writer/Web)|StarWriter 4.0 (StarWriter/Web)|-|X|-|-| EXPORT TEMPLATE ALIEN 3RDPARTYFILTER 5|StarWriter 5.0 (OpenOffice.org Writer/Web)|StarWriter 5.0 (StarWriter/Web)|-|X|-|-| EXPORT TEMPLATE ALIEN 3RDPARTYFILTER 6|StarWriter/Web 4.0 Template|StarWriter/Web 4.0 Vorlage/Template|X|X|-|-| IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER 7|StarWriter/Web 5.0 Template|StarWriter/Web 5.0 Vorlage/Template|X|X|-|-| IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER 8|Text (OpenOffice.org Writer/Web)|Text (StarWriter/Web)|X|X|-|-| IMPORT EXPORT ALIEN 9|MediaWiki|MediaWiki_Web|-|X|-|-| EXPORT ALIEN 3RDPARTYFILTER 10|PDF - Portable Document Format|writer_web_pdf_Export|-|X|-|-| EXPORT ALIEN 3RDPARTYFILTER 11|OpenOffice.org 1.0 HTML Template|writer_web_StarOffice_XML_Writer_Web_Template|X|X|-|-| IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 12|OpenOffice.org Text (OpenOffice.org Writer/Web)|writerweb8_writer|-|X|-|-| EXPORT TEMPLATE 13|HTML Document Template|writerweb8_writer_template|X|X|-|-| IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN 14|Text Encoded (OpenOffice.org Writer/Web)|Text (encoded) (StarWriter/Web)|X|X|-|-| IMPORT EXPORT ALIEN 15|OpenOffice.org 1.0 Text Document (OpenOffice.org Writer/Web)|writer_web_StarOffice_XML_Writer|-|X|-|-| EXPORT TEMPLATE ALIEN ### com.sun.star.text.GlobalDocument 1|OpenOffice.org 1.0 Master Document|writer_globaldocument_StarOffice_XML_Writer_GlobalDocument|X|X|-|-| IMPORT EXPORT TEMPLATE OWN ALIEN PREFERED 2|Text Encoded (OpenOffice.org Master Document)|Text (encoded) (StarWriter/GlobalDocument)|X|X|-|-| IMPORT EXPORT ALIEN 3|StarWriter 3.0|StarWriter 3.0 (StarWriter/GlobalDocument)|-|X|-|-| EXPORT TEMPLATE ALIEN 3RDPARTYFILTER 4|StarWriter 4.0|StarWriter 4.0 (StarWriter/GlobalDocument)|-|X|-|-| EXPORT TEMPLATE ALIEN 3RDPARTYFILTER 5|StarWriter 5.0|StarWriter 5.0 (StarWriter/GlobalDocument)|-|X|-|-| EXPORT TEMPLATE ALIEN 3RDPARTYFILTER 6|HTML (Writer/Global)|writerglobal8_HTML|-|X|-|X| EXPORT ALIEN NOTINCHOOSER ASYNCHRON 7|ODF Master Document|writerglobal8|X|X|-|-| IMPORT EXPORT TEMPLATE OWN PREFERED 8|ODF Text Document|writerglobal8_writer|-|X|-|-| EXPORT TEMPLATE 9|StarWriter 4.0 Master Document|StarWriter 4.0/GlobalDocument|X|X|-|-| IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER 10|StarWriter 5.0 Master Document|StarWriter 5.0/GlobalDocument|X|X|-|-| IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER 11|PDF - Portable Document Format|writer_globaldocument_pdf_Export|-|X|-|-| EXPORT ALIEN 3RDPARTYFILTER 12|OpenOffice.org 1.0 Text Document|writer_globaldocument_StarOffice_XML_Writer|-|X|-|-| EXPORT TEMPLATE ALIEN ### com.sun.star.sheet.SpreadsheetDocument 1|Web Page Query (OpenOffice.org Calc)|calc_HTML_WebQuery|X|-|-|-| IMPORT ALIEN 2|OpenOffice.org 1.0 Spreadsheet Template|calc_StarOffice_XML_Calc_Template|X|X|-|-| IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3|OpenOffice.org 1.0 Spreadsheet|StarOffice XML (Calc)|X|X|-|-| IMPORT EXPORT TEMPLATE OWN ALIEN 4|Microsoft Excel 2007 XML Template|Calc MS Excel 2007 XML Template|X|-|-|-| IMPORT TEMPLATE TEMPLATEPATH ALIEN 3RDPARTYFILTER 5|Data Interchange Format|DIF|X|X|X|-| IMPORT EXPORT ALIEN USESOPTIONS 6|Microsoft Excel 97/2000/XP Template|MS Excel 97 Vorlage/Template|X|X|-|-| IMPORT EXPORT TEMPLATE TEMPLATEPATH ALIEN 7|HTML Document (OpenOffice.org Calc)|HTML (StarCalc)|X|X|-|-| IMPORT EXPORT ALIEN 8|Microsoft Excel 5.0|MS Excel 5.0/95|X|X|-|-| IMPORT EXPORT ALIEN PREFERED 9|Unified Office Format spreadsheet|UOF spreadsheet|X|X|-|-| IMPORT EXPORT ALIEN 3RDPARTYFILTER 10|Microsoft Excel 95|MS Excel 95|X|X|-|-| IMPORT EXPORT ALIEN PREFERED 11|StarCalc 4.0|StarCalc 4.0|X|X|-|-| IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER 12|Microsoft Excel 97/2000/XP|MS Excel 97|X|X|-|-| IMPORT EXPORT ALIEN PREFERED 13|Microsoft Excel 4.0 Template|MS Excel 4.0 Vorlage/Template|X|-|-|-| IMPORT TEMPLATE TEMPLATEPATH ALIEN 14|ODF Spreadsheet Template|calc8_template|X|X|-|-| IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN 15|ODF Spreadsheet|calc8|X|X|-|-| IMPORT EXPORT TEMPLATE OWN DEFAULT 16|Text CSV|Text - txt - csv (StarCalc)|X|X|X|-| IMPORT EXPORT ALIEN USESOPTIONS 17|Rich Text Format (OpenOffice.org Calc)|Rich Text Format (StarCalc)|X|-|-|-| IMPORT ALIEN 18|StarCalc 3.0 Template|StarCalc 3.0 Vorlage/Template|X|X|-|-| IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER 19|StarCalc 4.0 Template|StarCalc 4.0 Vorlage/Template|X|X|-|-| IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER 20|StarCalc 5.0 Template|StarCalc 5.0 Vorlage/Template|X|X|-|-| IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER 21|Microsoft Excel 95 Template|MS Excel 95 Vorlage/Template|X|X|-|-| IMPORT EXPORT TEMPLATE TEMPLATEPATH ALIEN 22|dBASE|dBase|X|X|X|-| IMPORT EXPORT ALIEN USESOPTIONS 23|Microsoft Excel 2003 XML|MS Excel 2003 XML|X|X|-|-| IMPORT EXPORT ALIEN 3RDPARTYFILTER 24|Microsoft Excel 2007 XML|Calc MS Excel 2007 XML|X|-|-|-| IMPORT ALIEN 3RDPARTYFILTER PREFERED 25|Microsoft Excel 2007 Binary|Calc MS Excel 2007 Binary|X|-|-|-| IMPORT ALIEN 3RDPARTYFILTER PREFERED 26|XHTML|XHTML Calc File|-|X|-|-| EXPORT ALIEN 3RDPARTYFILTER 27|StarCalc 1.0|StarCalc 1.0|X|-|-|-| IMPORT ALIEN 28|Microsoft Excel 5.0 Template|MS Excel 5.0/95 Vorlage/Template|X|X|-|-| IMPORT EXPORT TEMPLATE TEMPLATEPATH ALIEN 29|StarCalc 3.0|StarCalc 3.0|X|X|-|-| IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER 30|Quattro Pro 6.0|Quattro Pro 6.0|X|-|-|-| IMPORT ALIEN PREFERED 31|StarCalc 5.0|StarCalc 5.0|X|X|-|-| IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER 32|Microsoft Excel 4.0|MS Excel 4.0|X|-|-|-| IMPORT ALIEN PREFERED 33|Lotus 1-2-3|Lotus|X|-|X|-| IMPORT ALIEN USESOPTIONS PREFERED 34|PDF - Portable Document Format|calc_pdf_Export|-|X|-|-| EXPORT ALIEN 3RDPARTYFILTER 35|SYLK|SYLK|X|X|-|-| IMPORT EXPORT ALIEN ### com.sun.star.drawing.DrawingDocument 1|PSD - Adobe Photoshop|PSD - Adobe Photoshop|X|-|-|-| IMPORT ALIEN 2|PNG - Portable Network Graphic|draw_png_Export|-|X|-|-| EXPORT ALIEN SUPPORTSSELECTION 3|JPEG - Joint Photographic Experts Group|draw_jpg_Export|-|X|-|-| EXPORT ALIEN SUPPORTSSELECTION 4|WMF - Windows Metafile|WMF - MS Windows Metafile|X|-|-|-| IMPORT ALIEN 5|PPM - Portable Pixelmap|draw_ppm_Export|-|X|-|-| EXPORT ALIEN SUPPORTSSELECTION 6|ODF Drawing|draw8|X|X|-|-| IMPORT EXPORT TEMPLATE OWN DEFAULT PREFERED 7|RAS - Sun Raster Image|RAS - Sun Rasterfile|X|-|-|-| IMPORT ALIEN 8|WMF - Windows Metafile|draw_wmf_Export|-|X|-|-| EXPORT ALIEN SUPPORTSSELECTION 9|XPM - X PixMap|XPM|X|-|-|-| IMPORT ALIEN 10|SGV - StarDraw 2.0|SGV - StarDraw 2.0|X|-|-|-| IMPORT ALIEN 11|PGM - Portable Graymap|draw_pgm_Export|-|X|-|-| EXPORT ALIEN SUPPORTSSELECTION 12|EMF - Enhanced Metafile|EMF - MS Windows Metafile|X|-|-|-| IMPORT ALIEN 13|TIFF - Tagged Image File Format|draw_tif_Export|-|X|-|-| EXPORT ALIEN SUPPORTSSELECTION 14|PBM - Portable Bitmap|draw_pbm_Export|-|X|-|-| EXPORT ALIEN SUPPORTSSELECTION 15|EMF - Enhanced Metafile|draw_emf_Export|-|X|-|-| EXPORT ALIEN SUPPORTSSELECTION 16|SVM - StarView Metafile|SVM - StarView Metafile|X|-|-|-| IMPORT ALIEN 17|SGF - StarWriter Graphics Format|SGF - StarOffice Writer SGF|X|-|-|-| IMPORT ALIEN 18|JPEG - Joint Photographic Experts Group|JPG - JPEG|X|-|-|-| IMPORT ALIEN 19|XPM - X PixMap|draw_xpm_Export|-|X|-|-| EXPORT ALIEN SUPPORTSSELECTION 20|ODF Drawing Template|draw8_template|X|X|-|-| IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN 21|BMP - Windows Bitmap|draw_bmp_Export|-|X|-|-| EXPORT ALIEN SUPPORTSSELECTION 22|PCD - Kodak Photo CD (384x256)|draw_PCD_Photo_CD_Base4|X|-|-|-| IMPORT ALIEN 23|Macromedia Flash (SWF)|draw_flash_Export|-|X|-|-| EXPORT ALIEN 3RDPARTYFILTER 24|PPM - Portable Pixelmap|PPM - Portable Pixelmap|X|-|-|-| IMPORT ALIEN 25|DXF - AutoCAD Interchange Format|DXF - AutoCAD Interchange|X|-|-|-| IMPORT ALIEN 26|OpenOffice.org 1.0 Drawing|StarOffice XML (Draw)|X|X|-|-| IMPORT EXPORT TEMPLATE OWN ALIEN PREFERED 27|TIFF - Tagged Image File Format|TIF - Tag Image File|X|-|-|-| IMPORT ALIEN 28|PDF - Portable Document Format|draw_pdf_Export|-|X|-|-| EXPORT ALIEN 3RDPARTYFILTER 29|PCX - Zsoft Paintbrush|PCX - Zsoft Paintbrush|X|-|-|-| IMPORT ALIEN 30|GIF - Graphics Interchange Format|draw_gif_Export|-|X|-|-| EXPORT ALIEN SUPPORTSSELECTION 31|RAS - Sun Raster Image|draw_ras_Export|-|X|-|-| EXPORT ALIEN SUPPORTSSELECTION 32|BMP - Windows Bitmap|BMP - MS Windows|X|-|-|-| IMPORT ALIEN 33|EPS - Encapsulated PostScript|EPS - Encapsulated PostScript|X|-|-|-| IMPORT ALIEN 34|XBM - X Bitmap|XBM - X-Consortium|X|-|-|-| IMPORT ALIEN 35|StarDraw 3.0 Template|StarDraw 3.0 Vorlage|X|X|-|-| IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER 36|StarDraw 5.0 Template|StarDraw 5.0 Vorlage|X|X|-|-| IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER PREFERED 37|HTML Document (OpenOffice.org Draw)|draw_html_Export|-|X|-|-| EXPORT ALIEN 38|PCD - Kodak Photo CD (192x128)|draw_PCD_Photo_CD_Base16|X|-|-|-| IMPORT ALIEN 39|PCD - Kodak Photo CD (768x512)|draw_PCD_Photo_CD_Base|X|-|-|-| IMPORT ALIEN 40|StarDraw 3.0|StarDraw 3.0|X|X|-|-| IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER 41|PCT - Mac Pict|draw_pct_Export|-|X|-|-| EXPORT ALIEN SUPPORTSSELECTION 42|PCT - Mac Pict|PCT - Mac Pict|X|-|-|-| IMPORT ALIEN 43|MET - OS/2 Metafile|draw_met_Export|-|X|-|-| EXPORT ALIEN SUPPORTSSELECTION 44|StarDraw 5.0|StarDraw 5.0|X|X|-|-| IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER PREFERED 45|XHTML|XHTML Draw File|-|X|-|-| EXPORT ALIEN 3RDPARTYFILTER 46|TGA - Truevision Targa|TGA - Truevision TARGA|X|-|-|-| IMPORT ALIEN 47|GIF - Graphics Interchange Format|GIF - Graphics Interchange|X|-|-|-| IMPORT ALIEN 48|EPS - Encapsulated PostScript|draw_eps_Export|-|X|-|-| EXPORT ALIEN SUPPORTSSELECTION 49|PGM - Portable Graymap|PGM - Portable Graymap|X|-|-|-| IMPORT ALIEN 50|SVG - Scalable Vector Graphics|draw_svg_Export|-|X|-|-| EXPORT ALIEN 3RDPARTYFILTER 51|MET - OS/2 Metafile|MET - OS/2 Metafile|X|-|-|-| IMPORT ALIEN 52|PNG - Portable Network Graphic|PNG - Portable Network Graphic|X|-|-|-| IMPORT ALIEN 53|OpenOffice.org 1.0 Drawing Template|draw_StarOffice_XML_Draw_Template|X|X|-|-| IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 54|PBM - Portable Bitmap|PBM - Portable Bitmap|X|-|-|-| IMPORT ALIEN 55|SVM - StarView Metafile|draw_svm_Export|-|X|-|-| EXPORT ALIEN SUPPORTSSELECTION ### com.sun.star.presentation.PresentationDocument 1|StarDraw 3.0 Template (OpenOffice.org Impress)|StarDraw 3.0 Vorlage (StarImpress)|X|X|-|X| IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN NOTINFILEDIALOG NOTINCHOOSER 3RDPARTYFILTER 2|StarDraw 5.0 Template (OpenOffice.org Impress)|StarDraw 5.0 Vorlage (StarImpress)|X|X|-|X| IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN NOTINFILEDIALOG NOTINCHOOSER 3RDPARTYFILTER 3|Microsoft PowerPoint 97/2000/XP Template|MS PowerPoint 97 Vorlage|X|X|-|-| IMPORT EXPORT TEMPLATE TEMPLATEPATH ALIEN 4|Unified Office Format presentation|UOF presentation|X|X|-|-| IMPORT EXPORT ALIEN 3RDPARTYFILTER 5|OpenOffice.org 1.0 Presentation Template|impress_StarOffice_XML_Impress_Template|X|X|-|-| IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 6|StarImpress 5.0|StarImpress 5.0|X|X|-|-| IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER PREFERED 7|StarImpress 5.0 Packed|StarImpress 5.0 (packed)|X|-|-|-| IMPORT ALIEN 3RDPARTYFILTER PACKED 8|StarDraw 5.0 (OpenOffice.org Impress)|StarDraw 5.0 (StarImpress)|X|X|-|-| IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER 9|ODF Presentation|impress8|X|X|-|-| IMPORT EXPORT TEMPLATE OWN DEFAULT PREFERED 10|XPM - X PixMap|impress_xpm_Export|-|X|-|-| EXPORT ALIEN SUPPORTSSELECTION 11|WMF - Windows Metafile|impress_wmf_Export|-|X|-|-| EXPORT ALIEN SUPPORTSSELECTION 12|TIFF - Tagged Image File Format|impress_tif_Export|-|X|-|-| EXPORT ALIEN SUPPORTSSELECTION 13|SVM - StarView Metafile|impress_svm_Export|-|X|-|-| EXPORT ALIEN SUPPORTSSELECTION 14|SVG - Scalable Vector Graphics|impress_svg_Export|-|X|-|-| EXPORT ALIEN 3RDPARTYFILTER 15|BMP - Windows Bitmap|impress_bmp_Export|-|X|-|-| EXPORT ALIEN SUPPORTSSELECTION 16|EMF - Enhanced Metafile|impress_emf_Export|-|X|-|-| EXPORT ALIEN SUPPORTSSELECTION 17|EPS - Encapsulated PostScript|impress_eps_Export|-|X|-|-| EXPORT ALIEN SUPPORTSSELECTION 18|GIF - Graphics Interchange Format|impress_gif_Export|-|X|-|-| EXPORT ALIEN SUPPORTSSELECTION 19|JPEG - Joint Photographic Experts Group|impress_jpg_Export|-|X|-|-| EXPORT ALIEN SUPPORTSSELECTION 20|MET - OS/2 Metafile|impress_met_Export|-|X|-|-| EXPORT ALIEN SUPPORTSSELECTION 21|PBM - Portable Bitmap|impress_pbm_Export|-|X|-|-| EXPORT ALIEN SUPPORTSSELECTION 22|PCT - Mac Pict|impress_pct_Export|-|X|-|-| EXPORT ALIEN SUPPORTSSELECTION 23|PDF - Portable Document Format|impress_pdf_Export|-|X|-|-| EXPORT ALIEN 3RDPARTYFILTER 24|PGM - Portable Graymap|impress_pgm_Export|-|X|-|-| EXPORT ALIEN SUPPORTSSELECTION 25|PNG - Portable Network Graphic|impress_png_Export|-|X|-|-| EXPORT ALIEN SUPPORTSSELECTION 26|PPM - Portable Pixelmap|impress_ppm_Export|-|X|-|-| EXPORT ALIEN SUPPORTSSELECTION 27|RAS - Sun Raster Image|impress_ras_Export|-|X|-|-| EXPORT ALIEN SUPPORTSSELECTION 28|Microsoft PowerPoint 2007 XML Template|Impress MS PowerPoint 2007 XML Template|X|-|-|-| IMPORT TEMPLATE TEMPLATEPATH ALIEN 3RDPARTYFILTER PREFERED 29|ODF Drawing (Impress)|impress8_draw|X|X|-|-| IMPORT EXPORT TEMPLATE OWN 30|PWP - PlaceWare|placeware_Export|-|X|-|-| EXPORT ALIEN 3RDPARTYFILTER 31|OpenOffice.org 1.0 Drawing (OpenOffice.org Impress)|impress_StarOffice_XML_Draw|X|X|-|-| IMPORT EXPORT TEMPLATE OWN ALIEN 32|Microsoft PowerPoint 2007 XML|Impress MS PowerPoint 2007 XML|X|-|-|-| IMPORT ALIEN 3RDPARTYFILTER PREFERED 33|XHTML|XHTML Impress File|-|X|-|-| EXPORT ALIEN 3RDPARTYFILTER 34|Macromedia Flash (SWF)|impress_flash_Export|-|X|-|-| EXPORT ALIEN 3RDPARTYFILTER 35|CGM - Computer Graphics Metafile|CGM - Computer Graphics Metafile|X|-|-|-| IMPORT ALIEN 36|Microsoft PowerPoint 97/2000/XP|MS PowerPoint 97|X|X|-|-| IMPORT EXPORT ALIEN 37|StarImpress 4.0|StarImpress 4.0|X|X|-|-| IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER PREFERED 38|ODF Presentation Template|impress8_template|X|X|-|-| IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN 39|StarImpress 4.0 Template|StarImpress 4.0 Vorlage|X|X|-|-| IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER 40|StarImpress 5.0 Template|StarImpress 5.0 Vorlage|X|X|-|-| IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER 41|OpenOffice.org 1.0 Presentation|StarOffice XML (Impress)|X|X|-|-| IMPORT EXPORT TEMPLATE OWN ALIEN PREFERED 42|StarDraw 3.0 (OpenOffice.org Impress)|StarDraw 3.0 (StarImpress)|X|X|-|-| IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER 43|HTML Document (OpenOffice.org Impress)|impress_html_Export|-|X|-|-| EXPORT ALIEN ### com.sun.star.formula.FormulaProperties 1|StarMath 3.0|StarMath 3.0|X|-|-|-| IMPORT OWN ALIEN 3RDPARTYFILTER 2|StarMath 5.0|StarMath 5.0|X|X|-|-| IMPORT EXPORT OWN ALIEN 3RDPARTYFILTER 3|OpenOffice.org 1.0 Formula|StarOffice XML (Math)|X|X|-|-| IMPORT EXPORT TEMPLATE OWN ALIEN 4|MathType3.x|MathType 3.x|X|X|-|X| IMPORT EXPORT ALIEN NOTINFILEDIALOG NOTINCHOOSER 5|StarMath 2.0|StarMath 2.0|X|-|-|-| IMPORT ALIEN 6|StarMath 4.0|StarMath 4.0|X|-|-|-| IMPORT OWN ALIEN 3RDPARTYFILTER 7|PDF - Portable Document Format|math_pdf_Export|-|X|-|-| EXPORT ALIEN 3RDPARTYFILTER 8|MathML 1.01|MathML XML (Math)|X|X|-|-| IMPORT EXPORT TEMPLATE 9|ODF Formula|math8|X|X|-|-| IMPORT EXPORT TEMPLATE OWN DEFAULT ### com.sun.star.sdb.OfficeDatabaseDocument 1|ODF Database|StarOffice XML (Base)|X|X|-|-| IMPORT EXPORT OWN DEFAULT 3RDPARTYFILTER unoconv-0.7/doc/office-installations.adoc000066400000000000000000000115721254733325000205730ustar00rootroot00000000000000= Office installations Dag Wieers Since the hardest part is making unoconv work with any permutation of platform, python and office suite I started to collect a number of known locations of each of these important bits. *Please provide this information for any new platform so we can make sure unoconv will keep on working with your existing installation.* == RHEL6 === LibreOffice 3.4.5 (platform) Reported by dagwieers soffice.bin:: /usr/lib64/libreoffice/program/soffice.bin python:: /usr/bin/python pyuno.so:: /usr/lib64/libreoffice/basis-link/program/pyuno.so === LibreOffice 3.4.6 (project) Reported by dagwieers soffice.bin:: /opt/libreoffice3.4/program/soffice.bin python:: /opt/libreoffice3.4/basis-link/program/python.bin pyuno.so:: /opt/libreoffice3.4/basis-link/program/pyuno.so python-core:: /opt/libreoffice3.4/basis-link/program/python-core-2.6.1/ === LibreOffice 3.5.3 (project) Reported by dagwieers soffice.bin:: /opt/libreoffice3.5/program/soffice.bin python.bin:: /opt/libreoffice3.5/program/python.bin pyuno.so:: /opt/libreoffice3.5/program/pyuno.so python-core:: /opt/libreoffice3.5/program/python-core-2.6.1/ === OpenOffice 3.4.0 (project) Reported by dagwieers soffice.bin:: /opt/openoffice.org3/program/soffice.bin python.bin:: /opt/libreoffice3.4/basis-link/program/python.bin pyuno.so:: /opt/libreoffice3.4/basis-link/program/pyuno.so python-core:: /opt/libreoffice3.4/basis-link/program/python-core-2.6.1/ == MacOS X ? On MacOS X it is important to answer the following questions: - Is there a symlink from 'Contents/program' to 'Contents/MacOSX' ? We prefer to use the 'Contents/program' path but we need to make sure it exists in all cases. ANSWER: the symlink is present, but unoconv does not work if the symlink is used. - Can you find a pyuno.so ? Or is there only a pyuno.dylib on your system ? ANSWER: There is a pyuno.so in all distributions. libpyuno.dylib is also present, but unoconv works fine with pyuno.so instead. - What is the location of the python libraries as shipped by your office installation ? - Is there a 'python.bin' binary on your office installation ? Or is there only a 'python' binary ? Also let us know if your office installation does not ship with a python interpreter at all. ANSWER: python.bin is not present in any MacOS distribution of LibreOffice. Neither python.bin nor python are present in any OpenOffice distribution (as of 3.4) === OpenOffice 3.3.0 Reported by ghis182 soffice.bin:: /Applications/OpenOffice.org.app/Contents/program/soffice.bin python:: no python interpreter ? pyuno.so:: /Applications/OpenOffice.org.app/Contents/basis-link/program/pyuno.so === LibreOffice ? Reported by bartbunting soffice.bin:: /Applications/LibreOffice.app/Contents/MacOS/soffice.bin == MacOS X 10.6 (Snow Leopard) === LibreOffice 3.5.0 Reported by sfermigier soffice.bin:: /Applications/LibreOffice.app/Contents/program/soffice.bin python:: /Applications/LibreOffice.app/Contents/program/python pyuno.dylib:: /Applications/LibreOffice.app/Contents/program/pyuno.dylib == MacOS X 10.7 (Lion) === OpenOffice 3.3.0 Reported by sotis soffice.bin:: /Applications/OpenOffice.org.app/Contents/MacOS/soffice.bin python:: no python interpreter ? pyuno.so:: /Applications/OpenOffice.org.app/Contents/basis-link/program/pyuno.so === LibreOffice 3.5.2 Reported by kungla soffice.bin:: /Applications/OpenOffice.org.app/Contents/program/soffice.bin python:: /Applications/LibreOffice.app/Contents/program/python (no .bin ?) pyuno.so:: /Applications/LibreOffice.app/Contents/program/pyuno.so == MacOS X 10.8 (Mountain Lion) === OpenOffice 3.4.0 Reported by scottprahl soffice.bin:: /Applications/OpenOffice.org.app/Contents/MacOS/soffice.bin python:: no python interpreter ? pyuno.so:: === LibreOffice 3.5.5 and earlier Reported by scottprahl _Broken because DYLD_LIBRARY_PATH defined in python shell script_ soffice.bin:: /Applications/LibreOffice.app/Contents/MacOS/soffice.bin python:: /Applications/LibreOffice.app/Contents/MacOS/python pyuno.so:: /Applications/LibreOffice.app/Contents/MacOS/pyuno.so === LibreOffice 3.5.6 Reported by scottprahl soffice.bin:: /Applications/LibreOffice.app/Contents/MacOS/soffice.bin python:: /Applications/LibreOffice.app/Contents/MacOS/python pyuno.so:: /Applications/LibreOffice.app/Contents/MacOS/pyuno.so === LibreOffice 3.6.0 Reported by scottprahl soffice.bin:: /Applications/LibreOffice.app/Contents/MacOS/soffice.bin python:: /Applications/LibreOffice.app/Contents/MacOS/python pyuno.so:: /Applications/LibreOffice.app/Contents/MacOS/pyuno.so == Windows 7 64bit === LibreOffice 3.5.3 (32bit) Reported by dagwieers soffice.exe:: C:\Program Files (x86)\LibreOffice 3.5\program\soffice.exe python.exe:: C:\Program Files (x86)\LibreOffice 3.5\program\python.exe pyuno.pyd:: C:\Program Files (x86)\LibreOffice 3.5\program\pyuno.pyd python-core:: C:\Program Files (x86)\LibreOffice 3.5\program\python-core-2.6.1\unoconv-0.7/doc/selinux.adoc000066400000000000000000000170661254733325000161510ustar00rootroot00000000000000= Using unoconv on a HTTP server /////////////////////////////////////////////////////////////////////////////// // // // THIS BRIEF NOTE IS AIMED TO HELP THOSE WHO WANT TO INSTALL UNOCONV // // AS A SERVICE AVAILABLE TO HTTP SERVER IN ORDER PROVIDE ONLINE DOCUMENT // // CONVERSION. // // // /////////////////////////////////////////////////////////////////////////////// == Prerequisites It is implied that you have successfully installed Linux system and Web server, as well as you have superuser [root] access. It is also implied that you have sucessfully installed OpenOffice/LibreOffice and Unoconv packages and Unoconv is working correctly from the console. NOTE: Since it is impossible to cover all webservers only Apache + PHP is described. == Apache Configuration Make sure your server is not running in chroot environment, since the rest of the system will be isolated. == PHP Configuration Make sure you server can perform system calls: you would need to use commands like +exec()+, +shell_exec()+, +passthru()+, +system()+ etc. Basically you need to check that in 'php.ini' or script settings: - safe_mode flag is off - disable_functions value is empty If everything is OK, you should be able to run unoconv with statements like: +exec("unoconv -f html -o target_dir $filename");+ Possible trouble makers: 1. Wrong Java. Possibility: Highly Unlikely. Keep in mind that open source java [openjdk] and Sun's java are NOT the same. LibreOffice uses openjdk, however typically they do not interfere with each other, even if they both installed at the same machine. 2. Iptables. Possibility: Highly Unlikely. Iptables firewall can block ports requred for LibreOffice communications. However most of the default settings on modern Linux distributions allow free access to ports from the inside (localhost), so this should not cause a problem. If you still think it is iptables, try to disable it temporary and see what happens (keep in mind you must be root): [root@localhost ~]# service iptables stop Stopping iptables (via systemctl): [ OK ] //try run unoconv and then [root@localhost ~]# service iptables start Starting iptables (via systemctl): [ OK ] 3. Linux File Permissions Problem. Possibility: Low. Well, if unoconv and LibreOffice installations was correct anybody on the system can use them. It is possible however that due some omissions or manual file access rights changes only specific user can execute them. If that is the case, you can either change the file access modes using "chmod" command, or [ since most of us does not know all LibreOffice files by name] login server under a different username. Keep in mind Apache runs under specific username, specified at "httpd.conf" file (typically located at "/etc/httpd/conf/httpd.conf"), change there "User" and "Group" settings. Alternatively you could run command using "sudo". In that case however you would possibly have to set sudoers file,usually running a "visudo" command. You would have to understand it syntax, though. 4. Libreoffice-Headless. Possibility: Medium. It is possible that package libreoffice-headless was not initially installed. This package is required by LibreOffice to run in console mode. //check whether it is installed [root@localhost ~]# yum info libreoffice-headless //if not - install it. [root@localhost ~]# yum install libreoffice-headless 5. Selinux. Possibility: VERY HIGH. Despite unindicative error messages this is the most probable culpruit of office services and consequently unoconv errors. Example error messages can look like: [Java framework] Error in function createSettingsDocument (elements.cxx). javaldx failed! Failed to connect to /usr/bin/soffice (pid=4478) in 6 seconds. Connector : couldn't connect to socket (Success) Error: Unable to connect or start own listener. Aborting. To check whether it is truly SElinux problem turn off enforcing mode: [root@localhost ~]# setenforce 0 //try to run unoconv here, once finished, restore enforcing mode [root@localhost ~]# setenforce 1 If SElinux was causing error we need to find what exactly happened. Let's look into logs: [root@localhost ~]# tail /var/log/messages You would probably see some mesages, any of these can pop out: Jan 5 07:55:00 localhost setroubleshoot: SELinux is preventing /usr/bin/python from name_connect access on the tcp_socket port 2002. For complete SELinux mess ages. run sealert -l 18e8ce5d-6a20-4de6-8e38-1f99f66f007a Jan 6 04:26:28 localhost setroubleshoot: SELinux is preventing sudo from nlmsg_ relay access on the netlink_audit_socket Unknown. For complete SELinux messages. run sealert -l a1dd5ddd-8bef-49a2-b0b1-8674e2f522aa Jan 6 04:26:28 localhost setroubleshoot: SELinux is preventing /usr/bin/python from read access on the file /root/.libreoffice/3/user/extensions/bundled/regist ry/com.sun.star.comp.deployment.component.PackageRegistryBackend/unorc. For comp lete SELinux messages. run sealert -l 7d7631c3-6b3f-4101-84e3-f3e46880af26 Jan 6 05:34:14 localhost setroubleshoot: SELinux is preventing /usr/lib64/libre office/program/soffice.bin from name_bind access on the tcp_socket port 2002. Fo r complete SELinux messages. run sealert -l 32267995-c70c-4d67-86f1-552f07ea7 557 ... and so on and so forth. For those who is interested in SElinux specific info take a look at audit log: [root@localhost ~]# tail /var/log/audit/audit.log //this one is not easy to read though Whatever, we need to explain to our angry friend we really want to use unoconv. The rest is really simple or terribly difficult, depending on what you intend to do with this problem. You can try figure out every file and process involved and handwrite SElinux policy module. Or you can use the proposal contained in the log to generate this automatically. The latter is far more simple, so we stick to this solution, though it has chances to open up some security holes. Anyway, run sealert with the parameters given in log: [root@localhost log]# sealert -l d9e5bd7c-50eb-4636-93dd-912ccf800a7e //you will get some explanations about error here and a proposal how to fix it //like for example "run the following": # grep systemd-tmpfile /var/log/audit/audit.log | audit2allow -M mypol # semodule -i mypol.pp Basically this is the way to go. However here comes the tricky part. If you use this to generate several SElinux policy modules sequentially, old module will replace the new one, since they have same names, so you will end up exactly where you started. But you need all that together. For example, judging by the previous messages we need to perform several actions like allow python socket access, allow python file access, allow libreoffice file access etc. Thus we need to group all these errors together to generate a single policy module. In my case I had to do give permissions to unoconv, libreoffice and sudo (I used it from webserver, however it turned out it was not required later): [root@localhost ~]# grep "soffice.bin\|sudo\|unoconv" /var/log/audit/audit.log | audit2allow -M phpextpol && semodule -i phpextpol.pp //"phpextpol" - can be any name you give to your security module That's all for starters. Please, refer to manpages for details. Good luck. unoconv-0.7/doc/unoconv.1000066400000000000000000000472661254733325000154100ustar00rootroot00000000000000'\" t .\" Title: unoconv .\" Author: Dag Wieers .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 20 october 2010 .\" Manual: \ \& .\" Source: \ \& 0.4 .\" Language: English .\" .TH "UNOCONV" "1" "20 october 2010" "\ \& 0\&.4" "\ \&" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" unoconv \- convert any document from and to any LibreOffice supported format .SH "SYNOPSIS" .sp \fIunoconv\fR [options] file [file2 \&.\&.] .sp \fIunoconv\fR \-\-listener [\-\-server SRV] [\-\-port PRT] [\-\-connection CON] .SH "DESCRIPTION" .sp unoconv is a command line utility that can convert any file format that LibreOffice can import, to any file format that LibreOffice is capable of exporting\&. .sp unoconv uses the LibreOffice\(cqs UNO bindings for non\-interactive conversion of documents and therefore needs an LibreOffice instance to communicate with\&. Therefore if it cannot find one, it will start its own instance for temporary usage\&. If desired, one can start a \(lqlistener\(rq instance to use for subsequent connections or even for remote connections\&. .SH "OPTIONS" .PP \-c, \-\-connection .RS 4 UNO connection string to be used by the client to connect to an LibreOffice instance, or used by the listener to make LibreOffice listen\&. .sp .if n \{\ .RS 4 .\} .nf Default connection string is "socket,host=localhost,port=2002;urp;StarOffice\&.ComponentContext" .fi .if n \{\ .RE .\} .RE .PP \-d, \-\-doctype .RS 4 Specify the LibreOffice document type of the backend format\&. Possible document types are: \fIdocument\fR, \fIgraphics\fR, \fIpresentation\fR, \fIspreadsheet\fR\&. .sp .if n \{\ .RS 4 .\} .nf Default document type is \'document\'\&. .fi .if n \{\ .RE .\} .RE .PP \-e, \-\-export .RS 4 Set specific export filter options (related to the used LibreOffice filter)\&. .sp .if n \{\ .RS 4 .\} .nf eg\&. for the PDF output filter one can specify: \-e PageRange=1\-2 .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf See the *EXPORT FILTERS* section\&. .fi .if n \{\ .RE .\} .RE .PP \-f, \-\-format .RS 4 Specify the output format for the document\&. You can get a list of possible output formats per document type by using the \-\-show option\&. .sp .if n \{\ .RS 4 .\} .nf Default document type is \'pdf\'\&. .fi .if n \{\ .RE .\} .RE .PP \-F, \-\-field .RS 4 Replace user\-defined text field with value .sp .if n \{\ .RS 4 .\} .nf eg\&. \-F Client_Name="Oracle" .fi .if n \{\ .RE .\} .RE .PP \-i, \-\-import .RS 4 Set specific import filters options (related to the used LibreOffice import filter based on the input filename)\&. .sp .if n \{\ .RS 4 .\} .nf See the *IMPORT FILTERS* section\&. .fi .if n \{\ .RE .\} .RE .PP \-l, \-\-listener .RS 4 Start unoconv as listener for unoconv clients to connect to\&. .RE .PP \-n, \-\-no\-launch .RS 4 By default if no listener is running, unoconv will launch its own (temporary) listener to make sure the conversion works\&. This option will abort the conversion if no listener is found, rather than starting our own listener\&. .RE .PP \-o, \-\-output .RS 4 If the argument is a directory, put the converted documents in this directory\&. If multiple input files are provided, use it as a basename (and add output extension)\&. Otherwise use it as the output filename\&. .RE .PP \-\-password .RS 4 Provide a password to decrypt the document .RE .PP \-\-pipe .RS 4 Use a pipe as an alternative connection mechanism to talk to LibreOffice\&. .RE .PP \-p, \-\-port .RS 4 Port to listen on (as listener) or to connect to (as client)\&. .sp .if n \{\ .RS 4 .\} .nf Default port is \'2002\'\&. .fi .if n \{\ .RE .\} .RE .PP \-\-preserve .RS 4 Keep timestamp and permissions of the original document .RE .PP \-s, \-\-server .RS 4 Server (address) to listen on (as listener) or to connect to (as client)\&. .sp .if n \{\ .RS 4 .\} .nf Default server is \'localhost\'\&. .fi .if n \{\ .RE .\} .RE .PP \-\-show .RS 4 List the possible output formats to be used with \-f\&. .RE .PP \-\-stdin .RS 4 Read input file from stdin (filenames are ignored if provided) .RE .PP \-\-stdout .RS 4 Print converted output file to stdout\&. .RE .PP \-t, \-\-template .RS 4 Specify the template to use for importing styles from\&. This can be very useful if you have a corporate identity you have to apply to every document you distribute\&. .RE .PP \-T, \-\-timeout .RS 4 When unoconv starts its own listener, try to connect to it for an amount of seconds before giving up\&. Increasing this may help when you receive random errors caused by the listener not being ready to accept conversion jobs\&. .RE .PP \-v, \-\-verbose .RS 4 Be more and more and more verbose\&. .RE .SH "ARGUMENTS" .sp You can provide one or more \fBfiles\fR as arguments to convert each of them to the specified \fBoutput format\fR\&. .SH "IMPORT FILTERS" .sp Depending on the used input file, a different LibreOffice import filter is automatically used by unoconv\&. This import filter can be influenced by the \-i option that, depending on the filter used, accepts different arguments\&. .sp It is not always clear what import filter options you can provide, the import dialog in LibreOffice for the filter you ar using might give a good indication as to what you can expect as import filter options\&. .sp The reference is LibreOffice\(cqs documentation, for spreadsheets it is described at: \m[blue]\fBhttp://wiki\&.services\&.openoffice\&.org/wiki/Documentation/DevGuide/Spreadsheets/Filter_Options\fR\m[] but we will look into some examples\&. .SH "DEFAULT IMPORT FILTER OPTIONS" .sp The default import filter for many imports (eg\&. Lotus, dBase or DIF) accepts as the only argument the input encoding\-type, so if you require utf\-8 (76) you can do: .sp .if n \{\ .RS 4 .\} .nf \-i FilterOptions=76 .fi .if n \{\ .RE .\} .sp For a list of possible encoding types, you can use the above link to find the possible options\&. .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} FilterOptions .RE .SH "TEXT IMPORT FILTER OPTIONS" .sp The Text import filter accepts a FilterOptions setting holding the input encoding\&. .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} FilterOptions .RE .SH "CSV IMPORT FILTER OPTIONS" .sp The CSV import filter accepts a FilterOptions setting, the order is: \fIseparator(s),text\-delimiter,encoding,first\-row,column\-format\fR .sp For example you might want to use this for a \fIreal\fR comma\-separated document: .sp .if n \{\ .RS 4 .\} .nf \-i FilterOptions=44,34,76,2,1/5/2/1/3/1/4/1 .fi .if n \{\ .RE .\} .sp which will use a comma (44) as the field separator, a double quote (34) as the text delimiter, UTF\-8 (76) for the input encoding, start from the second row and use the specified formats for each column (1 means standard, 5 means YY/MM/DD date) .sp If you like to use more than one separator (say a space or a tab) and use the system\(cqs encoding (9), but with no text\-delimiter, you can do: .sp .if n \{\ .RS 4 .\} .nf \-i FilterOptions=9/32,,9,2 .fi .if n \{\ .RE .\} .sp For a list of possible encoding types, you can use the above link to find the possible options\&. .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} FilterOptions .RE .SH "EXPORT FILTERS" .sp In contrast to import filters, export filters can have multiple named options, although it is not always clear what options are available\&. It all depends on the version of LibreOffice\&. The export dialog you get in LibreOffice might give you a clue about what is possible, each of those widgets represents an option\&. .SH "TEXT EXPORT FILTER OPTIONS" .sp The Text export filter accepts a FilterOptions setting holding the output encoding\&. .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} FilterOptions .RE .sp The order of the arguments is: \fIencoding,field\-seperator,text\-delimiter,quote\-all\-text\-cells,save\-cell\-content\-as\-shown\fR .SH "CSV EXPORT FILTER OPTIONS" .sp The CSV export filter accepts various arguments, the order is: \fIfield\-seperator(s),text\-delimiter,encoding\fR .sp For example you might want to use this for a \fIreal\fR comma\-separated document: .sp .if n \{\ .RS 4 .\} .nf \-e FilterOptions=44,34,76 .fi .if n \{\ .RE .\} .sp which will use a comma (44) as the field separator, a double quote (34) as the text delimiter, UTF\-8 (76) for the export encoding, start from the second row and use the specified formats for each column (1 means standard, 5 means YY/MM/DD date) .sp If you like to use more than one separator (say a space or a tab) and use the system\(cqs encoding (9), but with no text\-delimiter, you can do: .sp .if n \{\ .RS 4 .\} .nf \-e FilterOptions=9/32,,9 .fi .if n \{\ .RE .\} .sp For a list of possible encoding types, you can use the above link to find the possible options\&. .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} FilterOptions .RE .SH "PDF EXPORT FILTER OPTIONS" .sp The PDF export filter is likely the most advanced export filter in its kind with a myriad of options one can use\&. The export filter options are described in a separate document, or on LibreOffice\(cqs wiki at: .sp \m[blue]\fBhttp://wiki\&.services\&.openoffice\&.org/wiki/API/Tutorials/PDF_export\fR\m[] .sp For example one can specify: \-e PageRange=1\-2 .sp Here is a list of all options, however for more details please look in \fIfilters\&.txt\fR: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} AllowDuplicateFieldNames .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CenterWindow .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Changes .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} ConvertOOoTargetToPDFTarget .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} DisplayPDFDocumentTitle .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} DocumentOpenPassword .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} EmbedStandardFonts .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} EnableCopyingOfContent .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} EnableTextAccessForAccessibilityTools .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} EncryptFile .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} ExportBookmarks .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} ExportBookmarksToPDFDestination .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} ExportFormFields .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} ExportLinksRelativeFsys .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} ExportNotes .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} ExportNotesPages .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} FirstPageOnLeft .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} FormsType .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} HideViewerMenubar .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} HideViewerToolbar .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} HideViewerWindowControls .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} InitialPage .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} InitialView .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} IsAddStream .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} IsSkipEmptyPages .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Magnification .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} MaxImageResolution .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} OpenBookmarkLevels .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} OpenInFullScreenMode .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} PageLayout .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} PageRange .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} PDFViewSelection .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} PermissionPassword .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Printing .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Quality .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} ReduceImageResolution .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} ResizeWindowToInitialPage .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} RestrictPermissionPassword .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Selection .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} SelectPdfVersion .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} UseLosslessCompression .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} UseTaggedPDF .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} UseTransitionEffects .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Watermark .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Zoom .RE .SS "GRAPHICS EXPORT FILTER OPTIONS" .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Height .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Resolution .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Width .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBBMP EXPORT FILTER OPTIONS\fR .RS 4 .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Compression .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} RLEEncoding .RE .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBJPEG EXPORT FILTER OPTIONS\fR .RS 4 .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} ColorDepth .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Quality .RE .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBPBM/PGM/PPM EXPORT FILTER OPTIONS\fR .RS 4 .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Encoding .RE .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBPNG EXPORT FILTER OPTIONS\fR .RS 4 .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Compression .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} InterlacedMode .RE .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBGIF EXPORT FILTER OPTIONS\fR .RS 4 .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} InterlacedMode .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Transparency .RE .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBEPS EXPORT FILTER OPTIONS\fR .RS 4 .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} ColorFormat .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Compression .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Preview .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Version .RE .RE .SH "EXAMPLES" .sp You can use unoconv in standalone mode, this means that in absence of an LibreOffice listener, it will starts its own: .sp .if n \{\ .RS 4 .\} .nf unoconv \-f pdf some\-document\&.odt .fi .if n \{\ .RE .\} .sp One can use unoconv as a listener (by default localhost:2002) to let other unoconv instances connect to it: .sp .if n \{\ .RS 4 .\} .nf unoconv \-\-listener & unoconv \-f pdf some\-document\&.odt unoconv \-f doc other\-document\&.odt unoconv \-f jpg some\-image\&.png unoconv \-f xsl some\-spreadsheet\&.csv kill \-15 %\- .fi .if n \{\ .RE .\} .sp This also works on a remote host: .sp .if n \{\ .RS 4 .\} .nf unoconv \-\-listener \-\-server 1\&.2\&.3\&.4 \-\-port 4567 .fi .if n \{\ .RE .\} .sp and then connect another system to convert documents: .sp .if n \{\ .RS 4 .\} .nf unoconv \-\-server 1\&.2\&.3\&.4 \-\-port 4567 .fi .if n \{\ .RE .\} .SH "ENVIRONMENT VARIABLES" .PP UNO_PATH .RS 4 specifies what LibreOffice pyuno installation unoconv needs to use eg\&. \fI/opt/libreoffice3\&.4/basis\-link/program\fR .RE .SH "EXIT STATUS" .sp Normally, the exit status is 0 if the conversion ran successful\&. If an error has occured, the return code is most likely an error returned by LibreOffice (or its interface, called UNO) however, the error never translates to something meaningful\&. In case you like to decipher the LibreOffice errCode, look at: .sp .if n \{\ .RS 4 .\} .nf http://cgit\&.freedesktop\&.org/libreoffice/core/tree/tools/inc/tools/errcode\&.hxx http://cgit\&.freedesktop\&.org/libreoffice/core/tree/svtools/inc/svtools/sfxecode\&.hxx http://cgit\&.freedesktop\&.org/libreoffice/core/tree/svtools/inc/svtools/soerr\&.hxx .fi .if n \{\ .RE .\} .sp Using the above lists, the error code 2074 means: .sp .if n \{\ .RS 4 .\} .nf Class: 1 (ERRCODE_CLASS_ABORT) Code: 26 (ERRCODE_IO_INVALIDPARAMETER or SVSTREAM_INVALID_PARAMETER) .fi .if n \{\ .RE .\} .sp And the error code 3088 means: .sp .if n \{\ .RS 4 .\} .nf Class: 3 (ERRCODE_CLASS_NOTEXISTS) Code: 16 (ERRCODE_IO_CANTWRITE) .fi .if n \{\ .RE .\} .SH "SEE ALSO" .sp .if n \{\ .RS 4 .\} .nf convert(1), file(1), odt2txt .fi .if n \{\ .RE .\} .SH "BUGS" .sp unoconv uses the UNO bindings to connect to LibreOffice, in absence of a usable socket, it will start its own LibreOffice instance with the correct parameters\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp Please see the TODO file for known bugs and future plans\&. .sp .5v .RE .SH "REFERENCES" .sp unoconv is very useful together with the following tools: .PP Asciidoc .RS 4 \m[blue]\fBhttp://www\&.methods\&.co\&.nz/asciidoc/\fR\m[] .RE .PP asciidoc\-odf .RS 4 \m[blue]\fBhttp://github\&.com/dagwieers/asciidoc\-odf\fR\m[] .RE .PP docbook2odf .RS 4 \m[blue]\fBhttp://open\&.comsultia\&.com/docbook2odf/\fR\m[] .RE .sp A list of possible import and export formats is available from: .PP OpenOffice 2\&.1 .RS 4 \m[blue]\fBhttp://wiki\&.services\&.openoffice\&.org/wiki/Framework/Article/Filter/FilterList_OOo_2_1\fR\m[] .RE .PP OpenOffice 3\&.0 .RS 4 \m[blue]\fBhttp://wiki\&.services\&.openoffice\&.org/wiki/Framework/Article/Filter/FilterList_OOo_3_0\fR\m[] .RE .SH "AUTHOR" .sp Written by Dag Wieers, <\m[blue]\fBdag@wieers\&.com\fR\m[]\&\s-2\u[1]\d\s+2> .SH "RESOURCES" .sp Main web site: \m[blue]\fBhttp://dag\&.wieers\&.com/home\-made/unoconv/\fR\m[] .SH "COPYING" .sp Copyright (C) 2007 Dag Wieers\&. Free use of this software is granted under the terms of the GNU General Public License (GPL)\&. .SH "AUTHOR" .PP \fBDag Wieers\fR <\&dag@wieers\&.com\&> .RS 4 Author. .RE .SH "NOTES" .IP " 1." 4 dag@wieers.com .RS 4 \%mailto:dag@wieers.com .RE unoconv-0.7/doc/unoconv.1.adoc000066400000000000000000000270241254733325000163030ustar00rootroot00000000000000= unoconv(1) Dag Wieers v0.4, 20 october 2010 == NAME unoconv - convert any document from and to any LibreOffice supported format == SYNOPSIS 'unoconv' [options] file [file2 ..] 'unoconv' --listener [--server SRV] [--port PRT] [--connection CON] == DESCRIPTION unoconv is a command line utility that can convert any file format that LibreOffice can import, to any file format that LibreOffice is capable of exporting. unoconv uses the LibreOffice's UNO bindings for non-interactive conversion of documents and therefore needs an LibreOffice instance to communicate with. Therefore if it cannot find one, it will start its own instance for temporary usage. If desired, one can start a ``listener'' instance to use for subsequent connections or even for remote connections. == OPTIONS -c, --connection:: UNO connection string to be used by the client to connect to an LibreOffice instance, or used by the listener to make LibreOffice listen. + Default connection string is "socket,host=localhost,port=2002;urp;StarOffice.ComponentContext" -d, --doctype:: Specify the LibreOffice document type of the backend format. Possible document types are: 'document', 'graphics', 'presentation', 'spreadsheet'. + Default document type is 'document'. -e, --export:: Set specific export filter options (related to the used LibreOffice filter). + eg. for the PDF output filter one can specify: -e PageRange=1-2 + See the *EXPORT FILTERS* section. -f, --format:: Specify the output format for the document. You can get a list of possible output formats per document type by using the +--show+ option. + Default document type is 'pdf'. -F, --field:: Replace user-defined text field with value + eg. -F Client_Name="Oracle" -i, --import:: Set specific import filters options (related to the used LibreOffice import filter based on the input filename). + See the *IMPORT FILTERS* section. -l, --listener:: Start unoconv as listener for unoconv clients to connect to. -n, --no-launch:: By default if no listener is running, unoconv will launch its own (temporary) listener to make sure the conversion works. This option will abort the conversion if no listener is found, rather than starting our own listener. -o, --output:: If the argument is a directory, put the converted documents in this directory. If multiple input files are provided, use it as a basename (and add output extension). Otherwise use it as the output filename. --password:: Provide a password to decrypt the document --pipe:: Use a pipe as an alternative connection mechanism to talk to LibreOffice. -p, --port:: Port to listen on (as listener) or to connect to (as client). + Default port is '2002'. --preserve:: Keep timestamp and permissions of the original document -s, --server:: Server (address) to listen on (as listener) or to connect to (as client). + Default server is 'localhost'. --show:: List the possible output formats to be used with +-f+. --stdin:: Read input file from stdin (filenames are ignored if provided) --stdout:: Print converted output file to stdout. -t, --template:: Specify the template to use for importing styles from. This can be very useful if you have a corporate identity you have to apply to every document you distribute. -T, --timeout:: When unoconv starts its own listener, try to connect to it for an amount of seconds before giving up. Increasing this may help when you receive random errors caused by the listener not being ready to accept conversion jobs. -v, --verbose:: Be more and more and more verbose. == ARGUMENTS You can provide one or more *files* as arguments to convert each of them to the specified *output format*. == IMPORT FILTERS Depending on the used input file, a different LibreOffice import filter is automatically used by unoconv. This import filter can be influenced by the +-i+ option that, depending on the filter used, accepts different arguments. It is not always clear what import filter options you can provide, the import dialog in LibreOffice for the filter you ar using might give a good indication as to what you can expect as import filter options. The reference is LibreOffice's documentation, for spreadsheets it is described at: http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Spreadsheets/Filter_Options but we will look into some examples. == DEFAULT IMPORT FILTER OPTIONS The default import filter for many imports (eg. Lotus, dBase or DIF) accepts as the only argument the input encoding-type, so if you require utf-8 (76) you can do: -i FilterOptions=76 For a list of possible encoding types, you can use the above link to find the possible options. - FilterOptions == TEXT IMPORT FILTER OPTIONS The Text import filter accepts a FilterOptions setting holding the input encoding. - FilterOptions == CSV IMPORT FILTER OPTIONS The CSV import filter accepts a FilterOptions setting, the order is: 'separator(s),text-delimiter,encoding,first-row,column-format' For example you might want to use this for a 'real' comma-separated document: -i FilterOptions=44,34,76,2,1/5/2/1/3/1/4/1 which will use a comma (44) as the field separator, a double quote (34) as the text delimiter, UTF-8 (76) for the input encoding, start from the second row and use the specified formats for each column (1 means standard, 5 means YY/MM/DD date) If you like to use more than one separator (say a space or a tab) and use the system's encoding (9), but with no text-delimiter, you can do: -i FilterOptions=9/32,,9,2 For a list of possible encoding types, you can use the above link to find the possible options. - FilterOptions == EXPORT FILTERS In contrast to import filters, export filters can have multiple named options, although it is not always clear what options are available. It all depends on the version of LibreOffice. The export dialog you get in LibreOffice might give you a clue about what is possible, each of those widgets represents an option. == TEXT EXPORT FILTER OPTIONS The Text export filter accepts a FilterOptions setting holding the output encoding. - FilterOptions The order of the arguments is: 'encoding,field-seperator,text-delimiter,quote-all-text-cells,save-cell-content-as-shown' == CSV EXPORT FILTER OPTIONS The CSV export filter accepts various arguments, the order is: 'field-seperator(s),text-delimiter,encoding' For example you might want to use this for a 'real' comma-separated document: -e FilterOptions=44,34,76 which will use a comma (44) as the field separator, a double quote (34) as the text delimiter, UTF-8 (76) for the export encoding, start from the second row and use the specified formats for each column (1 means standard, 5 means YY/MM/DD date) If you like to use more than one separator (say a space or a tab) and use the system's encoding (9), but with no text-delimiter, you can do: -e FilterOptions=9/32,,9 For a list of possible encoding types, you can use the above link to find the possible options. - FilterOptions == PDF EXPORT FILTER OPTIONS The PDF export filter is likely the most advanced export filter in its kind with a myriad of options one can use. The export filter options are described in a separate document, or on LibreOffice's wiki at: http://wiki.services.openoffice.org/wiki/API/Tutorials/PDF_export For example one can specify: +-e PageRange=1-2+ Here is a list of all options, however for more details please look in 'filters.txt': - AllowDuplicateFieldNames - CenterWindow - Changes - ConvertOOoTargetToPDFTarget - DisplayPDFDocumentTitle - DocumentOpenPassword - EmbedStandardFonts - EnableCopyingOfContent - EnableTextAccessForAccessibilityTools - EncryptFile - ExportBookmarks - ExportBookmarksToPDFDestination - ExportFormFields - ExportLinksRelativeFsys - ExportNotes - ExportNotesPages - FirstPageOnLeft - FormsType - HideViewerMenubar - HideViewerToolbar - HideViewerWindowControls - InitialPage - InitialView - IsAddStream - IsSkipEmptyPages - Magnification - MaxImageResolution - OpenBookmarkLevels - OpenInFullScreenMode - PageLayout - PageRange - PDFViewSelection - PermissionPassword - Printing - Quality - ReduceImageResolution - ResizeWindowToInitialPage - RestrictPermissionPassword - Selection - SelectPdfVersion - UseLosslessCompression - UseTaggedPDF - UseTransitionEffects - Watermark - Zoom === GRAPHICS EXPORT FILTER OPTIONS - Height - Resolution - Width ==== BMP EXPORT FILTER OPTIONS - Compression - RLEEncoding ==== JPEG EXPORT FILTER OPTIONS - ColorDepth - Quality ==== PBM/PGM/PPM EXPORT FILTER OPTIONS - Encoding ==== PNG EXPORT FILTER OPTIONS - Compression - InterlacedMode ==== GIF EXPORT FILTER OPTIONS - InterlacedMode - Transparency ==== EPS EXPORT FILTER OPTIONS - ColorFormat - Compression - Preview - Version == EXAMPLES You can use unoconv in standalone mode, this means that in absence of an LibreOffice listener, it will starts its own: unoconv -f pdf some-document.odt One can use unoconv as a listener (by default localhost:2002) to let other unoconv instances connect to it: unoconv --listener & unoconv -f pdf some-document.odt unoconv -f doc other-document.odt unoconv -f jpg some-image.png unoconv -f xsl some-spreadsheet.csv kill -15 %- This also works on a remote host: unoconv --listener --server 1.2.3.4 --port 4567 and then connect another system to convert documents: unoconv --server 1.2.3.4 --port 4567 == ENVIRONMENT VARIABLES UNO_PATH:: specifies what LibreOffice pyuno installation unoconv needs to use eg. _/opt/libreoffice3.4/basis-link/program_ == EXIT STATUS Normally, the exit status is 0 if the conversion ran successful. If an error has occured, the return code is most likely an error returned by LibreOffice (or its interface, called UNO) however, the error never translates to something meaningful. In case you like to decipher the LibreOffice errCode, look at: http://cgit.freedesktop.org/libreoffice/core/tree/tools/inc/tools/errcode.hxx http://cgit.freedesktop.org/libreoffice/core/tree/svtools/inc/svtools/sfxecode.hxx http://cgit.freedesktop.org/libreoffice/core/tree/svtools/inc/svtools/soerr.hxx Using the above lists, the error code 2074 means: Class: 1 (ERRCODE_CLASS_ABORT) Code: 26 (ERRCODE_IO_INVALIDPARAMETER or SVSTREAM_INVALID_PARAMETER) And the error code 3088 means: Class: 3 (ERRCODE_CLASS_NOTEXISTS) Code: 16 (ERRCODE_IO_CANTWRITE) == SEE ALSO convert(1), file(1), odt2txt == BUGS unoconv uses the UNO bindings to connect to LibreOffice, in absence of a usable socket, it will start its own LibreOffice instance with the correct parameters. [NOTE] Please see the TODO file for known bugs and future plans. == REFERENCES unoconv is very useful together with the following tools: Asciidoc:: http://www.methods.co.nz/asciidoc/ asciidoc-odf:: http://github.com/dagwieers/asciidoc-odf docbook2odf:: http://open.comsultia.com/docbook2odf/ A list of possible import and export formats is available from: OpenOffice 2.1:: http://wiki.services.openoffice.org/wiki/Framework/Article/Filter/FilterList_OOo_2_1 OpenOffice 3.0:: http://wiki.services.openoffice.org/wiki/Framework/Article/Filter/FilterList_OOo_3_0 == AUTHOR Written by Dag Wieers, == RESOURCES Main web site: http://dag.wieers.com/home-made/unoconv/[] == COPYING Copyright \(C) 2007 Dag Wieers. Free use of this software is granted under the terms of the GNU General Public License (GPL). // vim: set syntax=asciidoc unoconv-0.7/packaging/000077500000000000000000000000001254733325000147775ustar00rootroot00000000000000unoconv-0.7/packaging/rpm/000077500000000000000000000000001254733325000155755ustar00rootroot00000000000000unoconv-0.7/packaging/rpm/unoconv.spec000066400000000000000000000035511254733325000201440ustar00rootroot00000000000000%define rpmrelease %nil Summary: Tool to convert between any document format supported by LibreOffice Name: unoconv Version: 0.7 Release: 1%{?rpmrelease}%{?dist} License: GPL Group: System Environment/Base URL: http://dag.wieers.com/home-made/unoconv/ Source: https://github.com/downloads/dagwieers/unoconv/unoconv-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildArch: noarch BuildRequires: python >= 2.0 Requires: python >= 2.0 %description unoconv converts between any document format that LibreOffice understands. It uses LibreOffice's UNO bindings for non-interactive conversion of documents. Supported document formats include: Open Document Text (.odt), Open Document Draw (.odd), Open Document Presentation (.odp), Open Document calc (.odc), MS Word (.doc), MS PowerPoint (.pps/.ppt), MS Excel (.xls), MS Office Open/OOXML (.xml), Portable Document Format (.pdf), DocBook (.xml), LaTeX (.ltx), HTML, XHTML, RTF, Docbook (.xml), GIF, PNG, JPG, SVG, BMP, EPS and many more... %prep %setup %build %{__make} doc %install %{__rm} -rf %{buildroot} %{__make} install DESTDIR="%{buildroot}" %clean %{__rm} -rf %{buildroot} %files %defattr(-, root, root, 0755) %doc AUTHORS ChangeLog COPYING README* doc/*.adoc doc/*.html %doc %{_mandir}/man1/unoconv.1* %{_bindir}/unoconv %changelog * Thu Jul 09 2015 Dag Wieers - 0.7-1 - Updated to release 0.7. * Mon Sep 10 2012 Dag Wieers - 0.6-1 - Updated to release 0.6. * Mon Apr 16 2012 Dag Wieers - 0.5-1 - Updated to release 0.5. * Wed Oct 20 2010 Dag Wieers - 0.4-1 - Updated to release 0.4. * Fri Aug 31 2007 Dag Wieers - 0.3-1 - Updated to release 0.3. * Sun May 20 2007 Dag Wieers - 0.2-1 - Updated to release 0.2. * Sat May 19 2007 Dag Wieers - 0.1-1 - Initial package. (using DAR) unoconv-0.7/tests/000077500000000000000000000000001254733325000142155ustar00rootroot00000000000000unoconv-0.7/tests/Makefile000066400000000000000000000016311254733325000156560ustar00rootroot00000000000000### Please modify and send me improvements python=/opt/libreoffice4.4/program/python unoconv=../unoconv all: clean doc6 doc95 doc docbook fodt html mediawiki ooxml pdf rtf sdw3 sdw4 sdw sxw text txt uot xhtml @echo "== Tests finished." #xml: curriculum-vitae-dag-wieers.txt # asciidoc -b docbook -d article curriculum-vitae-dag-wieers.txt #odt: xml # rm -f curriculum-vitae-dag-wieers.odt # docbook2odf --params generate.meta=0 curriculum-vitae-dag-wieers.xml %: # -killall ooffice soffice.bin @echo "- Convert document-example.odt to $@..." -$(python) $(unoconv) -vvv -p 2002 -f $@ document-example.odt @echo # @ps aux | grep office # -unoconv -f $@ dag.gif # docbook2pdf -d curriculum-vitae.dsl#print curriculum-vitae-dag-wieers.xml clean: @echo "== Tests started. (some may fail)" @rm -f *.{bib,doc,html,pdb,pdf,psw,rtf,ltx,sdw,sxw,txt,xml} @rm -f *.{jpg,png,svg,wmf} @rm -f *.{xls} @rm -f *.{pps,ppt} unoconv-0.7/tests/dag.gif000066400000000000000000000026121254733325000154400ustar00rootroot00000000000000GIF89a/@RRRRRRRRRRRRRRRRRRR!,/@-H@ *\Ȱ #J\ċ%hcx$S ԈR%I.SŒ9$#PӣN=1 *t'ы3UFqA+@xP!bO;.8U\8!NEBPp@خ5g,@8AgK暭 dMu(# @')y@PA1]˓F R kOPPrx : D{0x.ZW-c@`'gw+A! )>\Qjd P`%pYVBXQ'[zo]_F &T~IȓNwنd bI`b/>h.2_v!VYgYYDVa YwGD:"bU d"+J%]IYMZf-P ؍LҖfz @B޸YL Bz`Bx%Idji)aA !jJejAe0bqNd]',+J^&$f]E#2ڭz:nݮ.q^˜֭ n8;unoconv-0.7/tests/document-example.odt000066400000000000000000001271511254733325000202030ustar00rootroot00000000000000PK@yF@^2 ''mimetypeapplication/vnd.oasis.opendocument.textPK@yF@];;meta.xml Curriculum Vitae - Dag Wieërs Linux System Engineer, Linux System Administrator, Linux System Architect, UNIX System Engineer, RPM Packager, Python developer, Red Hat Enterprise Linux, RHEL, CentOS, Perl developer, Bash, KSH, Shell scripting, UNIX System Engineer Dag Wieërs is an experienced Linux system engineer and system architect, focusing on Red Hat Enterprise Linux and CentOS. Dag is also a well known RPM packager due to his efforts in the RPMforge and ELRepo repositories which is used by many Belgian and international organizations using RHEL or CentOS. 2012-02-06T00:00:00 2012-02-06T00:00:00 en LibreOffice/3.5$Linux_X86_64 LibreOffice_project/7e68ba2-a744ebf-1f241b7-c506db1-7d53735 Linux System Engineer, Linux System Administrator, Linux System Architect, UNIX System Engineer, RPM Packager, Python developer, Red Hat Enterprise Linux, RHEL, CentOS, Perl developer, Bash, KSH, Shell scripting, UNIX System Engineer PK@yF@ settings.xmlYrH}߯pΦ\k&%pHHǵ6H4QjfdGO.}率OL<6&8;N#%&7ä{G5f2fLQS#_GӬn& #MEi&倫ך/n`ՕtFc>?#4.գL&~ EDk BuF;84+[5@q*-d6'ew!k;?PPewaίE_lfևGԇ G4A̱T`fCHeuainb%}&!~ECBjv"ʇU8 -J\D|ЎЛ=V۰t.6}1u[ם=3;aӶ0"5T2pWdPXЇgPJP/)p $*Uy8Ɩ!(tO[a-l<(mz'Eɗ&C%"HIŠ=<{ 5";@e]ҙBk[aŔӳCY&024_hSvgJpq& AG|rμK+" Mk0@MXiR⊿o.aKiRG)c@l3Acha-[5Tv)E K,KO=h;Z.|>po6ժ=yǚ(gPc/#؜R͐k/OQ\Aw5ec1j6x%%aw:L ˕^O"22:u1(FScm>/P}@-@/bvGX:1:?ӨkxPYݴbVð#TT(_ۏ[-(i^FZcVy>R2zb,G͏Z>ƫ>nPKtCUPK@yF@ content.xml=r#uwE&`7en&c)DUa"wh}Q"a˥,D 3ni@TV./_=_&~GnY _jj0.G/ ^:__;N4a~Xr_}y߾,D &B@Lo[kt ^ru¼n-YUNv:R͇"o;镆>Ґ/@qqeaӃJe6gFZۭ1N\o:1LVjZ֝AɀQCCv"nGkPi6T6pm'4YN^IޱnUNk !bPfPnZmVs곀,HUwPω1.&jQbH1#"~Wڮ8;c6Ier2~aL[MEƈZq8ֳ;UG뮬 4*x[fdЭJ1rY.鰻) 8΄zHqAuV&|!Aws8R6U8zf*^YyFV!Ґ:2Ǔ~W\L3pAjVpon*?a?ЏS_t*/RutA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ᗥNM>ϙTEvb4F%S,3˻n Q٭Htm;SCu5|su ˤLGo#++Xu76QԷ%{p{`Yf`%wDtG^\%D<-]\Ko={ydTMeOK?[W"PK/OG DPK@yF@META-INF/manifest.xmln0 (L-}b^IK^7^c9nj+]H< dx{q+;C%P0T߼G9F_i9(ZTƻC{R(~-A? !qi D_7o;{& 812Y;6 from __future__ import print_function from distutils.version import LooseVersion import getopt import glob import os import subprocess import sys import time __version__ = '0.7' doctypes = ('document', 'graphics', 'presentation', 'spreadsheet') global convertor, office, ooproc, product ooproc = None uno = unohelper = None exitcode = 0 class Office: def __init__(self, basepath, urepath, unopath, pyuno, binary, python, pythonhome): self.basepath = basepath self.urepath = urepath self.unopath = unopath self.pyuno = pyuno self.binary = binary self.python = python self.pythonhome = pythonhome def __str__(self): return self.basepath def __repr__(self): return self.basepath ### Implement a path normalizer in order to make unoconv work on MacOS X ### (on which 'program' is a symlink to 'MacOSX' which seems to break unoconv) def realpath(*args): ''' Implement a combination of os.path.join(), os.path.abspath() and os.path.realpath() in order to normalize path constructions ''' ret = '' for arg in args: ret = os.path.join(ret, arg) return os.path.realpath(os.path.abspath(ret)) ### The first thing we ought to do is find a suitable Office installation ### with a compatible pyuno library that we can import. ### ### See: http://user.services.openoffice.org/en/forum/viewtopic.php?f=45&t=36370&p=166783 def find_offices(): ret = [] extrapaths = [] ### Try using UNO_PATH first (in many incarnations, we'll see what sticks) if 'UNO_PATH' in os.environ: extrapaths += [ os.environ['UNO_PATH'], os.path.dirname(os.environ['UNO_PATH']), os.path.dirname(os.path.dirname(os.environ['UNO_PATH'])) ] else: if os.name in ( 'nt', 'os2' ): if 'PROGRAMFILES' in list(os.environ.keys()): extrapaths += glob.glob(os.environ['PROGRAMFILES']+'\\LibreOffice*') + \ glob.glob(os.environ['PROGRAMFILES']+'\\OpenOffice.org*') if 'PROGRAMFILES(X86)' in list(os.environ.keys()): extrapaths += glob.glob(os.environ['PROGRAMFILES(X86)']+'\\LibreOffice*') + \ glob.glob(os.environ['PROGRAMFILES(X86)']+'\\OpenOffice.org*') elif os.name in ( 'mac', ) or sys.platform in ( 'darwin', ): extrapaths += [ '/Applications/LibreOffice.app/Contents', '/Applications/NeoOffice.app/Contents', '/Applications/OpenOffice.app/Contents', '/Applications/OpenOffice.org.app/Contents' ] else: extrapaths += glob.glob('/usr/lib*/libreoffice*') + \ glob.glob('/usr/lib*/openoffice*') + \ glob.glob('/usr/lib*/ooo*') + \ glob.glob('/opt/libreoffice*') + \ glob.glob('/opt/openoffice*') + \ glob.glob('/opt/ooo*') + \ glob.glob('/usr/local/libreoffice*') + \ glob.glob('/usr/local/openoffice*') + \ glob.glob('/usr/local/ooo*') + \ glob.glob('/usr/local/lib/libreoffice*') ### Find a working set for python UNO bindings for basepath in extrapaths: if os.name in ( 'nt', 'os2' ): officelibraries = ( 'pyuno.pyd', ) officebinaries = ( 'soffice.exe' ,) pythonbinaries = ( 'python.exe', ) pythonhomes = () elif os.name in ( 'mac', ) or sys.platform in ( 'darwin', ): officelibraries = ( 'pyuno.so', 'libpyuno.dylib' ) officebinaries = ( 'soffice.bin', 'soffice') pythonbinaries = ( 'python.bin', 'python' ) pythonhomes = ( 'OOoPython.framework/Versions/*/lib/python*', ) else: officelibraries = ( 'pyuno.so', ) officebinaries = ( 'soffice.bin', ) pythonbinaries = ( 'python.bin', 'python', ) pythonhomes = ( 'python-core-*', ) ### Older LibreOffice/OpenOffice and Windows use basis-link/ or basis/ libpath = 'error' for basis in ( 'basis-link', 'basis', '' ): for lib in officelibraries: if os.path.isfile(realpath(basepath, basis, 'program', lib)): libpath = realpath(basepath, basis, 'program') officelibrary = realpath(libpath, lib) info(3, "Found %s in %s" % (lib, libpath)) # Break the inner loop... break # Continue if the inner loop wasn't broken. else: continue # Inner loop was broken, break the outer. break else: continue ### MacOSX have soffice binaries installed in MacOS subdirectory, not program unopath = 'error' for basis in ( 'basis-link', 'basis', '' ): for bin in officebinaries: if os.path.isfile(realpath(basepath, basis, 'program', bin)): unopath = realpath(basepath, basis, 'program') officebinary = realpath(unopath, bin) info(3, "Found %s in %s" % (bin, unopath)) # Break the inner loop... break # Continue if the inner loop wasn't broken. else: continue # Inner loop was broken, break the outer. break else: continue ### Windows does not provide or need a URE/lib directory ? urepath = '' for basis in ( 'basis-link', 'basis', '' ): for ure in ( 'ure-link', 'ure', 'URE', '' ): if os.path.isfile(realpath(basepath, basis, ure, 'lib', 'unorc')): urepath = realpath(basepath, basis, ure) info(3, "Found %s in %s" % ('unorc', realpath(urepath, 'lib'))) # Break the inner loop... break # Continue if the inner loop wasn't broken. else: continue # Inner loop was broken, break the outer. break pythonhome = None for home in pythonhomes: if glob.glob(realpath(libpath, home)): pythonhome = glob.glob(realpath(libpath, home))[0] info(3, "Found %s in %s" % (home, pythonhome)) break # if not os.path.isfile(realpath(basepath, program, officebinary)): # continue # info(3, "Found %s in %s" % (officebinary, realpath(basepath, program))) # if not glob.glob(realpath(basepath, basis, program, 'python-core-*')): # continue for pythonbinary in pythonbinaries: if os.path.isfile(realpath(unopath, pythonbinary)): info(3, "Found %s in %s" % (pythonbinary, unopath)) ret.append(Office(basepath, urepath, unopath, officelibrary, officebinary, realpath(unopath, pythonbinary), pythonhome)) else: info(3, "Considering %s" % basepath) ret.append(Office(basepath, urepath, unopath, officelibrary, officebinary, sys.executable, None)) return ret def office_environ(office): ### Set PATH so that crash_report is found if 'PATH' in os.environ: os.environ['PATH'] = realpath(office.basepath, 'program') + os.pathsep + os.environ['PATH'] else: os.environ['PATH'] = realpath(office.basepath, 'program') ### Set UNO_PATH so that "officehelper.bootstrap()" can find soffice executable: os.environ['UNO_PATH'] = office.unopath ### Set URE_BOOTSTRAP so that "uno.getComponentContext()" bootstraps a complete ### UNO environment if os.name in ( 'nt', 'os2' ): os.environ['URE_BOOTSTRAP'] = 'vnd.sun.star.pathname:' + realpath(office.basepath, 'program', 'fundamental.ini') else: os.environ['URE_BOOTSTRAP'] = 'vnd.sun.star.pathname:' + realpath(office.basepath, 'program', 'fundamentalrc') ### Set LD_LIBRARY_PATH so that "import pyuno" finds libpyuno.so: if 'LD_LIBRARY_PATH' in os.environ: os.environ['LD_LIBRARY_PATH'] = office.unopath + os.pathsep + \ realpath(office.urepath, 'lib') + os.pathsep + \ os.environ['LD_LIBRARY_PATH'] else: os.environ['LD_LIBRARY_PATH'] = office.unopath + os.pathsep + \ realpath(office.urepath, 'lib') if office.pythonhome: for libpath in ( realpath(office.pythonhome, 'lib'), realpath(office.pythonhome, 'lib', 'lib-dynload'), realpath(office.pythonhome, 'lib', 'lib-tk'), realpath(office.pythonhome, 'lib', 'site-packages'), office.unopath): sys.path.insert(0, libpath) else: ### Still needed for system python using LibreOffice UNO bindings ### Although we prefer to use a system UNO binding in this case sys.path.append(office.unopath) def debug_office(): if 'URE_BOOTSTRAP' in os.environ: print('URE_BOOTSTRAP=%s' % os.environ['URE_BOOTSTRAP'], file=sys.stderr) if 'UNO_PATH' in os.environ: print('UNO_PATH=%s' % os.environ['UNO_PATH'], file=sys.stderr) if 'UNO_TYPES' in os.environ: print('UNO_TYPES=%s' % os.environ['UNO_TYPES'], file=sys.stderr) print('PATH=%s' % os.environ['PATH']) if 'PYTHONHOME' in os.environ: print('PYTHONHOME=%s' % os.environ['PYTHONHOME'], file=sys.stderr) if 'PYTHONPATH' in os.environ: print('PYTHONPATH=%s' % os.environ['PYTHONPATH'], file=sys.stderr) if 'LD_LIBRARY_PATH' in os.environ: print('LD_LIBRARY_PATH=%s' % os.environ['LD_LIBRARY_PATH'], file=sys.stderr) def python_switch(office): if office.pythonhome: os.environ['PYTHONHOME'] = office.pythonhome os.environ['PYTHONPATH'] = realpath(office.pythonhome, 'lib') + os.pathsep + \ realpath(office.pythonhome, 'lib', 'lib-dynload') + os.pathsep + \ realpath(office.pythonhome, 'lib', 'lib-tk') + os.pathsep + \ realpath(office.pythonhome, 'lib', 'site-packages') + os.pathsep + \ office.unopath os.environ['UNO_PATH'] = office.unopath info(3, "-> Switching from %s to %s" % (sys.executable, office.python)) if os.name in ('nt', 'os2'): ### os.execv is broken on Windows and can't properly parse command line ### arguments and executable name if they contain whitespaces. subprocess ### fixes that behavior. ret = subprocess.call([office.python, ] + sys.argv[0:]) sys.exit(ret) else: ### Set LD_LIBRARY_PATH so that "import pyuno" finds libpyuno.so: if 'LD_LIBRARY_PATH' in os.environ: os.environ['LD_LIBRARY_PATH'] = office.unopath + os.pathsep + \ realpath(office.urepath, 'lib') + os.pathsep + \ os.environ['LD_LIBRARY_PATH'] else: os.environ['LD_LIBRARY_PATH'] = office.unopath + os.pathsep + \ realpath(office.urepath, 'lib') try: os.execvpe(office.python, [office.python, ] + sys.argv[0:], os.environ) except OSError: ### Mac OS X versions prior to 10.6 do not support execv in ### a process that contains multiple threads. Instead of ### re-executing in the current process, start a new one ### and cause the current process to exit. This isn't ### ideal since the new process is detached from the parent ### terminal and thus cannot easily be killed with ctrl-C, ### but it's better than not being able to autoreload at ### all. ### Unfortunately the errno returned in this case does not ### appear to be consistent, so we can't easily check for ### this error specifically. ret = os.spawnvpe(os.P_WAIT, office.python, [office.python, ] + sys.argv[0:], os.environ) sys.exit(ret) class Fmt: def __init__(self, doctype, name, extension, summary, filter): self.doctype = doctype self.name = name self.extension = extension self.summary = summary self.filter = filter def __str__(self): return "%s [.%s]" % (self.summary, self.extension) def __repr__(self): return "%s/%s" % (self.name, self.doctype) class FmtList: def __init__(self): self.list = [] def add(self, doctype, name, extension, summary, filter): self.list.append(Fmt(doctype, name, extension, summary, filter)) def byname(self, name): ret = [] for fmt in self.list: if fmt.name == name: ret.append(fmt) return ret def byextension(self, extension): ret = [] for fmt in self.list: if os.extsep + fmt.extension == extension: ret.append(fmt) return ret def bydoctype(self, doctype, name): ret = [] for fmt in self.list: if fmt.name == name and fmt.doctype == doctype: ret.append(fmt) return ret def display(self, doctype): print("The following list of %s formats are currently available:\n" % doctype, file=sys.stderr) for fmt in self.list: if fmt.doctype == doctype: print(" %-8s - %s" % (fmt.name, fmt), file=sys.stderr) print(file=sys.stderr) fmts = FmtList() ### TextDocument fmts.add('document', 'bib', 'bib', 'BibTeX', 'BibTeX_Writer') ### 22 fmts.add('document', 'doc', 'doc', 'Microsoft Word 97/2000/XP', 'MS Word 97') ### 29 fmts.add('document', 'doc6', 'doc', 'Microsoft Word 6.0', 'MS WinWord 6.0') ### 24 fmts.add('document', 'doc95', 'doc', 'Microsoft Word 95', 'MS Word 95') ### 28 fmts.add('document', 'docbook', 'xml', 'DocBook', 'DocBook File') ### 39 fmts.add('document', 'docx', 'docx', 'Microsoft Office Open XML', 'Office Open XML Text') fmts.add('document', 'docx7', 'docx', 'Microsoft Office Open XML', 'MS Word 2007 XML') fmts.add('document', 'fodt', 'fodt', 'OpenDocument Text (Flat XML)', 'OpenDocument Text Flat XML') fmts.add('document', 'html', 'html', 'HTML Document (OpenOffice.org Writer)', 'HTML (StarWriter)') ### 3 fmts.add('document', 'latex', 'ltx', 'LaTeX 2e', 'LaTeX_Writer') ### 31 fmts.add('document', 'mediawiki', 'txt', 'MediaWiki', 'MediaWiki') fmts.add('document', 'odt', 'odt', 'ODF Text Document', 'writer8') ### 10 fmts.add('document', 'ooxml', 'xml', 'Microsoft Office Open XML', 'MS Word 2003 XML') ### 11 fmts.add('document', 'ott', 'ott', 'Open Document Text', 'writer8_template') ### 21 fmts.add('document', 'pdb', 'pdb', 'AportisDoc (Palm)', 'AportisDoc Palm DB') fmts.add('document', 'pdf', 'pdf', 'Portable Document Format', 'writer_pdf_Export') ### 18 fmts.add('document', 'psw', 'psw', 'Pocket Word', 'PocketWord File') fmts.add('document', 'rtf', 'rtf', 'Rich Text Format', 'Rich Text Format') ### 16 fmts.add('document', 'sdw', 'sdw', 'StarWriter 5.0', 'StarWriter 5.0') ### 23 fmts.add('document', 'sdw4', 'sdw', 'StarWriter 4.0', 'StarWriter 4.0') ### 2 fmts.add('document', 'sdw3', 'sdw', 'StarWriter 3.0', 'StarWriter 3.0') ### 20 fmts.add('document', 'stw', 'stw', 'Open Office.org 1.0 Text Document Template', 'writer_StarOffice_XML_Writer_Template') ### 9 fmts.add('document', 'sxw', 'sxw', 'Open Office.org 1.0 Text Document', 'StarOffice XML (Writer)') ### 1 fmts.add('document', 'text', 'txt', 'Text Encoded', 'Text (encoded)') ### 26 fmts.add('document', 'txt', 'txt', 'Text', 'Text') ### 34 fmts.add('document', 'uot', 'uot', 'Unified Office Format text','UOF text') ### 27 fmts.add('document', 'vor', 'vor', 'StarWriter 5.0 Template', 'StarWriter 5.0 Vorlage/Template') ### 6 fmts.add('document', 'vor4', 'vor', 'StarWriter 4.0 Template', 'StarWriter 4.0 Vorlage/Template') ### 5 fmts.add('document', 'vor3', 'vor', 'StarWriter 3.0 Template', 'StarWriter 3.0 Vorlage/Template') ### 4 fmts.add('document', 'wps', 'wps', 'Microsoft Works', 'MS_Works') fmts.add('document', 'xhtml', 'html', 'XHTML Document', 'XHTML Writer File') ### 33 ### WebDocument fmts.add('web', 'etext', 'txt', 'Text Encoded (OpenOffice.org Writer/Web)', 'Text (encoded) (StarWriter/Web)') ### 14 fmts.add('web', 'html10', 'html', 'OpenOffice.org 1.0 HTML Template', 'writer_web_StarOffice_XML_Writer_Web_Template') ### 11 fmts.add('web', 'html', 'html', 'HTML Document', 'HTML') ### 2 fmts.add('web', 'html', 'html', 'HTML Document Template', 'writerweb8_writer_template') ### 13 fmts.add('web', 'mediawiki', 'txt', 'MediaWiki', 'MediaWiki_Web') ### 9 fmts.add('web', 'pdf', 'pdf', 'PDF - Portable Document Format', 'writer_web_pdf_Export') ### 10 fmts.add('web', 'sdw3', 'sdw', 'StarWriter 3.0 (OpenOffice.org Writer/Web)', 'StarWriter 3.0 (StarWriter/Web)') ### 3 fmts.add('web', 'sdw4', 'sdw', 'StarWriter 4.0 (OpenOffice.org Writer/Web)', 'StarWriter 4.0 (StarWriter/Web)') ### 4 fmts.add('web', 'sdw', 'sdw', 'StarWriter 5.0 (OpenOffice.org Writer/Web)', 'StarWriter 5.0 (StarWriter/Web)') ### 5 fmts.add('web', 'txt', 'txt', 'OpenOffice.org Text (OpenOffice.org Writer/Web)', 'writerweb8_writer') ### 12 fmts.add('web', 'text10', 'txt', 'OpenOffice.org 1.0 Text Document (OpenOffice.org Writer/Web)', 'writer_web_StarOffice_XML_Writer') ### 15 fmts.add('web', 'text', 'txt', 'Text (OpenOffice.org Writer/Web)', 'Text (StarWriter/Web)') ### 8 fmts.add('web', 'vor4', 'vor', 'StarWriter/Web 4.0 Template', 'StarWriter/Web 4.0 Vorlage/Template') ### 6 fmts.add('web', 'vor', 'vor', 'StarWriter/Web 5.0 Template', 'StarWriter/Web 5.0 Vorlage/Template') ### 7 ### Spreadsheet fmts.add('spreadsheet', 'csv', 'csv', 'Text CSV', 'Text - txt - csv (StarCalc)') ### 16 fmts.add('spreadsheet', 'dbf', 'dbf', 'dBASE', 'dBase') ### 22 fmts.add('spreadsheet', 'dif', 'dif', 'Data Interchange Format', 'DIF') ### 5 fmts.add('spreadsheet', 'fods', 'fods', 'OpenDocument Spreadsheet (Flat XML)', 'OpenDocument Spreadsheet Flat XML') fmts.add('spreadsheet', 'html', 'html', 'HTML Document (OpenOffice.org Calc)', 'HTML (StarCalc)') ### 7 fmts.add('spreadsheet', 'ods', 'ods', 'ODF Spreadsheet', 'calc8') ### 15 fmts.add('spreadsheet', 'ooxml', 'xml', 'Microsoft Excel 2003 XML', 'MS Excel 2003 XML') ### 23 fmts.add('spreadsheet', 'ots', 'ots', 'ODF Spreadsheet Template', 'calc8_template') ### 14 fmts.add('spreadsheet', 'pdf', 'pdf', 'Portable Document Format', 'calc_pdf_Export') ### 34 fmts.add('spreadsheet', 'pxl', 'pxl', 'Pocket Excel', 'Pocket Excel') fmts.add('spreadsheet', 'sdc', 'sdc', 'StarCalc 5.0', 'StarCalc 5.0') ### 31 fmts.add('spreadsheet', 'sdc4', 'sdc', 'StarCalc 4.0', 'StarCalc 4.0') ### 11 fmts.add('spreadsheet', 'sdc3', 'sdc', 'StarCalc 3.0', 'StarCalc 3.0') ### 29 fmts.add('spreadsheet', 'slk', 'slk', 'SYLK', 'SYLK') ### 35 fmts.add('spreadsheet', 'stc', 'stc', 'OpenOffice.org 1.0 Spreadsheet Template', 'calc_StarOffice_XML_Calc_Template') ### 2 fmts.add('spreadsheet', 'sxc', 'sxc', 'OpenOffice.org 1.0 Spreadsheet', 'StarOffice XML (Calc)') ### 3 fmts.add('spreadsheet', 'uos', 'uos', 'Unified Office Format spreadsheet', 'UOF spreadsheet') ### 9 fmts.add('spreadsheet', 'vor3', 'vor', 'StarCalc 3.0 Template', 'StarCalc 3.0 Vorlage/Template') ### 18 fmts.add('spreadsheet', 'vor4', 'vor', 'StarCalc 4.0 Template', 'StarCalc 4.0 Vorlage/Template') ### 19 fmts.add('spreadsheet', 'vor', 'vor', 'StarCalc 5.0 Template', 'StarCalc 5.0 Vorlage/Template') ### 20 fmts.add('spreadsheet', 'xhtml', 'xhtml', 'XHTML', 'XHTML Calc File') ### 26 fmts.add('spreadsheet', 'xls', 'xls', 'Microsoft Excel 97/2000/XP', 'MS Excel 97') ### 12 fmts.add('spreadsheet', 'xls5', 'xls', 'Microsoft Excel 5.0', 'MS Excel 5.0/95') ### 8 fmts.add('spreadsheet', 'xls95', 'xls', 'Microsoft Excel 95', 'MS Excel 95') ### 10 fmts.add('spreadsheet', 'xlt', 'xlt', 'Microsoft Excel 97/2000/XP Template', 'MS Excel 97 Vorlage/Template') ### 6 fmts.add('spreadsheet', 'xlt5', 'xlt', 'Microsoft Excel 5.0 Template', 'MS Excel 5.0/95 Vorlage/Template') ### 28 fmts.add('spreadsheet', 'xlt95', 'xlt', 'Microsoft Excel 95 Template', 'MS Excel 95 Vorlage/Template') ### 21 fmts.add('spreadsheet', 'xlsx', 'xlsx', 'Microsoft Excel 2007/2010 XML', 'Calc MS Excel 2007 XML') ### Graphics fmts.add('graphics', 'bmp', 'bmp', 'Windows Bitmap', 'draw_bmp_Export') ### 21 fmts.add('graphics', 'emf', 'emf', 'Enhanced Metafile', 'draw_emf_Export') ### 15 fmts.add('graphics', 'eps', 'eps', 'Encapsulated PostScript', 'draw_eps_Export') ### 48 fmts.add('graphics', 'fodg', 'fodg', 'OpenDocument Drawing (Flat XML)', 'OpenDocument Drawing Flat XML') fmts.add('graphics', 'gif', 'gif', 'Graphics Interchange Format', 'draw_gif_Export') ### 30 fmts.add('graphics', 'html', 'html', 'HTML Document (OpenOffice.org Draw)', 'draw_html_Export') ### 37 fmts.add('graphics', 'jpg', 'jpg', 'Joint Photographic Experts Group', 'draw_jpg_Export') ### 3 fmts.add('graphics', 'met', 'met', 'OS/2 Metafile', 'draw_met_Export') ### 43 fmts.add('graphics', 'odd', 'odd', 'OpenDocument Drawing', 'draw8') ### 6 fmts.add('graphics', 'otg', 'otg', 'OpenDocument Drawing Template', 'draw8_template') ### 20 fmts.add('graphics', 'pbm', 'pbm', 'Portable Bitmap', 'draw_pbm_Export') ### 14 fmts.add('graphics', 'pct', 'pct', 'Mac Pict', 'draw_pct_Export') ### 41 fmts.add('graphics', 'pdf', 'pdf', 'Portable Document Format', 'draw_pdf_Export') ### 28 fmts.add('graphics', 'pgm', 'pgm', 'Portable Graymap', 'draw_pgm_Export') ### 11 fmts.add('graphics', 'png', 'png', 'Portable Network Graphic', 'draw_png_Export') ### 2 fmts.add('graphics', 'ppm', 'ppm', 'Portable Pixelmap', 'draw_ppm_Export') ### 5 fmts.add('graphics', 'ras', 'ras', 'Sun Raster Image', 'draw_ras_Export') ## 31 fmts.add('graphics', 'std', 'std', 'OpenOffice.org 1.0 Drawing Template', 'draw_StarOffice_XML_Draw_Template') ### 53 fmts.add('graphics', 'svg', 'svg', 'Scalable Vector Graphics', 'draw_svg_Export') ### 50 fmts.add('graphics', 'svm', 'svm', 'StarView Metafile', 'draw_svm_Export') ### 55 fmts.add('graphics', 'swf', 'swf', 'Macromedia Flash (SWF)', 'draw_flash_Export') ### 23 fmts.add('graphics', 'sxd', 'sxd', 'OpenOffice.org 1.0 Drawing', 'StarOffice XML (Draw)') ### 26 fmts.add('graphics', 'sxd3', 'sxd', 'StarDraw 3.0', 'StarDraw 3.0') ### 40 fmts.add('graphics', 'sxd5', 'sxd', 'StarDraw 5.0', 'StarDraw 5.0') ### 44 fmts.add('graphics', 'sxw', 'sxw', 'StarOffice XML (Draw)', 'StarOffice XML (Draw)') fmts.add('graphics', 'tiff', 'tiff', 'Tagged Image File Format', 'draw_tif_Export') ### 13 fmts.add('graphics', 'vor', 'vor', 'StarDraw 5.0 Template', 'StarDraw 5.0 Vorlage') ### 36 fmts.add('graphics', 'vor3', 'vor', 'StarDraw 3.0 Template', 'StarDraw 3.0 Vorlage') ### 35 fmts.add('graphics', 'wmf', 'wmf', 'Windows Metafile', 'draw_wmf_Export') ### 8 fmts.add('graphics', 'xhtml', 'xhtml', 'XHTML', 'XHTML Draw File') ### 45 fmts.add('graphics', 'xpm', 'xpm', 'X PixMap', 'draw_xpm_Export') ### 19 ### Presentation fmts.add('presentation', 'bmp', 'bmp', 'Windows Bitmap', 'impress_bmp_Export') ### 15 fmts.add('presentation', 'emf', 'emf', 'Enhanced Metafile', 'impress_emf_Export') ### 16 fmts.add('presentation', 'eps', 'eps', 'Encapsulated PostScript', 'impress_eps_Export') ### 17 fmts.add('presentation', 'fodp', 'fodp', 'OpenDocument Presentation (Flat XML)', 'OpenDocument Presentation Flat XML') fmts.add('presentation', 'gif', 'gif', 'Graphics Interchange Format', 'impress_gif_Export') ### 18 fmts.add('presentation', 'html', 'html', 'HTML Document (OpenOffice.org Impress)', 'impress_html_Export') ### 43 fmts.add('presentation', 'jpg', 'jpg', 'Joint Photographic Experts Group', 'impress_jpg_Export') ### 19 fmts.add('presentation', 'met', 'met', 'OS/2 Metafile', 'impress_met_Export') ### 20 fmts.add('presentation', 'odg', 'odg', 'ODF Drawing (Impress)', 'impress8_draw') ### 29 fmts.add('presentation', 'odp', 'odp', 'ODF Presentation', 'impress8') ### 9 fmts.add('presentation', 'otp', 'otp', 'ODF Presentation Template', 'impress8_template') ### 38 fmts.add('presentation', 'pbm', 'pbm', 'Portable Bitmap', 'impress_pbm_Export') ### 21 fmts.add('presentation', 'pct', 'pct', 'Mac Pict', 'impress_pct_Export') ### 22 fmts.add('presentation', 'pdf', 'pdf', 'Portable Document Format', 'impress_pdf_Export') ### 23 fmts.add('presentation', 'pgm', 'pgm', 'Portable Graymap', 'impress_pgm_Export') ### 24 fmts.add('presentation', 'png', 'png', 'Portable Network Graphic', 'impress_png_Export') ### 25 fmts.add('presentation', 'potm', 'potm', 'Microsoft PowerPoint 2007/2010 XML Template', 'Impress MS PowerPoint 2007 XML Template') fmts.add('presentation', 'pot', 'pot', 'Microsoft PowerPoint 97/2000/XP Template', 'MS PowerPoint 97 Vorlage') ### 3 fmts.add('presentation', 'ppm', 'ppm', 'Portable Pixelmap', 'impress_ppm_Export') ### 26 fmts.add('presentation', 'pptx', 'pptx', 'Microsoft PowerPoint 2007/2010 XML', 'Impress MS PowerPoint 2007 XML') ### 36 fmts.add('presentation', 'pps', 'pps', 'Microsoft PowerPoint 97/2000/XP (Autoplay)', 'MS PowerPoint 97 Autoplay') ### 36 fmts.add('presentation', 'ppt', 'ppt', 'Microsoft PowerPoint 97/2000/XP', 'MS PowerPoint 97') ### 36 fmts.add('presentation', 'pwp', 'pwp', 'PlaceWare', 'placeware_Export') ### 30 fmts.add('presentation', 'ras', 'ras', 'Sun Raster Image', 'impress_ras_Export') ### 27 fmts.add('presentation', 'sda', 'sda', 'StarDraw 5.0 (OpenOffice.org Impress)', 'StarDraw 5.0 (StarImpress)') ### 8 fmts.add('presentation', 'sdd', 'sdd', 'StarImpress 5.0', 'StarImpress 5.0') ### 6 fmts.add('presentation', 'sdd3', 'sdd', 'StarDraw 3.0 (OpenOffice.org Impress)', 'StarDraw 3.0 (StarImpress)') ### 42 fmts.add('presentation', 'sdd4', 'sdd', 'StarImpress 4.0', 'StarImpress 4.0') ### 37 fmts.add('presentation', 'sxd', 'sxd', 'OpenOffice.org 1.0 Drawing (OpenOffice.org Impress)', 'impress_StarOffice_XML_Draw') ### 31 fmts.add('presentation', 'sti', 'sti', 'OpenOffice.org 1.0 Presentation Template', 'impress_StarOffice_XML_Impress_Template') ### 5 fmts.add('presentation', 'svg', 'svg', 'Scalable Vector Graphics', 'impress_svg_Export') ### 14 fmts.add('presentation', 'svm', 'svm', 'StarView Metafile', 'impress_svm_Export') ### 13 fmts.add('presentation', 'swf', 'swf', 'Macromedia Flash (SWF)', 'impress_flash_Export') ### 34 fmts.add('presentation', 'sxi', 'sxi', 'OpenOffice.org 1.0 Presentation', 'StarOffice XML (Impress)') ### 41 fmts.add('presentation', 'tiff', 'tiff', 'Tagged Image File Format', 'impress_tif_Export') ### 12 fmts.add('presentation', 'uop', 'uop', 'Unified Office Format presentation', 'UOF presentation') ### 4 fmts.add('presentation', 'vor', 'vor', 'StarImpress 5.0 Template', 'StarImpress 5.0 Vorlage') ### 40 fmts.add('presentation', 'vor3', 'vor', 'StarDraw 3.0 Template (OpenOffice.org Impress)', 'StarDraw 3.0 Vorlage (StarImpress)') ###1 fmts.add('presentation', 'vor4', 'vor', 'StarImpress 4.0 Template', 'StarImpress 4.0 Vorlage') ### 39 fmts.add('presentation', 'vor5', 'vor', 'StarDraw 5.0 Template (OpenOffice.org Impress)', 'StarDraw 5.0 Vorlage (StarImpress)') ### 2 fmts.add('presentation', 'wmf', 'wmf', 'Windows Metafile', 'impress_wmf_Export') ### 11 fmts.add('presentation', 'xhtml', 'xml', 'XHTML', 'XHTML Impress File') ### 33 fmts.add('presentation', 'xpm', 'xpm', 'X PixMap', 'impress_xpm_Export') ### 10 class Options: def __init__(self, args): self.connection = None self.debug = False self.doctype = None self.exportfilter = [] self.exportfilteroptions = "" self.fields = {} self.filenames = [] self.format = None self.importfilter = [] self.importfilteroptions = "" self.listener = False self.nolaunch = False self.output = None self.password = None self.pipe = None self.port = '2002' self.preserve = False self.server = '127.0.0.1' self.showlist = False self.stdin = False self.stdout = False self.template = None self.timeout = 6 self.verbose = 0 ### Get options from the commandline try: opts, args = getopt.getopt (args, 'c:Dd:e:F:f:hi:Llo:np:s:T:t:vV', ['connection=', 'debug', 'doctype=', 'export=', 'field=', 'format=', 'help', 'import=', 'listener', 'no-launch', 'output=', 'outputpath', 'password=', 'pipe=', 'port=', 'preserve', 'server=', 'timeout=', 'show', 'stdin', 'stdout', 'template', 'verbose', 'version'] ) except getopt.error as exc: print('unoconv: %s, try unoconv -h for a list of all the options' % str(exc)) sys.exit(255) for opt, arg in opts: if opt in ['-h', '--help']: self.usage() print() self.help() sys.exit(0) elif opt in ['-c', '--connection']: self.connection = arg elif opt in ['--debug']: self.debug = True elif opt in ['-d', '--doctype']: self.doctype = arg elif opt in ['-e', '--export']: l = arg.split('=') if len(l) == 2: (name, value) = l if name in ('FilterOptions'): self.exportfilteroptions = value elif value in ('True', 'true'): self.exportfilter.append( PropertyValue( name, 0, True, 0 ) ) elif value in ('False', 'false'): self.exportfilter.append( PropertyValue( name, 0, False, 0 ) ) else: try: self.exportfilter.append( PropertyValue( name, 0, int(value), 0 ) ) except ValueError: self.exportfilter.append( PropertyValue( name, 0, value, 0 ) ) else: print('Warning: Option %s cannot be parsed, ignoring.' % arg, file=sys.stderr) elif opt in ['-F', '--field']: l = arg.split('=') self.fields[l[0]] = l[1] elif opt in ['-f', '--format']: self.format = arg elif opt in ['-i', '--import']: l = arg.split('=') if len(l) == 2: (name, value) = l if name in ('FilterOptions'): self.importfilteroptions = value elif value in ('True', 'true'): self.importfilter.append( PropertyValue( name, 0, True, 0 ) ) elif value in ('False', 'false'): self.importfilter.append( PropertyValue( name, 0, False, 0 ) ) else: try: self.importfilter.append( PropertyValue( name, 0, int(value), 0 ) ) except ValueError: self.importfilter.append( PropertyValue( name, 0, value, 0 ) ) else: print('Warning: Option %s cannot be parsed, ignoring.' % arg, file=sys.stderr) elif opt in ['-l', '--listener']: self.listener = True elif opt in ['-n', '--no-launch']: self.nolaunch = True elif opt in ['-o', '--output']: self.output = arg elif opt in ['--outputpath']: print('Warning: This option is deprecated by --output.', file=sys.stderr) self.output = arg elif opt in ['--password']: self.password = arg elif opt in ['--pipe']: self.pipe = arg elif opt in ['-p', '--port']: self.port = arg elif opt in ['--preserve']: self.preserve = True elif opt in ['-s', '--server']: self.server = arg elif opt in ['--show']: self.showlist = True elif opt in ['--stdin']: self.stdin = True elif opt in ['--stdout']: self.stdout = True elif opt in ['-t', '--template']: self.template = arg elif opt in ['-T', '--timeout']: self.timeout = int(arg) elif opt in ['-v', '--verbose']: self.verbose = self.verbose + 1 elif opt in ['-V', '--version']: self.version() sys.exit(0) ### Enable verbosity if self.verbose >= 2: print('Verbosity set to level %d' % self.verbose, file=sys.stderr) self.filenames = args if not self.listener and not self.showlist and not self.stdin and self.doctype != 'list' and not self.filenames: print('unoconv: you have to provide a filename or url as argument', file=sys.stderr) print('Try `unoconv -h\' for more information.', file=sys.stderr) sys.exit(255) ### Set connection string if not self.connection: if not self.pipe: self.connection = "socket,host=%s,port=%s,tcpNoDelay=1;urp;StarOffice.ComponentContext" % (self.server, self.port) else: self.connection = "pipe,name=%s;urp;StarOffice.ComponentContext" % (self.pipe) ### Make it easier for people to use a doctype (first letter is enough) if self.doctype: for doctype in doctypes: if doctype.startswith(self.doctype): self.doctype = doctype ### Check if the user request to see the list of formats if self.showlist or self.format == 'list': if self.doctype: fmts.display(self.doctype) else: for t in doctypes: fmts.display(t) sys.exit(0) ### If no format was specified, probe it or provide it if not self.format: ### Check if the command is in the form odt2pdf l = sys.argv[0].split('2') if len(l) == 2: self.format = l[1] ### Use the extension of the output file elif self.output and os.path.basename(self.output).find('.') >= 0: self.format = os.path.splitext(self.output)[1].lstrip('.') ### Default to PDF if not self.format: self.format = 'pdf' def version(self): print('unoconv %s' % __version__) print('Written by Dag Wieers ') print('Homepage at http://dag.wieers.com/home-made/unoconv/') print() print('platform %s/%s' % (os.name, sys.platform)) print('python %s' % sys.version) if uno: ### Get office product information product = uno.getComponentContext().ServiceManager.createInstance("com.sun.star.configuration.ConfigurationProvider").createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", UnoProps(nodepath="/org.openoffice.Setup/Product")) print(product.ooName, product.ooSetupVersionAboutBox) def usage(self): print('usage: unoconv [options] file [file2 ..]', file=sys.stderr) def help(self): print('''Convert from and to any format supported by LibreOffice unoconv options: -c, --connection=string use a custom connection string -d, --doctype=type specify document type (document, graphics, presentation, spreadsheet) -e, --export=name=value set export filter options eg. -e PageRange=1-2 -f, --format=format specify the output format -F, --field=name=value replace user-defined text field with value eg. -F Client_Name="Oracle" -i, --import=string set import filter option string eg. -i utf8 -l, --listener start a permanent listener to use by unoconv clients -n, --no-launch fail if no listener is found (default: launch one) -o, --output=name output basename, filename or directory --pipe=name alternative method of connection using a pipe -p, --port=port specify the port (default: 2002) to be used by client or listener --password=string provide a password to decrypt the document --preserve keep timestamp and permissions of the original document -s, --server=server specify the server address (default: 127.0.0.1) to be used by client or listener --show list the available output formats --stdin read from stdin (filenames are ignored if provided) --stdout write output to stdout -t, --template=file import the styles from template (.ott) -T, --timeout=secs timeout after secs if connection to listener fails -v, --verbose be more and more verbose (-vvv for debugging) --version display version number of unoconv, OOo/LO and platform details ''', file=sys.stderr) class Convertor: def __init__(self): global exitcode, ooproc, office, product unocontext = None ### Do the LibreOffice component dance self.context = uno.getComponentContext() self.svcmgr = self.context.ServiceManager resolver = self.svcmgr.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", self.context) ### Test for an existing connection info(3, 'Connection type: %s' % op.connection) unocontext = self.connect(resolver) if not unocontext: die(251, "Unable to connect or start own listener. Aborting.") ### And some more LibreOffice magic unosvcmgr = unocontext.ServiceManager self.desktop = unosvcmgr.createInstanceWithContext("com.sun.star.frame.Desktop", unocontext) self.cwd = unohelper.systemPathToFileUrl( os.getcwd() ) ### List all filters # self.filters = unosvcmgr.createInstanceWithContext( "com.sun.star.document.FilterFactory", unocontext) # for filter in self.filters.getElementNames(): # print filter # #print dir(filter), dir(filter.format) def connect(self, resolver): global ooproc, product, office unocontext = None try: unocontext = resolver.resolve("uno:%s" % op.connection) except NoConnectException as e: # info(3, "Existing listener not found.\n%s" % e) info(3, "Existing listener not found.") if op.nolaunch: die(113, "Existing listener not found. Unable start listener by parameters. Aborting.") ### Start our own OpenOffice instance info(3, "Launching our own listener using %s." % office.binary) try: product = self.svcmgr.createInstance("com.sun.star.configuration.ConfigurationProvider").createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", UnoProps(nodepath="/org.openoffice.Setup/Product")) if product.ooName not in ('LibreOffice', 'LOdev') or LooseVersion(product.ooSetupVersion) <= LooseVersion('3.3'): ooproc = subprocess.Popen([office.binary, "-headless", "-invisible", "-nocrashreport", "-nodefault", "-nofirststartwizard", "-nologo", "-norestore", "-accept=%s" % op.connection], env=os.environ) else: ooproc = subprocess.Popen([office.binary, "--headless", "--invisible", "--nocrashreport", "--nodefault", "--nofirststartwizard", "--nologo", "--norestore", "--accept=%s" % op.connection], env=os.environ) info(2, '%s listener successfully started. (pid=%s)' % (product.ooName, ooproc.pid)) ### Try connection to it for op.timeout seconds (flakky OpenOffice) timeout = 0 while timeout <= op.timeout: ### Is it already/still running ? retcode = ooproc.poll() if retcode == 81: info(3, "Caught exit code 81 (new installation). Restarting listener.") return self.connect(resolver) break elif retcode != None: info(3, "Process %s (pid=%s) exited with %s." % (office.binary, ooproc.pid, retcode)) break try: unocontext = resolver.resolve("uno:%s" % op.connection) break except NoConnectException: time.sleep(0.5) timeout += 0.5 except: raise else: error("Failed to connect to %s (pid=%s) in %d seconds.\n%s" % (office.binary, ooproc.pid, op.timeout, e)) except Exception as e: raise error("Launch of %s failed.\n%s" % (office.binary, e)) return unocontext def getformat(self, inputfn): doctype = None ### Get the output format from mapping if op.doctype: outputfmt = fmts.bydoctype(op.doctype, op.format) else: outputfmt = fmts.byname(op.format) if not outputfmt: outputfmt = fmts.byextension(os.extsep + op.format) ### If no doctype given, check list of acceptable formats for input file ext doctype ### FIXME: This should go into the for-loop to match each individual input filename if outputfmt: inputext = os.path.splitext(inputfn)[1] inputfmt = fmts.byextension(inputext) if inputfmt: for fmt in outputfmt: if inputfmt[0].doctype == fmt.doctype: doctype = inputfmt[0].doctype outputfmt = fmt break else: outputfmt = outputfmt[0] # print >>sys.stderr, 'unoconv: format `%s\' is part of multiple doctypes %s, selecting `%s\'.' % (format, [fmt.doctype for fmt in outputfmt], outputfmt[0].doctype) else: outputfmt = outputfmt[0] ### No format found, throw error if not outputfmt: if doctype: print('unoconv: format [%s/%s] is not known to unoconv.' % (op.doctype, op.format), file=sys.stderr) else: print('unoconv: format [%s] is not known to unoconv.' % op.format, file=sys.stderr) die(1) return outputfmt def preserve(self, inputfn, outputfn): # Get timestamp of input file s = os.stat(inputfn) times = (s.st_atime, s.st_mtime) mode = s.st_mode # Set it to output file with open(outputfn, "a") as f: os.utime(f.fileno() if hasattr(os, "supports_fd") and os.utime in os.supports_fd else inputfn, times=times) os.chmod(f.fileno() if hasattr(os, "supports_fd") and os.chmod in os.supports_fd else inputfn, mode) def convert(self, inputfn): global exitcode document = None outputfmt = self.getformat(inputfn) if op.verbose > 0: print('Input file:', inputfn, file=sys.stderr) try: ### Import phase phase = "import" ### Load inputfile inputprops = UnoProps(Hidden=True, ReadOnly=True, UpdateDocMode=QUIET_UPDATE) # if op.password: # info = UnoProps(algorithm-name="PBKDF2", salt="salt", iteration-count=1024, hash="hash") # inputprops += UnoProps(ModifyPasswordInfo=info) ### Cannot use UnoProps for FilterData property if op.importfilteroptions: # print "Import filter options: %s" % op.importfilteroptions inputprops += UnoProps(FilterOptions=op.importfilteroptions) ### Cannot use UnoProps for FilterData property if op.importfilter: inputprops += ( PropertyValue( "FilterData", 0, uno.Any("[]com.sun.star.beans.PropertyValue", tuple( op.importfilter ), ), 0 ), ) if op.stdin: inputStream = self.svcmgr.createInstanceWithContext("com.sun.star.io.SequenceInputStream", self.context) inputStream.initialize((uno.ByteSequence(inputfn),)) inputprops += UnoProps(InputStream=inputStream) inputurl = 'private:stream' else: if os.path.exists(inputfn): inputurl = unohelper.absolutize(self.cwd, unohelper.systemPathToFileUrl(inputfn)) else: inputurl = inputfn document = self.desktop.loadComponentFromURL( inputurl , "_blank", 0, inputprops ) if not document: raise UnoException("The document '%s' could not be opened." % inputurl, None) ### Import style template phase = "import-style" if op.template: if os.path.exists(op.template): info(1, "Template file: %s" % op.template) templateprops = UnoProps(OverwriteStyles=True) templateurl = unohelper.absolutize(self.cwd, unohelper.systemPathToFileUrl(op.template)) document.StyleFamilies.loadStylesFromURL(templateurl, templateprops) else: print('unoconv: template file `%s\' does not exist.' % op.template, file=sys.stderr) exitcode = 1 ### Force all cells to recalculate if we are able to. This will get rid of errors in cells. ### FIXME: We cannot recalculate the cells because it breaks issue #97 (cells get #VALUE) # phase = "recalculate" # try: # document.calculateAll() # except AttributeError: # pass ### Update document links phase = "update-links" try: document.updateLinks() # Found that when converting HTML files with external images, OO would only load five or six of # the images in the file. In the resulting document, the rest of the images did not appear. Cycling # through all the image references in the document seems to force OO to actually load them. Found # some helpful guidance in this thread: # https://forum.openoffice.org/en/forum/viewtopic.php?f=30&t=23909 # Ideally we would like to have the option to embed the images into the document, but I have not been # able to figure out how to do this yet. graphObjs = document.GraphicObjects for i in range(0, graphObjs.getCount()): graphObj = graphObjs.getByIndex(i) except AttributeError: # the document doesn't implement the XLinkUpdate interface pass ### Replace variables phase = "replace-fields" for f in op.fields: try: field = document.TextFieldMasters.getByName("com.sun.star.text.fieldmaster.SetExpression.%s" % f) field.DependentTextFields[0].setPropertyValue('Content', op.fields[f]) except UnoException: print("unoconv: failed to replace variable '%s' with value '%s' in the document." % (f, op.fields[f])) pass ### Update document indexes phase = "update-indexes" for ii in range(2): # At first update Table-of-Contents. # ToC grows, so page numbers grows too. # On second turn update page numbers in ToC. try: document.refresh() indexes = document.getDocumentIndexes() except AttributeError: # the document doesn't implement the XRefreshable and/or # XDocumentIndexesSupplier interfaces break else: for i in range(0, indexes.getCount()): indexes.getByIndex(i).update() info(1, "Selected output format: %s" % outputfmt) info(2, "Selected office filter: %s" % outputfmt.filter) info(2, "Used doctype: %s" % outputfmt.doctype) ### Document properties phase phase = "disable-showchanges" try: document.ShowChanges = False except AttributeError: pass ### Export phase phase = "export" outputprops = UnoProps(FilterName=outputfmt.filter, OutputStream=OutputStream(), Overwrite=True) ### Set default filter options if op.exportfilteroptions: # print "Export filter options: %s" % op.exportfilteroptions outputprops += UnoProps(FilterOptions=op.exportfilteroptions) else: if outputfmt.filter == 'Text (encoded)': outputprops += UnoProps(FilterOptions="UTF8,LF") elif outputfmt.filter == 'Text': outputprops += UnoProps(FilterOptions="UTF8") elif outputfmt.filter == 'Text - txt - csv (StarCalc)': outputprops += UnoProps(FilterOptions="44,34,UTF8") ### Cannot use UnoProps for FilterData property if op.exportfilter: outputprops += ( PropertyValue( "FilterData", 0, uno.Any("[]com.sun.star.beans.PropertyValue", tuple( op.exportfilter ), ), 0 ), ) if op.stdout: ### Ensure binary data to stdout works ### http://stackoverflow.com/questions/2374427/python-2-x-write-binary-output-to-stdout if sys.platform == "win32": import msvcrt msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) outputurl = "private:stream" else: if os.path.exists(inputfn): (inbase, ext) = os.path.splitext(inputfn) else: (inbase, ext) = os.path.splitext(os.path.basename(inputfn)) if op.output: (outbase, ext) = os.path.splitext(op.output) if len(op.filenames) > 1: outputfn = realpath(outbase, os.path.basename(inbase) + os.extsep + outputfmt.extension) else: outputfn = realpath(outbase + os.extsep + outputfmt.extension) else: outputfn = realpath(inbase + os.extsep + outputfmt.extension) outputurl = unohelper.absolutize( self.cwd, unohelper.systemPathToFileUrl(outputfn) ) info(1, "Output file: %s" % outputurl) try: document.storeToURL(outputurl, tuple(outputprops) ) except IOException as e: raise UnoException("Unable to store document to %s (ErrCode %d)\n\nProperties: %s" % (outputurl, e.ErrCode, outputprops), None) phase = "dispose" document.dispose() document.close(True) if not op.stdout and op.preserve: self.preserve(inputfn, outputfn) except SystemError as e: error("unoconv: SystemError during %s phase:\n%s" % (phase, e)) exitcode = 1 except RuntimeException as e: error("unoconv: RuntimeException during %s phase:\nOffice probably died. %s" % (phase, e)) exitcode = 6 except DisposedException as e: error("unoconv: DisposedException during %s phase:\nOffice probably died. %s" % (phase, e)) exitcode = 7 except IllegalArgumentException as e: error("UNO IllegalArgument during %s phase:\nSource file cannot be read. %s" % (phase, e)) exitcode = 8 except IOException as e: # for attr in dir(e): print '%s: %s', (attr, getattr(e, attr)) error("unoconv: IOException during %s phase:\n%s" % (phase, e.Message)) exitcode = 3 except CannotConvertException as e: # for attr in dir(e): print '%s: %s', (attr, getattr(e, attr)) error("unoconv: CannotConvertException during %s phase:\n%s" % (phase, e.Message)) exitcode = 4 except UnoException as e: if hasattr(e, 'ErrCode'): error("unoconv: UnoException during %s phase in %s (ErrCode %d)" % (phase, repr(e.__class__), e.ErrCode)) exitcode = e.ErrCode pass if hasattr(e, 'Message'): error("unoconv: UnoException during %s phase:\n%s" % (phase, e.Message)) exitcode = 5 else: error("unoconv: UnoException during %s phase in %s" % (phase, repr(e.__class__))) exitcode = 2 pass class Listener: def __init__(self): global product info(1, "Start listener on %s:%s" % (op.server, op.port)) self.context = uno.getComponentContext() self.svcmgr = self.context.ServiceManager try: resolver = self.svcmgr.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", self.context) product = self.svcmgr.createInstance("com.sun.star.configuration.ConfigurationProvider").createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", UnoProps(nodepath="/org.openoffice.Setup/Product")) try: unocontext = resolver.resolve("uno:%s" % op.connection) except NoConnectException as e: pass else: info(1, "Existing %s listener found, nothing to do." % product.ooName) return if product.ooName != "LibreOffice" or LooseVersion(product.ooSetupVersion) <= LooseVersion('3.3'): subprocess.call([office.binary, "-headless", "-invisible", "-nocrashreport", "-nodefault", "-nologo", "-nofirststartwizard", "-norestore", "-accept=%s" % op.connection], env=os.environ) else: subprocess.call([office.binary, "--headless", "--invisible", "--nocrashreport", "--nodefault", "--nologo", "--nofirststartwizard", "--norestore", "--accept=%s" % op.connection], env=os.environ) except Exception as e: error("Launch of %s failed.\n%s" % (office.binary, e)) else: info(1, "Existing %s listener found, nothing to do." % product.ooName) def error(msg): "Output error message" print(msg, file=sys.stderr) def info(level, msg): "Output info message" if 'op' not in globals(): pass elif op.verbose >= 3 and level >= 3: print("DEBUG:", msg, file=sys.stderr) elif not op.stdout and level <= op.verbose: print(msg, file=sys.stdout) elif level <= op.verbose: print(msg, file=sys.stderr) def die(ret, msg=None): "Print optional error and exit with errorcode" global convertor, ooproc, office if msg: error('Error: %s' % msg) ### Did we start our own listener instance ? if not op.listener and ooproc and convertor: ### If there is a GUI now attached to the instance, disable listener if convertor.desktop.getCurrentFrame(): info(2, 'Trying to stop %s GUI listener.' % product.ooName) try: if product.ooName != "LibreOffice" or product.ooSetupVersion <= 3.3: subprocess.Popen([office.binary, "-headless", "-invisible", "-nocrashreport", "-nodefault", "-nofirststartwizard", "-nologo", "-norestore", "-unaccept=%s" % op.connection], env=os.environ) else: subprocess.Popen([office.binary, "--headless", "--invisible", "--nocrashreport", "--nodefault", "--nofirststartwizard", "--nologo", "--norestore", "--unaccept=%s" % op.connection], env=os.environ) ooproc.wait() info(2, '%s listener successfully disabled.' % product.ooName) except Exception as e: error("Terminate using %s failed.\n%s" % (office.binary, e)) ### If there is no GUI attached to the instance, terminate instance else: info(3, 'Terminating %s instance.' % product.ooName) try: convertor.desktop.terminate() except DisposedException: info(2, '%s instance unsuccessfully closed, sending TERM signal.' % product.ooName) try: ooproc.terminate() except AttributeError: os.kill(ooproc.pid, 15) info(3, 'Waiting for %s instance to exit.' % product.ooName) ooproc.wait() ### LibreOffice processes may get stuck and we have to kill them ### Is it still running ? if ooproc.poll() == None: info(1, '%s instance still running, please investigate...' % product.ooName) ooproc.wait() info(2, '%s instance unsuccessfully terminated, sending KILL signal.' % product.ooName) try: ooproc.kill() except AttributeError: os.kill(ooproc.pid, 9) info(3, 'Waiting for %s with pid %s to disappear.' % (ooproc.pid, product.ooName)) ooproc.wait() # allow Python GC to garbage collect pyuno object *before* exit call # which avoids random segmentation faults --vpa convertor = None sys.exit(ret) def main(): global convertor, exitcode convertor = None try: if op.listener: listener = Listener() if op.stdin: inputfn = sys.stdin.read() convertor = Convertor() convertor.convert(inputfn) elif op.filenames: convertor = Convertor() for inputfn in op.filenames: convertor.convert(inputfn) except NoConnectException as e: error("unoconv: could not find an existing connection to LibreOffice at %s:%s." % (op.server, op.port)) if op.connection: info(0, "Please start an LibreOffice instance on server '%s' by doing:\n\n unoconv --listener --server %s --port %s\n\nor alternatively:\n\n soffice -nologo -nodefault -accept=\"%s\"" % (op.server, op.server, op.port, op.connection)) else: info(0, "Please start an LibreOffice instance on server '%s' by doing:\n\n unoconv --listener --server %s --port %s\n\nor alternatively:\n\n soffice -nologo -nodefault -accept=\"socket,host=%s,port=%s;urp;\"" % (op.server, op.server, op.port, op.server, op.port)) info(0, "Please start an soffice instance on server '%s' by doing:\n\n soffice -nologo -nodefault -accept=\"socket,host=127.0.0.1,port=%s;urp;\"" % (op.server, op.port)) exitcode = 1 # except UnboundLocalError: # die(252, "Failed to connect to remote listener.") except OSError: error("Warning: failed to launch Office suite. Aborting.") ### Main entrance if __name__ == '__main__': exitcode = 0 info(3, 'sysname=%s, platform=%s, python=%s, python-version=%s' % (os.name, sys.platform, sys.executable, sys.version)) for of in find_offices(): if of.python != sys.executable and not sys.executable.startswith(of.basepath): python_switch(of) office_environ(of) # debug_office() try: import uno, unohelper office = of break except: # debug_office() print("unoconv: Cannot find a suitable pyuno library and python binary combination in %s" % of, file=sys.stderr) print("ERROR:", sys.exc_info()[1], file=sys.stderr) print(file=sys.stderr) else: # debug_office() print("unoconv: Cannot find a suitable office installation on your system.", file=sys.stderr) print("ERROR: Please locate your office installation and send your feedback to:", file=sys.stderr) print(" http://github.com/dagwieers/unoconv/issues", file=sys.stderr) sys.exit(1) ### Now that we have found a working pyuno library, let's import some classes from com.sun.star.beans import PropertyValue from com.sun.star.connection import NoConnectException from com.sun.star.document.UpdateDocMode import QUIET_UPDATE from com.sun.star.lang import DisposedException, IllegalArgumentException from com.sun.star.io import IOException, XOutputStream from com.sun.star.script import CannotConvertException from com.sun.star.uno import Exception as UnoException from com.sun.star.uno import RuntimeException ### And now that we have those classes, build on them class OutputStream( unohelper.Base, XOutputStream ): def __init__( self ): self.closed = 0 def closeOutput(self): self.closed = 1 def writeBytes( self, seq ): try: sys.stdout.buffer.write( seq.value ) except AttributeError: sys.stdout.write( seq.value ) def flush( self ): pass def UnoProps(**args): props = [] for key in args: prop = PropertyValue() prop.Name = key prop.Value = args[key] props.append(prop) return tuple(props) op = Options(sys.argv[1:]) info(2, "Using office base path: %s" % office.basepath) info(2, "Using office binary path: %s" % office.unopath) try: main() except KeyboardInterrupt as e: die(6, 'Exiting on user request') die(exitcode)