Open Document Format Draw .sxd

Added an OOo ODF 2D Drawing .SXD content.xml method into the example at KitCAD225_KGraphicControl.htm.

A SUN OOo ODF exporter is installed for KitCAD i3 to generate “application/vnd.sun.xml.draw” mine file types (OOo aka OpenOffice) on the fly.
Parts of this converter are in PHP and PEAR with the PEAR package of File_Archive, so it works with PHP4/5.

Currently testing the sxd output with win32 Sun Open Office 1.1.0 (needs update)… See Comments to this post.

A 3D convter version is being planned


4 Responses to “Open Document Format Draw .sxd”

  1. Admin Says:

    More testing of the online version. 🙂

    The KitCAD225_KGraphicControl.htm example is WILL be corrected because it uses INCH sizes for svg:x, and svg:y. The example also has svg:height and svg:width omitted. The OOO interface resolves these errors by using svg:x=0, svg:y=0; svg:height=”0.380cm” svg:width=”1.450cm” as an example. During inital tests the svg:x and svg:y values worked when a ‘.’ was included (and things were grouped)

    The of the method of submission from CGI to PHP with header redirect WILL be changed because the _i3_sxd.htm page remains. The PHP may simply print the download page with a meta refresh tag. This is a problem that also affects HTTPS protocol use, and as such all current links are set to the default HTML protocol (no option for FILE due to online zip compression use, an offline example version for SXD convert from KP2/KPD will be created at a much later date).

    KitCAD i3 KGC stream js load option is disabled for _i3_sxd.htm because it makes changes to Canvas.render which require the TCanvas_hpp.js file to be reloaded (Defaults to a standard page load with scripts inline). The kgc.Canvas.render version required also needs programming allowance for kgc=’this’ and kgc=’self.opener.parent.codebar.document’ (it was and is easier to disable this option until such a time as the supporting inline override methods for SXD are written into the TCanvas_hpp.js file).

  2. Admin Says:

    Made some attempts to Correct most of the above bugs, and added the sxd conversion to the KitCAD i3 option page|rendering IO. (skipped HTTPS and maths)

    Began full testing of KitCAD i3 KGC ooo_odf_sxd.js with KitCAD i3 KGC

    The maths is incorrect for ‘fixed KPD’ rotated KP2 object items of 90Deg.
    Other rotations may also have the same error, it will be corrected over the next few days. (the order of the maths must be incorrect)

    The refresh was changed however a better solution would be refreshing to a new page that is not generated by the pear.php file (like a modified usr_drawing.html that would fetch the sxd file)

  3. Admin Says:

    Will be making more rotation updates soon for the sxd output converter; one solution found so far is by using the matrix cord translation system – like for an object at top/left pos of 232,6 extending to 282,306 (sized 250×250) the rotation for +45Deg in KitCADi3 sxd becomes:

    draw:transform=”matrix( 1, 0, 0, 1, -250, 250 ) rotate(-0.78) translate (2320 60)”

    Untested -45 or +315 could be like
    draw:transform=”matrix( 1, 0, 0, 1, 250, -250 ) rotate(0.78) translate (2320 60)”

    The ‘250’ above relates to svg:viewbox width and height

    Am attempting to find a better mapping fix/hack 🙁

  4. Admin Says:

    Tested KitCAD i3 SXD output again with latest oOO, nothing changed, still a failed result (not as expected).. Also found documents at and

    The work-around to rotate objects is by using the oOO rotate function. One other option is to send a whole page drawn using paths (but at this time there is no KitCAD converter to do this diretly for SXD formatted output – KitCAD2 SVG exporter requires alot of pre-generated files while KitCAD i3 generates the output on-the-fly without pre-generated pre-sized modified files)..