OpenDocument4all - Info and tools about OpenDocument
Wednesday, 07 January 2009
Home arrow Forum
Forum Statistics
Total user: 67
Total message: 166
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

 
Captions
Date: 2007/03/16 23:02 By: Brad Campbell Status: User  
Karma: 0  
Junior Boarder

Posts: 9
graphgraph
Is there a way to add a caption to a Frame that has a graphic in it? I can simply add text below a figure, but I would like the captions to be sequences so that I could then build a table of contents. Below is a snippet of xml from an ODT content.xml file that shows what I need (written from OpenOffice). A little bit from the end is a text: sequence element. How do I add this using AODL? The graphics are no problem it's just the sequence that I'm lost on.

Is there an easy way to keep the emoticons from taking over?I had to put a space after every ":" below to keep them from showing up..


Code:

 <textp textstyle-name="Standard">         <draw:frame drawstyle-name="fr1"              draw:name="Frame1"               text:anchor-type="as-char"              svg:width="6in"              draw:z-index="14">           <draw:text-box fo:min-height="7.7638in">             <textp textstyle-name="Illustration">               <draw:frame drawstyle-name="fr2"                      draw:name="graphic1"                      text:anchor-type="paragraph"                      svgx="-0.0819in"                      svg:y="0.0839in"                      svg:width="6in"                      style:rel-width="100%"                      svg:height="7.7638in"                      style:rel-height="scale"                      draw:z-index="15">                 <draw:image xlinkhref=                                 "Pictures/200009EF0000545800006D264DE74C73.wmf"                          xlink:type="simple"                          xlinkshow="embed"                          xlink:actuate="onLoad" />               </drawframe>Illustration                <textsequence text:ref-name="refIllustration0"                      text:name="Illustration"                      text:formula="ooow:Illustration+1"                      style:num-format="1">                 1</textsequence>             :</textp>           </drawtext-box>         </drawframe>       </textp>



Post edited by: bradley.campbell, at: 2007/03/16 23:03
The administrator has disabled public write access.

Re:Captions
Date: 2007/03/27 04:35 By: Lars B Status: Admin  
Karma: 1  
Admin

Posts: 33
graph
Hi,

up to now this isn't implemented. As a work around you
can insert your "XML sequence node" directly by accessing the
content node of the frame.

Regards
Lars
The administrator has disabled public write access.

Re:Captions
Date: 2007/05/04 00:12 By: Brad Campbell Status: User  
Karma: 0  
Junior Boarder

Posts: 9
graphgraph
I'm not that familiar with the .NET xml classes. Would you be able to provide a code snippet of how to approach this?

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

Re:Captions
Date: 2007/05/10 03:38 By: Brad Campbell Status: User  
Karma: 0  
Junior Boarder

Posts: 9
graphgraph
I'm so close to having this work. Here is what I have so far:

Code:

  //Add Figure title ParagraphBuilder.CreateStandardTextParagraph(doc); p.TextContent.Add(new SimpleText(doc"Figure ")); //add the text sequence manually System.Xml.XmlElement el doc.XmlDoc.CreateElement(@"text: sequence"); el.SetAttribute(@"text:ref-name", @"refIllsutration0"); el.SetAttribute(@"text:name", @"Illustration"); el.SetAttribute(@"text:formula", @"ooow:Illustration+1"); el.SetAttribute(@"style:num-format",@"1"); i++; el.InnerText i.ToString();                                                                p.Node.AppendChild(el); //add the figure name p.TextContent.Add(new SimpleText(docFigureTitle)); //Add the paragraph to the document doc.Content.Add(p);



The problem is that in xml element and the attributes the "text:" and "style:" part don't show up in the document. I can edit the content.xml file by hand and it works, but i'm having trouble getting the code to do this properly.

Here is the xml block that the above code produces:
Code:

 <textp textstyle-name="Standard">  Figure   <sequence ref-name="refIllsutration0" name="Illustration" formula="ooow:Illustration+1" num-format="1">1</sequence>  . My Figure title  </textp>



Thanks,
Brad

Post edited by: bradley.campbell, at: 2007/05/10 03:40

Post edited by: bradley.campbell, at: 2007/05/10 03:41
The administrator has disabled public write access.

Re:Captions
Date: 2007/05/10 04:35 By: Brad Campbell Status: User  
Karma: 0  
Junior Boarder

Posts: 9
graphgraph
SUCCESS!!

The code above is almost correct. The XmlElement stuff needs to be as follows:

Code:

  //add the text sequence manually System.Xml.XmlElement el doc.XmlDoc.CreateElement("text:sequence""text");                el.SetAttribute("ref-name","text""refIllsutration0"); el.SetAttribute("name","text""Illustration"); el.SetAttribute("formula""text","ooow:Illustration+1"); i++; el.InnerText i.ToString();                                                                p.Node.AppendChild(el);

The administrator has disabled public write access.

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