ParagraphConfig
Contents
[
Hide
]
This element is used to combine text and images.
Declaration
ParagraphConfig element is declared as an instance of ParagraphConfig
class. Reference Aspose.OMR.Generation.Config.Elements.Parents
and Aspose.OMR.Generation.Config.Enums
namespaces to use ParagraphConfig
types without specifying the fully qualified namespace:
using Aspose.OMR.Generation.Config.Elements.Parents;
using Aspose.OMR.Generation.Config.Enums;
Texts and images are provided in the Children
list.
new ParagraphConfig() {
Children= new List<BaseConfig>() {
/*
* Put child elements here
*/
}
}
Required properties
Name | Type | Description |
---|---|---|
Children | List<BaseConfig> |
Child elements. |
Optional properties
Name | Type | Default value | Description |
---|---|---|---|
Name | string |
n/a | Used as a reminder of the element’s purpose; for example, “Important notice”. You can use the same value for multiple paragraphs. This text is not displayed on the form. |
ParagraphType | ParagraphTypeEnum |
ParagraphTypeEnum.Normal |
Defines how paragraph elements are rendered:
ParagraphTypeEnum.Normal will cause the text to overflow the image. |
VerticalAlign | VerticalAlignment |
VerticalAlignment.undefined |
Controls how inline elements of different sizes align vertically within the lines of a paragraph:
|
Image wrapping
To allow the text to wrap around an image:
- Set the Width, Height, XPosition and YPosition properties of the ImageConfig element.
- Set the ParagraphType property of the ParagraphConfig element to
ParagraphTypeEnum.ImageWrap
.
Allowed child elements
Examples
Check out the code examples to see how ParagraphConfig elements can be used.
Multi-line paragraph
TemplateConfig templateConfig = new TemplateConfig() {
Children=new List<BaseConfig>() {
new PageConfig() {
Children = new List<BaseConfig>() {
new ContainerConfig() {
Name = "Example",
Children = new List<BaseConfig>() {
new BlockConfig() {
Children = new List<BaseConfig>() {
new ParagraphConfig() {
Children = new List<BaseConfig> {
new ContentConfig() {
Name = "The Raven by Edgar Allan Poe",
FontStyle = FontStyle.Bold,
FontSize = 16
},
new EmptyLineConfig(),
new ContentConfig() {
Name = "Once upon a midnight dreary, while I pondered, weak and weary,"
},
new ContentConfig() {
Name = "Over many a quaint and curious volume of forgotten lore-"
},
new ContentConfig() {
Name = "While I nodded, nearly napping, suddenly there came a tapping,",
FontStyle = FontStyle.Italic
},
new ContentConfig() {
Name = "As of some one gently rapping, rapping at my chamber door.",
FontStyle = FontStyle.Italic
}
}
}
}
}
}
}
}
}
}
};
Text with image
TemplateConfig templateConfig = new TemplateConfig() {
Children=new List<BaseConfig>() {
new PageConfig() {
Children = new List<BaseConfig>() {
new ContainerConfig() {
Name = "Example",
Children = new List<BaseConfig>() {
new BlockConfig() {
Children = new List<BaseConfig>() {
new ParagraphConfig() {
ParagraphType = ParagraphTypeEnum.ImageWrap,
Children = new List<BaseConfig> {
new ImageConfig() {
Name = "logo.png",
XPosition = 1000,
YPosition = 200,
Height = 175,
Width = 200
},
new ContentConfig() {
Name = "Aspose.OMR for .NET",
FontStyle = FontStyle.Bold,
FontSize = 16
},
new ContentConfig() {
Name = "is an easy-to-use, versatile, and cost-effective API for designing, rendering and recognizing hand-filled forms."
}
}
}
}
}
}
}
}
}
}
};