-
Notifications
You must be signed in to change notification settings - Fork 41
Added new kb article set-bullet-list-indents-radwordsprocessing #529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
dessyordanova
merged 3 commits into
master
from
new-kb-set-bullet-list-indents-radwordsprocessing-1bb0d04e9502419f9db1247faa7ec23d
May 14, 2025
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
90 changes: 90 additions & 0 deletions
90
knowledge-base/set-bullet-list-indents-radwordsprocessing.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| --- | ||
| title: Setting Bullet List Indents in RadWordsProcessing | ||
| description: Learn how to configure bullet list indents including bullet position and text indentation in RadWordsProcessing documents. | ||
| type: how-to | ||
| page_title: How to Set Bullet List Indents in RadWordsProcessing Documents | ||
| slug: set-bullet-list-indents-radwordsprocessing | ||
| tags: radwordsprocessing, document, bullet, list, indent, text, position | ||
| res_type: kb | ||
| ticketid: 1681870 | ||
| --- | ||
|
|
||
| ## Description | ||
|
|
||
| When working with bullet lists in [RadWordsProcessing]({%slug radwordsprocessing-overview%}) documents, you might need to adjust the bullet position and text indentation to meet specific formatting requirements. This knowledge base article demonstrates how to set the text indent or adjust the bullet position for bullet lists in RadWordsProcessing. | ||
|
|
||
|  | ||
|
|
||
| ## Environment | ||
|
|
||
| | Version | Product | Author | | ||
| | ---- | ---- | ---- | | ||
| | 2025.1.205| RadWordsProcessing |[Desislava Yordanova](https://www.telerik.com/blogs/author/desislava-yordanova)| | ||
|
|
||
| ## Solution | ||
|
|
||
| To set the bullet position and text indentation for a bullet list in RadWordsProcessing, follow these steps: | ||
|
|
||
| 1. Initialize the [RadFlowDocument]({%slug radwordsprocessing-model-radflowdocument%}) and add a section to it. | ||
| 2. Create a [bullet list]({%slug radwordsprocessing-concepts-lists%}) and configure its levels as needed. | ||
| 3. Use the `ParagraphProperties`.[LeftIndent]({%slug radwordsprocessing-concepts-style-properties%}) and `ParagraphProperties`.[HangingIndent]({%slug radwordsprocessing-concepts-style-properties%}) properties to adjust the bullet position and text indentation. | ||
|
|
||
| ### Example | ||
|
|
||
| ```csharp | ||
| RadFlowDocument document = new RadFlowDocument(); | ||
| Section section = document.Sections.AddSection(); | ||
| section.PageMargins = new Telerik.Windows.Documents.Primitives.Padding(10); | ||
| document.Lists.Add(ListTemplateType.BulletDefault); | ||
| List list = document.Lists.Last(); | ||
|
|
||
| // Configure the first level of the bullet list | ||
| list.Levels[0].NumberTextFormat = "¾"; | ||
| list.Levels[0].NumberingStyle = NumberingStyle.Bullet; | ||
| list.Levels[0].CharacterProperties.FontFamily.LocalValue = new ThemableFontFamily("Wingdings 2"); | ||
| list.Levels[0].CharacterProperties.FontSize.LocalValue = 16; | ||
| // Adjust the space between the bullet and the text for the first level | ||
| list.Levels[0].ParagraphProperties.LeftIndent.LocalValue = 50; // Bullet position | ||
| list.Levels[0].ParagraphProperties.HangingIndent.LocalValue = 20; // Text indent | ||
|
|
||
| // Configure the second level of the bullet list | ||
| list.Levels[1].NumberTextFormat = "¾"; | ||
| list.Levels[1].NumberingStyle = NumberingStyle.Bullet; | ||
| list.Levels[1].CharacterProperties.FontFamily.LocalValue = new ThemableFontFamily("Wingdings 2"); | ||
| list.Levels[1].CharacterProperties.FontSize.LocalValue = 14; | ||
| // Adjust the space between the bullet and the text for the second level | ||
| list.Levels[1].ParagraphProperties.LeftIndent.LocalValue = 100; // Bullet position | ||
| list.Levels[1].ParagraphProperties.HangingIndent.LocalValue = 50; // Text indent | ||
|
|
||
| // Add paragraphs and associate them with list levels | ||
| Paragraph paragraph = document.Sections.Last().Blocks.AddParagraph(); | ||
| paragraph.Inlines.AddRun("Bullet 1"); | ||
| paragraph.ListId = list.Id; | ||
| paragraph.ListLevel = 0; | ||
|
|
||
| paragraph = document.Sections.Last().Blocks.AddParagraph(); | ||
| paragraph.Inlines.AddRun("Bullet 1.1"); | ||
| paragraph.ListId = list.Id; | ||
| paragraph.ListLevel = 1; | ||
|
|
||
| Telerik.Windows.Documents.Flow.FormatProviders.Docx.DocxFormatProvider provider = new Telerik.Windows.Documents.Flow.FormatProviders.Docx.DocxFormatProvider(); | ||
| string outputFilePath = "output.docx"; | ||
| File.Delete(outputFilePath); | ||
| using (Stream output = File.OpenWrite(outputFilePath)) | ||
| { | ||
| provider.Export(document, output, TimeSpan.FromSeconds(10)); | ||
| } | ||
|
|
||
| Process.Start(new ProcessStartInfo() { FileName = outputFilePath, UseShellExecute = true }); | ||
| ``` | ||
|
|
||
|
|
||
|
|
||
| >tip The conversion from [device-independent pixels]({%slug device-independent-pixels%}) (DIP) to centimeters (cm) is based on the formula:[ text{cm} = text{DIP} / {96} * 2.54 ]. For instance, to convert 18.9 DIP to cm: | ||
| [ text{cm} = 18.9 / 96 * 2.54 = 0.5cm ]. | ||
|
|
||
| ## See Also | ||
|
|
||
| - [Style Properties]({%slug radwordsprocessing-concepts-style-properties%}) | ||
| - [Lists]({%slug radwordsprocessing-concepts-lists%}) | ||
| - [Device Independent Pixels]({%slug device-independent-pixels%}) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.