Skip to content

Commit 17584df

Browse files
Merge pull request #471 from telerik/yoan/docs-feedback
Docs feedback
2 parents 3340173 + d96d1a3 commit 17584df

File tree

15 files changed

+123
-81
lines changed

15 files changed

+123
-81
lines changed

libraries/radpdfprocessing/editing/block.md

Lines changed: 71 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -21,67 +21,59 @@ The most common usage of __Block__ is to draw flowing content. Similarly to [Fix
2121

2222
### Inserting Text
2323

24-
Inserting [TextFragments]({%slug radpdfprocessing-model-textfragment%}) is achieved with one of the overloads of the __Insert()__ method. __Example 1__ shows a simple insert by passing a string to the method.
24+
Inserting [TextFragments]({%slug radpdfprocessing-model-textfragment%}) is achieved with one of the overloads of the __Insert()__ method. __Example 1__ shows all the overloads which allow specifying the styles and font family.
2525

26-
2726
#### __[C#] Example 1: Insert text__
2827

2928
{{region cs-radpdfprocessing-editing-block_0}}
3029
Block block = new Block();
3130
block.InsertText("Text");
32-
{{endregion}}
33-
34-
35-
36-
__Example 2__ demonstrates how to insert text with a specific font family.
37-
3831

39-
#### __[C#] Example 2: Insert text with Arial font family__
32+
// .NET Framework
33+
block.InsertText(new System.Windows.Media.FontFamily("Arial"), "Text");
34+
block.InsertText(new System.Windows.Media.FontFamily("Arial"), System.Windows.FontStyles.Italic, System.Windows.FontWeights.Bold, "Text");
4035

41-
{{region cs-radpdfprocessing-editing-block_1}}
42-
block.InsertText(new FontFamily("Arial"), "Text");
43-
{{endregion}}
44-
45-
There is an additional overload of the InsertText() method enabling you to specify the font family, font style and font weight for the text which you would like to insert.
46-
47-
#### __[C#] Example 3: Insert styled text__
48-
49-
{{region cs-radpdfprocessing-editing-block_2}}
50-
block.InsertText(new FontFamily("Arial"), FontStyles.Italic, FontWeights.Bold, "Text");
36+
// .NET Standard
37+
//block.InsertText(new Telerik.Documents.Core.Fonts.FontFamily("Arial"), "Text");
38+
//block.InsertText(new Telerik.Documents.Core.Fonts.FontFamily("Arial"), Telerik.Documents.Core.Fonts.FontStyles.Italic, Telerik.Documents.Core.Fonts.FontWeights.Bold, "Text");
5139
{{endregion}}
5240

5341
>The '\r' and '\n' characters don't have the usual meaning of "go to next line" when they are inserted into a PDF document and you cannot simply insert text containing these characters to produce multiline text. Instead, you should insert a line break.
5442
55-
5643
### Inserting Line Break
5744

58-
Inserting a line break results in the next element starting on a new line. The action is achieved with the __InsertLineBreak()__ method as shown in __Example 4__.
45+
Inserting a line break results in the next element starting on a new line. The action is achieved with the __InsertLineBreak()__ method as shown in __Example 2__.
5946

6047

61-
#### __[C#] Example 4: Break the line__
48+
#### __[C#] Example 2: Break the line__
6249

63-
{{region cs-radpdfprocessing-editing-block_3}}
50+
{{region cs-radpdfprocessing-editing-block_1}}
6451
block.InsertLineBreak();
6552
{{endregion}}
6653

67-
68-
6954
### Inserting Image
7055

7156
__Block__ provides the following methods for inserting images:
7257

73-
7458
* block.InsertImage(imageSource);
7559
* block.InsertImage(stream);
7660
* block.InsertImage(imageSource, size);
7761
* block.InsertImage(stream, size);
7862
* block.InsertImage(imageSource, width, height);
7963
* block.InsertImage(stream, width, height);
8064

65+
#### __[C#] Example 3: Inserting an image__
66+
67+
{{region cs-radpdfprocessing-editing-block_2}}
68+
string imageFilePath = "sample.jpg";
69+
FileStream fileStream = new FileStream(imageFilePath, FileMode.Open);
70+
Telerik.Windows.Documents.Fixed.Model.Resources.ImageSource imageSrc = new Telerik.Windows.Documents.Fixed.Model.Resources.ImageSource(fileStream);
71+
72+
block.InsertImage(imageSrc, 300, 200);
73+
{{endregion}}
8174

8275
Information on images in the context of the library is available in the [ImageSource]({%slug radpdfprocessing-model-imagesource%}) and [Image]({%slug radpdfprocessing-model-image%}) articles.
8376

84-
8577
### Inserting Geometries
8678

8779
[Geometries]({%slug radpdfprocessing-concepts-geometry%}) allow you to describe 2D shapes in a document. The following methods can be used to insert different geometries.
@@ -93,6 +85,19 @@ Information on images in the context of the library is available in the [ImageSo
9385
* block.**InsertPath**(geometry);
9486
* block.**InsertRectangle**(rectangle);
9587

88+
#### __[C#] Example 4: Inserting a geometry__
89+
90+
{{region cs-radpdfprocessing-editing-block_3}}
91+
Telerik.Windows.Documents.Fixed.Model.Graphics.RectangleGeometry rectangleGeometry = new Telerik.Windows.Documents.Fixed.Model.Graphics.RectangleGeometry();
92+
// .NET Framework
93+
rectangleGeometry.Rect = new System.Windows.Rect(10, 10, 400, 300);
94+
block.InsertRectangle(new System.Windows.Rect(10, 10, 200, 150));
95+
// .NET Standard
96+
//rectangleGeometry.Rect = new Telerik.Documents.Primitives.Rect(10, 5, 400, 300);
97+
//block.InsertRectangle(new Telerik.Documents.Primitives.Rect(20, 30, 200, 150));
98+
99+
block.InsertPath(rectangleGeometry);
100+
{{endregion}}
96101

97102
### Inserting Form-XObject Elements
98103

@@ -101,6 +106,13 @@ The Form (or also known as Form-XObject) is an object that can contain PDF conte
101106
#### __[C#] Example 5: Insert a form__
102107

103108
{{region cs-radpdfprocessing-editing-block_4}}
109+
FormSource simpleForm = new FormSource();
110+
simpleForm.Size = new System.Windows.Size(310, 250); // .NET Framework
111+
//simpleForm.Size = new Telerik.Documents.Primitives.Size(310, 250); // .NET Standard
112+
113+
FixedContentEditor formEditor = new FixedContentEditor(simpleForm);
114+
formEditor.DrawText("Sample text.");
115+
104116
block.InsertForm(simpleForm);
105117
{{endregion}}
106118

@@ -180,26 +192,34 @@ The __Block__ class has some properties and methods that affect how it will be r
180192
#### __[C#] Example 6: Change Block properties__
181193

182194
{{region cs-radpdfprocessing-editing-block_5}}
183-
Block block = new Block();
184-
block.InsertText("block content");
195+
RadFixedDocument radFixedDocument = new RadFixedDocument();
196+
RadFixedPage page = radFixedDocument.Pages.AddPage();
185197

198+
Block block = new Block();
199+
block.GraphicProperties.FillColor = new RgbColor(100, 0, 0, 0);
186200
block.SpacingBefore = 10;
187201
block.SpacingAfter = 5;
188202
block.LineSpacingType = HeightType.Exact;
189203
block.LineSpacing = 15;
190-
block.FirstLineIndent = 12;
204+
block.FirstLineIndent = 0;
191205
block.LeftIndent = 0;
192206
block.RightIndent = 0;
193-
block.BackgroundColor = RgbColors.White;
207+
block.BackgroundColor = new RgbColor(100, 255, 0, 0);
194208
block.HorizontalAlignment = Telerik.Windows.Documents.Fixed.Model.Editing.Flow.HorizontalAlignment.Left;
195209
block.VerticalAlignment = Telerik.Windows.Documents.Fixed.Model.Editing.Flow.VerticalAlignment.Top;
210+
block.InsertText("block content");
196211

197-
var textFragment = new TextFragment();
198-
textFragment.Text = "test bullet";
199-
block.Bullet = textFragment;
200-
block.IndentAfterBullet = 5;
212+
TextFragment bulletTextFragment = new TextFragment();
213+
bulletTextFragment.Text = "•";
214+
block.Bullet = bulletTextFragment;
215+
block.IndentAfterBullet = 15;
216+
217+
var editor = new FixedContentEditor(page);
218+
editor.Position.Translate(50,50);
219+
editor.DrawBlock(block);
201220
{{endregion}}
202221

222+
![Block Properties Result](images/radpdfprocessing-editing-block_5_result.png)
203223

204224
## Drawing a Block
205225

@@ -219,23 +239,26 @@ A Block can be drawn to the content using the __Draw()__ method. The method acce
219239

220240
## Measuring Block Size
221241

222-
Measuring a Block can be achieved with one of the overloads of the __Measure()__ method. Invoking the method without a parameter will return the desired size of the elements in the block and set the block's __DesiredSize__ property. The method is handy when you want to determine the size of the Block. When you want to wrap the text or you page has a limited space make sure to pass the available size to the method.
223-
224-
Calling the overload accepting available size measures the block in that specific size. Additionally to setting the __DesiredSize__ property, it sets the __PendingElements__ property with a collection of the elements that could not fit in the available size.
225-
242+
Measuring a __Block__ can be achieved with one of the two overloads of the __Measure()__ method.
226243

227-
__Example 8__ creates a Block with the text "Hello RadPdfProcessing!" and measures it.
228-
244+
Invoking the method without a parameter will return the desired size of the block elements and set it as the block's __DesiredSize__ property. The method is handy when you want to determine what size the __Block__ should be depending on its content.
229245

230-
#### __[C#] Example 8: Measure block__
246+
__Example 8__ Creates a __Block__ with text, measures the text, and sets the block size to match the content size.
247+
248+
<snippet id='libraries-pdf-editing-block-measure-without-parameter'/>
231249

232-
{{region cs-radpdfprocessing-editing-block_7}}
233-
Block block = new Block();
234-
block.InsertText("Hello RadPdfProcessing!");
235-
Size size = block.Measure();
236-
{{endregion}}
250+
#### Example 8 Result
251+
![Rad Pdf Processing Measuring Block 01](images/RadPdfProcessing_Measuring_Block_01.png)
252+
253+
The second overload accepts available __Size__. Calling it measures the block content as if the __Block__ was in that specific size.
254+
Additionally to setting the __DesiredSize__ property, it also sets the __PendingElements__ property with a collection of the elements that could not fit in the available size.
255+
256+
__Example 9__ Creates a __Block__ with text and draws it with a specific size using the [RadFixedContentEditor]({%slug radpdfprocessing-editing-fixedcontenteditor%}). The block content auto fits to the dimentions of the __Block__. The size of the auto fitted content can then be measured.
237257

258+
<snippet id='libraries-pdf-editing-block-measure-with-parameter'/>
238259

260+
#### Example 9 Result
261+
![Rad Pdf Processing Measuring Block 02](images/RadPdfProcessing_Measuring_Block_02.png)
239262

240263
## Splitting a Block
241264

@@ -274,3 +297,4 @@ The code in __Example 9__ splits a block in two. The first will contains text "H
274297
* [Text and Graphic Properties]({%slug radpdfprocessing-editing-text-and-graphic-properties%})
275298
* [How to Measure Text in WordsProcessing .NET Framework]({%slug wordsprocessing-measure-text-netframework%})
276299
* [How to Measure Text in WordsProcessing .NET Standard]({%slug wordsprocessing-measure-text-netstandard%})
300+
* [How to Generate a PDF Document from Images with FixedContentEditor]({%slug pdf-from-images-with-fixedcontenteditor%})
2.35 KB
Loading
2.82 KB
Loading
1.55 KB
Loading

libraries/radpdfprocessing/formats-and-conversion/plain-text/textformatprovider.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,16 @@ __Example 1__ shows how to use __TextFormatProvider__ to export __RadFixedDocume
3030
#### __[C#] Example 1: Export RadFixedDocument to string__
3131

3232
{{region cs-radpdfprocessing-formats-and-conversion-plain-text-textformatprovider_0}}
33-
Telerik.Windows.Documents.Fixed.FormatProviders.Text.TextFormatProvider provider = new Telerik.Windows.Documents.Fixed.FormatProviders.Text.TextFormatProvider();
34-
RadFixedDocument document = CreateRadFixedDocument();// CreateRadFixedDocument() is a custom method that creates a simple instance of RadFixedDocument. You can replace it with the instance you would like to export.
35-
string documentContent = provider.Export(document);
33+
Telerik.Windows.Documents.Fixed.FormatProviders.Text.TextFormatProvider textFormatProvider = new Telerik.Windows.Documents.Fixed.FormatProviders.Text.TextFormatProvider();
34+
35+
RadFixedDocument document = new RadFixedDocument();
36+
using (RadFixedDocumentEditor radFixedDocumentEditor = new RadFixedDocumentEditor(document))
37+
{
38+
radFixedDocumentEditor.InsertLine("Sample line.");
39+
radFixedDocumentEditor.InsertRun("Sample run.");
40+
}
41+
42+
string documentAsText = textFormatProvider.Export(document);
3643
{{endregion}}
3744

3845

libraries/radpdfprocessing/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ Exporting to PDF format can be achieved with the __PdfFormatProvider__ class. __
152152
}
153153
{{endregion}}
154154

155-
155+
For more complete examples head to the [Developer Focused Examples]({%slug radpdfprocessing-sdk-examples%}) section of the library.
156156

157157
## See Also
158158

libraries/radspreadprocessing/getting-started.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ For more examples and application scenarios of Importing and Exporting a Workboo
158158

159159
>More information about the import and export functionalities of RadSpreadProcessing is available in the [Formats and Conversion section]({%slug radspreadprocessing-formats-and-conversion-general-information%}).
160160
161+
For more complete examples head to the [Developer Focused Examples]({%slug radspreadprocessing-sdk-examples%}) section of the library.
162+
161163
## Using RadSpreadsheet
162164

163165
__RadSpreadsheet__ is a UI control part of the Telerik UI for WPF/Silverlight suites. The document model explained in this section of the documentation and all its features are shared between the __RadSpreadProcessing__ library and __RadSpreadsheet__. [This help section](http://docs.telerik.com/devtools/wpf/controls/radspreadsheet/overview.html) contains information about all UI-specific features of __RadSpreadsheet__.

libraries/radspreadprocessing/working-with-cells/accessing-cells-of-worksheet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Accessing Cells of a Worksheet
33
page_title: Accessing Cells of a Worksheet
44
slug: radspreadprocessing-working-with-cells-accessing-cells-of-worksheet
5-
tags: accessing,cells,of,a,worksheet
5+
tags: accessing,cells,worksheet,selection,workbook,xlsx,spreadprocessing,
66
published: True
77
position: 2
88
---

libraries/radspreadprocessing/working-with-cells/get-set-clear-properties.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Get, Set and Clear Cell Properties
33
page_title: Get, Set and Clear Cell Properties
44
slug: radspreadprocessing-working-with-cells-get-set-clear-properties
5-
tags: get,,set,and,clear,cell,properties
5+
tags: get,set,and,clear,cell,properties,selection,spreadprocessing
66
published: True
77
position: 4
88
---
@@ -50,10 +50,10 @@ Once you have a __CellSelection__ instance, you can easily set and retrieve the
5050
With one minor exception, the get methods of all cell properties return an object of type __RangePropertyValue<T>__. The class exposes two properties that indicate the value of the property for the cell range:
5151

5252

53-
* __IsIndeterminate__: Indicates whether the value of the retrieved property is consistent among all cells in the specified CellSelection. If the property has one and the same value for all cells, __IsIndeterminate__ is set to false. However, if the value of the retrieved property varies throughout the cells in the CellSelection, the __IsIndeterminate__ property is set to true and the __Value__ property of the __RangePropertyValue<T>__ class is set to its default value.
53+
* __IsIndeterminate__: Indicates whether the value of the retrieved property is consistent among all cells in the specified __CellSelection__. If the property has one and the same value for all cells, __IsIndeterminate__ is set to false. However, if the value of the retrieved property varies throughout the cells in the __CellSelection__, the __IsIndeterminate__ property is set to true and the __Value__ property of the __RangePropertyValue<T>__ class is set to its default value.
5454

5555

56-
* __Value__: Contains the value of the retrieved property. If the __IsIndeterminate__ property is set to false, __Value__ contains the value of the retrieved property for the whole CellSelection region. If the __IsIndeterminate__ property is set to true, the __Value__ property is set to its default value.
56+
* __Value__: Contains the value of the retrieved property. If the __IsIndeterminate__ property is set to false, __Value__ contains the value of the retrieved property for the whole __CellSelection__ region. If the __IsIndeterminate__ property is set to true, the __Value__ property is set to its default value.
5757

5858

5959
## Cell Properties
@@ -142,7 +142,7 @@ __Example 3__ illustrates who to retrieve the value of cell B2.
142142

143143

144144

145-
As the document model supports different types of cell values, the CellSelection class offers multiple overloads of the __SetValue()__ method that allow you to produce different types of values. For example, if you choose the method that accepts a double instance, the __Value__ of the cell will be an instance of NumberCellValue. The __SetValue()__ method has three more overloads that take DateTime, string and ICellValue, respectively.
145+
As the document model supports different types of cell values, the __CellSelection__ class offers multiple overloads of the __SetValue()__ method that allow you to produce different types of values. For example, if you choose the method that accepts a double instance, the __Value__ of the cell will be an instance of NumberCellValue. The __SetValue()__ method has three more overloads that take DateTime, string and ICellValue, respectively.
146146

147147

148148
__Example 4__ demonstrates how to set the value of a given selection.
@@ -268,7 +268,7 @@ The result of __Example 7__ is illustrated in __Figure 3__.
268268

269269
## Indent Property
270270

271-
In addition to the __GetIndent()__, __SetIndent()__ and __ClearIndent()__ methods, CellSelection offers two more methods that are used to increase and decrease the value of the __Indent__ property. Those methods are __IncreaseIndent()__ and __DecreaseIndent()__ and neither of them takes arguments. __Example 8__ snippet shows how to use the methods.
271+
In addition to the __GetIndent()__, __SetIndent()__ and __ClearIndent()__ methods, __CellSelection__ offers two more methods that are used to increase and decrease the value of the __Indent__ property. Those methods are __IncreaseIndent()__ and __DecreaseIndent()__ and neither of them takes arguments. __Example 8__ snippet shows how to use the methods.
272272

273273

274274
#### __[C#] Example 8: Increase and decrease indent__
@@ -285,7 +285,7 @@ In addition to the __GetIndent()__, __SetIndent()__ and __ClearIndent()__ method
285285

286286

287287
## See Also
288-
288+
* [Accessing Cells of a Worksheet - CellSelection] ({%slug radspreadprocessing-working-with-cells-accessing-cells-of-worksheet%})
289289
* [Cell Value Types]({%slug radspreadprocessing-working-with-cells-cell-value-types%})
290290
* [PatternType Enumeration](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Spreadsheet.Model.PatternType.html)
291291
* [GradientType Enumeration](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Spreadsheet.Model.GradientType.html)

libraries/radspreadstreamprocessing/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ When reading a document with **RadSpreadStreаmProcessing**, the order of parsin
183183

184184
{{endregion}}
185185

186-
186+
For more complete examples head to the [Developer Focused Examples]({%slug radspreadstreamprocessing-sdk-examples%}) section of the library.
187187

188188
## See Also
189189

0 commit comments

Comments
 (0)