Skip to content

Commit 385fa1d

Browse files
author
KB Bot
committed
Added new kb article set-bullet-list-indents-radwordsprocessing
1 parent 62e758f commit 385fa1d

File tree

1 file changed

+91
-0
lines changed

1 file changed

+91
-0
lines changed
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
---
2+
title: Setting Bullet List Indents in RadWordsProcessing
3+
description: Learn how to configure bullet list indents including bullet position and text indentation in RadWordsProcessing documents.
4+
type: how-to
5+
page_title: How to Set Bullet List Indents in RadWordsProcessing Documents
6+
slug: set-bullet-list-indents-radwordsprocessing
7+
tags: radwordsprocessing, document, bullet, list, indent, text, position
8+
res_type: kb
9+
ticketid: 1681870
10+
---
11+
12+
## Description
13+
14+
When working with bullet lists in RadWordsProcessing documents, you might need to adjust the bullet position and text indentation to meet specific formatting requirements. This knowledge base article also answers the following questions:
15+
16+
- How can I set text indent for bullet lists in RadWordsProcessing?
17+
- How can I adjust the bullet position in RadWordsProcessing lists?
18+
- What are the calculations behind converting device-independent pixels to centimeters for list indents in RadWordsProcessing?
19+
20+
## Environment
21+
22+
<table>
23+
<tbody>
24+
<tr>
25+
<td>Product</td>
26+
<td>RadWordsProcessing for Document Processing</td>
27+
</tr>
28+
</tbody>
29+
</table>
30+
31+
## Solution
32+
33+
To set the bullet position and text indentation for a bullet list in RadWordsProcessing, follow these steps:
34+
35+
1. Initialize the `RadFlowDocument` and add a section to it.
36+
2. Create a bullet list and configure its levels as needed.
37+
3. Use the `ParagraphProperties.LeftIndent` and `ParagraphProperties.HangingIndent` properties to adjust the bullet position and text indentation.
38+
39+
### Example
40+
41+
```csharp
42+
RadFlowDocument document = new RadFlowDocument();
43+
Section section = document.Sections.AddSection();
44+
45+
document.Lists.Add(ListTemplateType.BulletDefault);
46+
List list = document.Lists.Last();
47+
48+
// Configure the first level of the bullet list
49+
list.Levels[0].NumberTextFormat = "¾";
50+
list.Levels[0].NumberingStyle = NumberingStyle.Bullet;
51+
list.Levels[0].CharacterProperties.FontFamily.LocalValue = new ThemableFontFamily("Wingdings 2");
52+
list.Levels[0].CharacterProperties.FontSize.LocalValue = 16;
53+
list.Levels[0].ParagraphProperties.LeftIndent.LocalValue = 18.933333333333334;
54+
list.Levels[0].ParagraphProperties.HangingIndent.LocalValue = 18.933333333333334;
55+
56+
// Configure the second level of the bullet list
57+
list.Levels[1].NumberTextFormat = "¾";
58+
list.Levels[1].NumberingStyle = NumberingStyle.Bullet;
59+
list.Levels[1].CharacterProperties.FontFamily.LocalValue = new ThemableFontFamily("Wingdings 2");
60+
list.Levels[1].CharacterProperties.FontSize.LocalValue = 13.3333333;
61+
list.Levels[1].ParagraphProperties.LeftIndent.LocalValue = 37.8;
62+
list.Levels[1].ParagraphProperties.HangingIndent.LocalValue = 18.933333333333334;
63+
64+
// Add paragraphs and associate them with list levels
65+
Paragraph paragraph = document.Sections.Last().Blocks.AddParagraph();
66+
paragraph.Inlines.AddRun("Bullet 1");
67+
paragraph.ListId = list.Id;
68+
paragraph.ListLevel = 1;
69+
70+
paragraph = document.Sections.Last().Blocks.AddParagraph();
71+
paragraph.Inlines.AddRun("Bullet 1.1");
72+
paragraph.ListId = list.Id;
73+
paragraph.ListLevel = 2;
74+
```
75+
76+
**Conversion from device-independent pixels to centimeters:**
77+
78+
The conversion from device-independent pixels (DIP) to centimeters (cm) is based on the formula:
79+
80+
\[ \text{cm} = \frac{\text{DIP}}{96} \times 2.54 \]
81+
82+
For instance, to convert 18.9 DIP to cm:
83+
84+
\[ \text{cm} = \frac{18.9}{96} \times 2.54 = 0.5cm \]
85+
86+
This calculation allows you to set the bullet position and text indentation accurately according to your formatting requirements.
87+
88+
## See Also
89+
90+
- [Modifying a Paragraph in RadWordsProcessing](https://docs.telerik.com/devtools/document-processing/libraries/radwordsprocessing/model/paragraph#modifying-a-paragraph)
91+
- [Understanding Device Independent Pixels](https://docs.telerik.com/devtools/document-processing/common-information/device-independent-pixels)

0 commit comments

Comments
 (0)