Difference between revisions of "AODL example 4"
From Apache OpenOffice Wiki
m |
|||
Line 1: | Line 1: | ||
<b>Add a graphic as a illustration to your text document</b> | <b>Add a graphic as a illustration to your text document</b> | ||
− | < | + | <syntaxhighlight lang="c"> |
TextDocument textdocument = new TextDocument(); | TextDocument textdocument = new TextDocument(); | ||
textdocument.New(); | textdocument.New(); | ||
Line 23: | Line 23: | ||
textdocument.Content.Add(pOuter); | textdocument.Content.Add(pOuter); | ||
textdocument.SaveTo("drawTextbox.odt"); | textdocument.SaveTo("drawTextbox.odt"); | ||
− | </ | + | </syntaxhighlight> |
Back to the [[AODL_examples|AODL examples]] overview. | Back to the [[AODL_examples|AODL examples]] overview. | ||
[[category:Summer of Code 2007]][[category:AODL]] | [[category:Summer of Code 2007]][[category:AODL]] |
Latest revision as of 12:36, 22 May 2022
Add a graphic as a illustration to your text document
TextDocument textdocument = new TextDocument(); textdocument.New(); Paragraph pOuter = ParagraphBuilder.CreateStandardTextParagraph(textdocument); DrawTextBox drawTextBox = new DrawTextBox(textdocument); Frame frameTextBox = new Frame(textdocument, "fr_txt_box"); frameTextBox.DrawName = "fr_txt_box"; frameTextBox.ZIndex = "0"; Paragraph p = ParagraphBuilder.CreateStandardTextParagraph(textdocument); p.StyleName = "Illustration"; Frame frame = new Frame(textdocument, "frame1", "graphic1", _imagefile); frame.ZIndex = "1"; p.Content.Add(frame); p.TextContent.Add(new SimpleText(textdocument, "Illustration")); drawTextBox.Content.Add(p); frameTextBox.SvgWidth = frame.SvgWidth; drawTextBox.MinWidth = frame.SvgWidth; drawTextBox.MinHeight = frame.SvgHeight; frameTextBox.Content.Add(drawTextBox); pOuter.Content.Add(frameTextBox); textdocument.Content.Add(pOuter); textdocument.SaveTo("drawTextbox.odt");
Back to the AODL examples overview.