In message
I did an application for my own use recently, involving automatically
generating invoices in editable OOWriter format from my billing database. I
gave up on all the PyUNO stuff, and used ODFPY instead???so much easier to
generate ODF directly, without having to go through OpenOffice code.
Much agreed. The UNO architecture seems to have been rather mishandled.
While the general idea was nice, the implementation seems to be overly
complicated and poorly documented.
The ODF format itself is rather easy to figure out manipulate directly.
For those who do not know, the file is just a jar archive with the content
and style information all formatted as xml files. I will use the ODF
spreadsheet file as an example.
) 00:40,501$ ls demo.ods typescript
)
) 00:40,502$ /usr/lib64/java/bin/jar -xf demo.ods
)
) 00:40,503$ ls
) Configurations2 META-INF Thumbnails content.xml demo.ods
) meta.xml mimetype settings.xml styles.xml typescript
)
) 00:40,504$ xmlformat < content.xml | fmt
) <?xml version="1.0" encoding="UTF-8"?>
) <office:document-content
) xmlns
ffice="urn
asis:names:tc
pendocument:xmlns
ffice:1.0"
) xmlns:style="urn
asis:names:tc
pendocument:xmlns:style:1.0"
) xmlns:text="urn
asis:names:tc
pendocument:xmlns:text:1.0"
) xmlns:table="urn
asis:names:tc
pendocument:xmlns:table:1.0"
) xmlns:draw="urn
asis:names:tc
pendocument:xmlns:drawing:1.0"
) xmlns:fo="urn
asis:names:tc
pendocument:xmlns:xsl-fo-compatible:1.0"
) xmlns:xlink="
http://www.w3.org/1999/xlink"
) xmlns:dc="
http://purl.org/dc/elements/1.1/"
) xmlns:meta="urn
asis:names:tc
pendocument:xmlns:meta:1.0"
) xmlns:number="urn
asis:names:tc
pendocument:xmlns:datastyle:1.0"
) xmlns
resentation="urn
asis:names:tc
pendocument:xmlns
resentation:1.0"
) xmlns:svg="urn
asis:names:tc
pendocument:xmlns:svg-compatible:1.0"
) xmlns:chart="urn
asis:names:tc
pendocument:xmlns:chart:1.0"
) xmlns:dr3d="urn
asis:names:tc
pendocument:xmlns:dr3d:1.0"
) xmlns:math="
http://www.w3.org/1998/Math/MathML"
) xmlns:form="urn
asis:names:tc
pendocument:xmlns:form:1.0"
) xmlns:script="urn
asis:names:tc
pendocument:xmlns:script:1.0"
) xmlns
oo="
http://openoffice.org/2004/office"
) xmlns
oow="
http://openoffice.org/2004/writer"
) xmlns
ooc="
http://openoffice.org/2004/calc"
) xmlns:dom="
http://www.w3.org/2001/xml-events"
) xmlns:xforms="
http://www.w3.org/2002/xforms"
) xmlns:xsd="
http://www.w3.org/2001/XMLSchema"
) xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
) xmlns:rpt="
http://openoffice.org/2005/report"
) xmlns
f="urn
asis:names:tc
pendocument:xmlns
f:1.2"
) xmlns:xhtml="
http://www.w3.org/1999/xhtml"
) xmlns:grddl="
http://www.w3.org/2003/g/data-view#"
) xmlns:field="urn
penoffice:names:experimental
oo-ms-interop:xmlns:field:1.0"
) office:version="1.2"
) grddl:transformation="
http://docs.oasis-open.org/office/1.2/xslt/odf2rdf.xsl">
) <office:scripts/> <office:font-face-decls>
) <style:font-face style:name="Liberation Sans"
) svg:font-family="'Liberation Sans'"
) style:font-family-generic="swiss" style:font-pitch="variable"/>
) <style:font-face style:name="DejaVu Sans" svg:font-family="'DejaVu
) Sans'" style:font-family-generic="system"
) style:font-pitch="variable"/> <style:font-face style:name="Lohit
) Hindi" svg:font-family="'Lohit Hindi'"
) style:font-family-generic="system" style:font-pitch="variable"/>
) </office:font-face-decls> <office:automatic-styles>
) <style:style style:name="co1" style:family="table-column">
) <style:table-column-properties fo:break-before="auto"
) style:column-width="0.8925in"/>
) </style:style> <style:style style:name="ro1" style:family="table-row">
) <style:table-row-properties style:row-height="0.1681in"
) fo:break-before="auto" style:use-optimal-row-height="true"/>
) </style:style> <style:style style:name="ta1" style:family="table"
) style:master-page-name="Default">
) <style:table-properties table:display="true"
) style:writing-mode="lr-tb"/>
) </style:style> <style:style style:name="ta_extref" style:family="table">
) <style:table-properties table:display="false"/>
) </style:style>
) </office:automatic-styles> <office:body>
) <office:spreadsheet>
) <table:table table:name="Sheet1" table:style-name="ta1"
) table
rint="false">
) <table:table-column table:style-name="co1"
) table:number-columns-repeated="4"
) table:default-cell-style-name="Default"/> <table:table-row
) table:style-name="ro1">
) <table:table-cell office:value-type="string">
) <text
>This is cell A1</text
>
) </table:table-cell> <table:table-cell
) table:number-columns-repeated="2" office:value-type="float"
) office:value="8">
) <text
>8</text
>
) </table:table-cell> <table:table-cell table:formula="of:=[.B1]*[.C1]"
) office:value-type="float" office:value="64">
) <text
>64</text
>
) </table:table-cell>
) </table:table-row>
) </table:table> <table:table table:name="Sheet2" table:style-name="ta1"
) table
rint="false">
) <table:table-column table:style-name="co1"
) table:default-cell-style-name="Default"/> <table:table-row
) table:style-name="ro1">
) <table:table-cell/>
) </table:table-row>
) </table:table> <table:table table:name="Sheet3" table:style-name="ta1"
) table
rint="false">
) <table:table-column table:style-name="co1"
) table:default-cell-style-name="Default"/> <table:table-row
) table:style-name="ro1">
) <table:table-cell/>
) </table:table-row>
) </table:table>
) </office:spreadsheet>
) </office:body>
) </office:document-content>
)
) 00:41,505$ exit