OpenDocument4all - Info and tools about OpenDocument
Saturday, 19 May 2012
Home arrow Forum
Forum Statistics
Total user: 91
Total message: 181
Main Menu
Home
My Blog
AODL - Project
AODC - Project
OO Development & Info
Forum
About OpenDocument ...
Search
News
Contact Us
Login Form





Lost Password?
No account yet? Register
Sourceforge.net

SourceForge.net - Goto the project homepage
Project site on SF.net

 

Demand OpenDocument

 

Countomat Webcounter und Webstatistik (Statistik & Logfileanalyse, Counter)

OpenDocument4all-Forum

 
Tutorials
Date: 2007/01/26 05:31 By: Brad Campbell Status: User  
Karma: 0  
Junior Boarder

Posts: 9
graphgraph
Lars,

I have just downloaded your AODL library an am starting to play with it. Do you have any tutorials or simple examples (other than what is on the front page of this website)?

Things I would very much like to see some examples of (roughly in order):
-Formatted text
-Inserting and placing a picture
-Inserting a caption below a picture
-Inserting a table

Thanks. It looks like this will be very useful. From ODF I can get to pretty much any format I need using OOo.

Brad
The administrator has disabled public write access.

Re:Tutorials
Date: 2007/01/26 13:49 By: Lars B Status: Admin  
Karma: 1  
Admin

Posts: 33
graph
Hi,

did you look at the code snippets here?

http://opendocument4all.com/content/category/6/21/45/

Also you could do an anonymous CVS checkout. The source
contains a folder with a lot of NUNIT tests.

Regards
Lars
The administrator has disabled public write access.

Re:Tutorials
Date: 2007/01/26 21:20 By: Brad Campbell Status: User  
Karma: 0  
Junior Boarder

Posts: 9
graphgraph
Thanks. I hadn't actually found that page. I will check it out.

Brad
The administrator has disabled public write access.

Re:Tutorials
Date: 2007/01/27 01:37 By: Brad Campbell Status: User  
Karma: 0  
Junior Boarder

Posts: 9
graphgraph
Lars,

Those code snippets were very helpful. Thanks!

I am able to generate the documents I need. I would like to be able to combine/append several documents to together. I am having some difficulty with this though. Here is what I have tried:

Code:

 System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(this.WorkingDir);;             System.IO.FileInfo[] fi di.GetFiles("*.odt");              TextDocument[] doc = new TextDocument[fi.Length]; TextDocument masterDoc = new TextDocument(); masterDoc.New();              int i 0; foreach (System.IO.FileInfo f in fi) {     doc[i] = new TextDocument();     doc[i].New();     doc[i].Load(f.FullName);                     foreach (IContent ic in doc[i].Content)     {         //ic.Document = (IDocument)masterDoc;  //<--this didn't work          masterDoc.Content.Add(ic);       }      i++; } masterDoc.SaveAS("newfile.odt")



This code crashes on the SaveAs since the ContentCollection in masterDoc all have different contexts (are associated with the doc[i]'s and not masterDoc). Is there some way to do this?

Thanks again,
Brad
The administrator has disabled public write access.

Re:Tutorials
Date: 2007/01/27 01:50 By: Lars B Status: Admin  
Karma: 1  
Admin

Posts: 33
graph
Hi Brad,

the import resp. moving contents between documents isn't implemented, yet.
But it is possible with a little programming effort. Internal the content
objects holds a xml node which is representing this content and before
you can move this node into another document you have to import this
node first. Otherwise you will get an exception while the xml nodes document
owner is the document from which you get it. So you have first to import the
node into the new document. This will change it's owner document. At least
you can add it.

Regards
Lars
The administrator has disabled public write access.

Quick jump
Download area
Who's Online
We have 23 guests online
Polls
Should AODL and AODC also implement export as PDF and RTF?
 
Popular
© 2005 MamboZ. All rights reserved.