OpenDocument4all - Info and tools about OpenDocument
Sunday, 05 February 2012
Home arrow Forum
Forum Statistics
Total user: 89
Total message: 179
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

 
applying text styles document
Date: 2008/07/07 23:27 By: Eszter Status: User  
Karma: 0  
Fresh Boarder

Posts: 3
graphgraph
hi,

I'm using AODL create formated documents from csv files. It works very well, apart from applying text (font) styles to part of the text.

I tried to do a similar code as I'm using to apply paragraph styles. It works there:

Code:

 t = new FormatedText(DocFile,FontStyleNametext);



when I debug the code, it does seem to apply the formating (at least the name) to t.StyleName, as well as t.TextStyle.StyleName. Anyhow, when I open the created file, the text is there, but no font styles applied at all. Even 'Default' doesn't show up in the Applied styles box.

Any suggestions?

Thanks in advance.
The administrator has disabled public write access.

Re:applying text styles document
Date: 2008/07/17 20:44 By: Bitnapper Status: User  
Karma: 0  
Fresh Boarder

Posts: 3
graphgraph
Hi Eszter!

My code for applying text styles looks like this:

Code:

 paragraph ParagraphBuilder.CreateStandardTextParagraphdocument ); paragraph.Style document.CommonStyles.GetStyleByName"Title" ); formattedText = new FormatedTextdocument"txtHeadline""..." ); paragraph.TextContent.AddformattedText ); document.Content.Addparagraph );



Or for modifying text styles directly:

Code:

 paragraph ParagraphBuilder.CreateStandardTextParagraphdocument ); formattedText = new FormatedTextdocument"publicationDate""..." ); formattedText.TextStyle.TextProperties.FontName "Arial Black"; formattedText.TextStyle.TextProperties.Bold "bold"; paragraph.TextContent.AddformattedText ); document.Content.Addparagraph );



Does one of these examples meet your needs?

Best regards,

Bitnapper

Post edited by: Bitnapper, at: 2008/07/17 20:46
The administrator has disabled public write access.

Re:applying text styles document
Date: 2008/07/19 16:57 By: Eszter Status: User  
Karma: 0  
Fresh Boarder

Posts: 3
graphgraph
Hi Bitnapper,

thanks for your answer. anyhow... It doesn't work for me.
Basically I do the same as you do in your first version:

Code:

  //load an existing document //create a content form a table I have while applying styles as defined by the user //loop through table paragraph ParagraphBuilder.CreateStandardTextParagraphdocument ); paragraph.StyleName "Title"; formattedText = new FormatedTextdocument"txtHeadline""..." ); paragraph.TextContent.AddformattedText ); document.Content.Addparagraph ); //save file to different location



I looked into content.xml to see what does it write there. I found one line that if I remove it the file looks good:

Code:

 <office:automatic-styles> ...   <stylestyle style:name="Default" style:family="text" />  </office:automatic-styles>



It looks like a bug to me.


I downloaded the source code of AODL, but have to say got a bit lost at first site.
If you know where to start looking for this in the source code would be of help.

Thanks
Eszter
The administrator has disabled public write access.

Re:applying text styles document
Date: 2008/07/20 22:40 By: Eszter Status: User  
Karma: 0  
Fresh Boarder

Posts: 3
graphgraph
For the benefit of those who run into the same problem:

I commented line 623 in TextDocument.cs in the AODL source code.

Code:

 //this.CreateLocalStyleContent();


I tested a bit, and it does not seem to create problem for me so far, and the character styles work fine. I hope it stays that way
The administrator has disabled public write access.

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