From 385fa1d3f8035220d8e4b8bf83603227e59c54f0 Mon Sep 17 00:00:00 2001 From: KB Bot Date: Tue, 18 Mar 2025 11:17:21 +0000 Subject: [PATCH 1/2] Added new kb article set-bullet-list-indents-radwordsprocessing --- ...-bullet-list-indents-radwordsprocessing.md | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 knowledge-base/set-bullet-list-indents-radwordsprocessing.md diff --git a/knowledge-base/set-bullet-list-indents-radwordsprocessing.md b/knowledge-base/set-bullet-list-indents-radwordsprocessing.md new file mode 100644 index 00000000..9ed33b0e --- /dev/null +++ b/knowledge-base/set-bullet-list-indents-radwordsprocessing.md @@ -0,0 +1,91 @@ +--- +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 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: + +- How can I set text indent for bullet lists in RadWordsProcessing? +- How can I adjust the bullet position in RadWordsProcessing lists? +- What are the calculations behind converting device-independent pixels to centimeters for list indents in RadWordsProcessing? + +## Environment + + + + + + + + +
ProductRadWordsProcessing for Document Processing
+ +## Solution + +To set the bullet position and text indentation for a bullet list in RadWordsProcessing, follow these steps: + +1. Initialize the `RadFlowDocument` and add a section to it. +2. Create a bullet list and configure its levels as needed. +3. Use the `ParagraphProperties.LeftIndent` and `ParagraphProperties.HangingIndent` properties to adjust the bullet position and text indentation. + +### Example + +```csharp +RadFlowDocument document = new RadFlowDocument(); +Section section = document.Sections.AddSection(); + +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; +list.Levels[0].ParagraphProperties.LeftIndent.LocalValue = 18.933333333333334; +list.Levels[0].ParagraphProperties.HangingIndent.LocalValue = 18.933333333333334; + +// 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 = 13.3333333; +list.Levels[1].ParagraphProperties.LeftIndent.LocalValue = 37.8; +list.Levels[1].ParagraphProperties.HangingIndent.LocalValue = 18.933333333333334; + +// 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 = 1; + +paragraph = document.Sections.Last().Blocks.AddParagraph(); +paragraph.Inlines.AddRun("Bullet 1.1"); +paragraph.ListId = list.Id; +paragraph.ListLevel = 2; +``` + +**Conversion from device-independent pixels to centimeters:** + +The conversion from device-independent pixels (DIP) to centimeters (cm) is based on the formula: + +\[ \text{cm} = \frac{\text{DIP}}{96} \times 2.54 \] + +For instance, to convert 18.9 DIP to cm: + +\[ \text{cm} = \frac{18.9}{96} \times 2.54 = 0.5cm \] + +This calculation allows you to set the bullet position and text indentation accurately according to your formatting requirements. + +## See Also + +- [Modifying a Paragraph in RadWordsProcessing](https://docs.telerik.com/devtools/document-processing/libraries/radwordsprocessing/model/paragraph#modifying-a-paragraph) +- [Understanding Device Independent Pixels](https://docs.telerik.com/devtools/document-processing/common-information/device-independent-pixels) From ed48263636a82ca5fb7dd0e4b163011cad718598 Mon Sep 17 00:00:00 2001 From: Desislava Yordanova Date: Mon, 5 May 2025 18:44:16 +0300 Subject: [PATCH 2/2] new KB - Setting Bullet List Indents in RadWordsProcessing --- .../images/bullet-text-indentation.png | Bin 0 -> 5310 bytes ...-bullet-list-indents-radwordsprocessing.md | 115 +++++++++--------- .../radwordsprocessing/concepts/lists.md | 2 + .../concepts/style-properties.md | 1 + 4 files changed, 60 insertions(+), 58 deletions(-) create mode 100644 knowledge-base/images/bullet-text-indentation.png diff --git a/knowledge-base/images/bullet-text-indentation.png b/knowledge-base/images/bullet-text-indentation.png new file mode 100644 index 0000000000000000000000000000000000000000..5fd5536aeb334691c507548840cfb3367ad529d5 GIT binary patch literal 5310 zcmZ`-dpy(a`=1$R4*OIl$!YZ{Bt|7YPWh-*OXT#ZnoL3IXq1mD*r6@~|drDDH zLN#Y*6rqud7_l5yF~`i9!}p%P&+qs9=l6NN_SrtW@9VnW_jTRZ`?@~&HHX8t3K&%k z0)bFCuz!yu0wF;Gzq8TO;6BGGumWEaBu85qQNULF4jxcvtnI83h@vF91#c#0Dvwbpi+$vod zO6)7Ip3W!_=uUrDnKsRT7-%rxyjB@GXy!5=jge3cjDI(KX-{KAvMYM2@9tX$=dra` zR__NK@R4S9Ft$R|#Ft2H&Wj!c-ulLQtU&~rNjzw|84_QlY&@ui9*c@PD% zyhcUT5qi(#nOwdikAGL)C9|<{-5aO$g zs!_U1MJ#G54*BqCy@H^EOxrgK(Ml4|tJG3#lQdpEf$EhLmB|)R*F~E;62=?9Te-gK z@~Ck!XOUj>VzSsL+VqCB;~o2qMwN}(F9 ze_C0$OP-gO-otg<;75FC^oNo9cT3)HVR$vJB~NjpDoI8_XlS7#lAO>%rb*FRWxH61 z??txs7@kn)TGH-4z~I$!u$ms~$HhutXSoveg%C6KD&ISYuOVvootCSmJu`c`1vQ(& za!_XaW$=BcSB<>qcusT2BE^e6mGAZ!27ePtZHv0NcUEMCslCA4*zw}GK^HVU8vh>N zUu1|1&wyi1G>bHFWT?S61y)IA6`~J?iS7$XA-v0*dTVOSYhJg*UOs;L7W;BXtk$OY z$;EW3FHV)ci|Q1aB>g0Q4STWDReBV zLsLXwphBc__w<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-bullet-list-indents-radwordsprocessing.md b/knowledge-base/set-bullet-list-indents-radwordsprocessing.md index 9ed33b0e..97c88b8c 100644 --- a/knowledge-base/set-bullet-list-indents-radwordsprocessing.md +++ b/knowledge-base/set-bullet-list-indents-radwordsprocessing.md @@ -11,81 +11,80 @@ ticketid: 1681870 ## Description -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: +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. -- How can I set text indent for bullet lists in RadWordsProcessing? -- How can I adjust the bullet position in RadWordsProcessing lists? -- What are the calculations behind converting device-independent pixels to centimeters for list indents in RadWordsProcessing? +![Bullet Text Indentation](images/bullet-text-indentation.png) ## Environment - - - - - - - -
ProductRadWordsProcessing for Document Processing
+| 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` and add a section to it. -2. Create a bullet list and configure its levels as needed. -3. Use the `ParagraphProperties.LeftIndent` and `ParagraphProperties.HangingIndent` properties to adjust the bullet position and text indentation. +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(); - -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; -list.Levels[0].ParagraphProperties.LeftIndent.LocalValue = 18.933333333333334; -list.Levels[0].ParagraphProperties.HangingIndent.LocalValue = 18.933333333333334; - -// 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 = 13.3333333; -list.Levels[1].ParagraphProperties.LeftIndent.LocalValue = 37.8; -list.Levels[1].ParagraphProperties.HangingIndent.LocalValue = 18.933333333333334; - -// 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 = 1; - -paragraph = document.Sections.Last().Blocks.AddParagraph(); -paragraph.Inlines.AddRun("Bullet 1.1"); -paragraph.ListId = list.Id; -paragraph.ListLevel = 2; + 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 }); ``` -**Conversion from device-independent pixels to centimeters:** -The conversion from device-independent pixels (DIP) to centimeters (cm) is based on the formula: -\[ \text{cm} = \frac{\text{DIP}}{96} \times 2.54 \] - -For instance, to convert 18.9 DIP to cm: - -\[ \text{cm} = \frac{18.9}{96} \times 2.54 = 0.5cm \] - -This calculation allows you to set the bullet position and text indentation accurately according to your formatting requirements. +>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 -- [Modifying a Paragraph in RadWordsProcessing](https://docs.telerik.com/devtools/document-processing/libraries/radwordsprocessing/model/paragraph#modifying-a-paragraph) -- [Understanding Device Independent Pixels](https://docs.telerik.com/devtools/document-processing/common-information/device-independent-pixels) +- [Style Properties]({%slug radwordsprocessing-concepts-style-properties%}) +- [Lists]({%slug radwordsprocessing-concepts-lists%}) +- [Device Independent Pixels]({%slug device-independent-pixels%}) diff --git a/libraries/radwordsprocessing/concepts/lists.md b/libraries/radwordsprocessing/concepts/lists.md index a65a67af..e010b9e3 100644 --- a/libraries/radwordsprocessing/concepts/lists.md +++ b/libraries/radwordsprocessing/concepts/lists.md @@ -205,3 +205,5 @@ __Example 6__ demonstrates how you can apply the list created in Steps 1-4 above * [Styles]({%slug radwordsprocessing-concepts-styles%}) * [Style Properties]({%slug radwordsprocessing-concepts-style-properties%}) + + * [Setting Bullet List Indents in RadWordsProcessing]({%slug set-bullet-list-indents-radwordsprocessing%}) diff --git a/libraries/radwordsprocessing/concepts/style-properties.md b/libraries/radwordsprocessing/concepts/style-properties.md index 81c858da..b8b27e18 100644 --- a/libraries/radwordsprocessing/concepts/style-properties.md +++ b/libraries/radwordsprocessing/concepts/style-properties.md @@ -647,3 +647,4 @@ Following is a list of all available style properties and their default values: * [Styles]({%slug radwordsprocessing-concepts-styles%}) * [IStyleProperty API Reference](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Flow.Model.Styles.Core.IStyleProperty-1.html) * [IStylePropertyDefinition API Reference](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Flow.Model.Styles.Core.IStylePropertyDefinition.html) + * [Setting Bullet List Indents in RadWordsProcessing]({%slug set-bullet-list-indents-radwordsprocessing%})