Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I generate an OpenOffice Draw document?

I want to create a flowchart in OpenOffice Draw.

Since there's a lot of steps to show (and may change in future) but I can extract the data, I want to automate the creation with the following steps:

  • Create a new ODG document with specified page settings.
  • Insert flow chart shapes with specified properties.
  • Connect those things with arrows.
  • Ideally, auto-organise things into sensible positions.

I don't want to spend hours reading about some "UNO" thing - I just want code examples that I can adapt as required.

Not bothered if the example code uses the OO API, or just modify XML files inside a zipped template - so long as it lets me do the above things easily enough.

I'm doing this with Railo (CFML), but I can also work with Java, or convert snippets from other readable languages.

Any suggestions how to go about this?


Update:
I've started playing with the XML route - I saved an empty file, and a file with a single object, and compared the two (treating as zips) to see the difference, then repeated a few times with different changes to help understand what's going on.

I have some very basic (and incomplete) code which can create shapes and connect them, which can be seen here: http://gist.github.com/634306

It's very crude, but I can probably work out a way to use what I've got now to produce what I need - but I'm still hoping that someone can point me towards a better way of doing this - particularly since I'll need to figure out some way of positioning the shapes appropriately, which wont be trivial.

I've created a distinct question for this fourth point:
How do I auto-layout boxes on a flowchart?

Update 2:
From that other question, I have discovered GraphViz which can visualise graphs from data - and I've created a 'digraph' from my data - so all I need is a way to convert the output of GraphViz into something which OpenOffice Draw can accept. The obvious thought there would be SVG, but it seems OpenOffice hasn't implemented SVG properly yet, so I need to come up with another plan.

like image 575
Peter Boughton Avatar asked Oct 18 '10 17:10

Peter Boughton


People also ask

How do I create an ODT template?

Creating a template You can create a template from a document: Open a new or existing document of the type you want to make into a template (text document, spreadsheet, drawing, presentation). Add the content and styles that you want. From the main menu, choose File > Templates > Save.

What is OpenOffice Draw used for?

Draw - from a quick sketch to a complex plan, Draw gives you the tools to communicate with graphics and diagrams. With a maximum page size of 300cm by 300cm, Draw is powerful tool for technical or general posters, etc. 'Park' your most commonly used drawing tools around your screen ready for single-click access.


1 Answers

You could try api.openoffice.org. Let me know how that worked out for you.

like image 144
Wivani Avatar answered Oct 05 '22 19:10

Wivani