/// <summary> /// Builds the illustration frame. /// </summary> /// <param name="document">The document.</param> /// <param name="frameStyleName">Name of the frame style.</param> /// <param name="graphicName">Name of the graphic.</param> /// <param name="pathToGraphic">The path to graphic.</param> /// <param name="illustrationText">The illustration text.</param> /// <param name="illustrationNumber">The illustration number.</param> /// <returns> /// A new Frame object containing a DrawTextBox which contains the /// illustration Graphic object and a text sequence representing /// the displayed illustration text. /// </returns> public static Frame BuildIllustrationFrame(IDocument document, string frameStyleName, string graphicName, string pathToGraphic, string illustrationText, int illustrationNumber) { DrawTextBox drawTextBox = new DrawTextBox(document); Frame frameTextBox = new Frame(document, frameStyleName); frameTextBox.DrawName = frameStyleName+"_"+graphicName; frameTextBox.ZIndex = "0"; Paragraph pIllustration = ParagraphBuilder.CreateStandardTextParagraph(document); pIllustration.StyleName = "Illustration"; Frame frame = new Frame(document, "InnerFrame_"+frameStyleName, graphicName, pathToGraphic); frame.ZIndex = "1"; pIllustration.Content.Add(frame); //add Illustration as text pIllustration.TextContent.Add(new SimpleText(document, "Illustration")); //add TextSequence TextSequence textSequence = new TextSequence(document); textSequence.Name = "Illustration"; textSequence.NumFormat = "1"; textSequence.RefName = "refIllustration"+illustrationNumber.ToString(); textSequence.Formula = "ooow:Illustration+1"; textSequence.TextContent.Add(new SimpleText(document, illustrationNumber.ToString())); pIllustration.TextContent.Add(textSequence); //add the ilustration text pIllustration.TextContent.Add(new SimpleText(document, illustrationText)); //add the Paragraph to the DrawTextBox drawTextBox.Content.Add(pIllustration); frameTextBox.SvgWidth = frame.SvgWidth; drawTextBox.MinWidth = frame.SvgWidth; drawTextBox.MinHeight = frame.SvgHeight; frameTextBox.Content.Add(drawTextBox); return frameTextBox; }
/// <summary> /// Creates the text sequence. /// </summary> /// <param name="document">The document.</param> /// <param name="node">The node.</param> /// <returns></returns> public TextSequence CreateTextSequence(IDocument document, XmlNode node) { try { TextSequence textSequence = new TextSequence(document, node); return textSequence; } catch(Exception ex) { throw new AODLException("Exception while trying to create a TextSequence.", ex); } }
/// <summary> /// Creates the text sequence. /// </summary> /// <param name="document">The document.</param> /// <param name="node">The node.</param> /// <returns></returns> public TextSequence CreateTextSequence(IDocument document, XmlNode node) { try { TextSequence textSequence = new TextSequence(document, node); return textSequence; } catch(Exception ex) { AODLException exception = new AODLException("Exception while trying to create a TextSequence."); exception.InMethod = AODLException.GetExceptionSourceInfo(new StackFrame(1, true)); exception.Node = node; exception.OriginalException = ex; throw exception; } }