You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -21,64 +21,142 @@ When creating a PDF and adding a numbered list to a set of blocks, the font of t
21
21
22
22
## Solution
23
23
24
-
To customize the font of the list numbers to match the font of the block, specify the font by using the `Levels` collection and the `CharacterProperties` property of the respective level in the list. Below is an example demonstrating how to achieve this:
24
+
To customize the font of the list numbers to match the font of the block, specify the font by using the [Levels](https://docs.telerik.com/devtools/document-processing/api/telerik.windows.documents.fixed.model.editing.collections.listlevelcollection) collection and the [CharacterProperties](https://docs.telerik.com/devtools/document-processing/api/telerik.windows.documents.fixed.model.editing.flow.characterproperties) property of the respective level in the list. Below is an example demonstrating how to achieve this:
25
25
26
-
1. Implement a custom `FontsProvider` class to supply the desired fonts in [Cross-platform scenarios]({%slug radpdfprocessing-cross-platform-fonts%}). This class should override the `GetFontData` method to return the font data for the specified `FontProperties`.
1. Implement a custom [FontsProvider]({%slug pdfprocessing-implement-fontsprovider%}) class to supply the desired fonts in [Cross-platform scenarios]({%slug radpdfprocessing-cross-platform-fonts%}). This class should override the `GetFontData` method to return the font data for the specified `FontProperties`.
38
27
39
28
2. Before creating the PDF document, set the custom `FontsProvider` as the fonts provider.
4. Create a new `List` instance with `ListTemplateType.NumberedDefault` and set the font and size for the list's first level.
54
-
55
-
```csharp
56
-
Listlist=new(ListTemplateType.NumberedDefault);
57
-
list.Levels[0].CharacterProperties.Font=font;
58
-
list.Levels[0].CharacterProperties.FontSize=20;
59
-
```
32
+
4. Create a new [List]({%slug radpdfprocessing-editing-list%}) instance with `ListTemplateType.NumberedDefault` and set the font and size for the list's first level.
60
33
61
34
5. Add blocks to the document and set their bullet to the customized list.
6.[Export the document](https://docs.telerik.com/devtools/document-processing/libraries/radpdfprocessing/formats-and-conversion/pdf/pdfformatprovider/pdfformatprovider#export) to a PDF file.
70
37
71
-
6. Export the document to a PDF file.
72
38
73
39
```csharp
74
-
stringoutputFilePath="sample.pdf";
75
-
PdfFormatProviderprovider=newPdfFormatProvider();
76
-
using (Streamoutput=File.OpenWrite(outputFilePath))
This approach allows you to customize the font and font size of the numbers in a numbered list, ensuring they match the rest of the text in the PDF document.
@@ -88,3 +166,4 @@ This approach allows you to customize the font and font size of the numbers in a
88
166
-[RadPdfProcessing - Using Lists with Block Class]({%slug radpdfprocessing-editing-list%})
0 commit comments