Skip to content

Commit b152cfb

Browse files
authored
Update richtexteditor-custom-page-size.md
1 parent d749b7e commit b152cfb

File tree

1 file changed

+8
-21
lines changed

1 file changed

+8
-21
lines changed
Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Setting Custom Page Size in RadRichTextEditor for WinForms
2+
title: Setting Custom Page Size on Document in RadRichTextEditor
33
description: Learn how to configure a custom page size, such as 3"x3", for documents in RadRichTextEditor.
44
type: how-to
55
page_title: How to Configure Custom Page Sizes in RadRichTextEditor for WinForms
@@ -22,33 +22,20 @@ ticketid: 1683831
2222

2323
## Description
2424

25-
In RadRichTextEditor, I need to set a custom page size, for example, 3"x3". The `ChangePaperTypeCommand` does not allow for custom sizes, and I wonder if there's an alternative way to achieve a custom page size in the document.
26-
27-
This knowledge base article also answers the following questions:
28-
- How can I adjust the page size of a document in RadRichTextEditor?
29-
- Is it possible to define custom dimensions for RadRichTextEditor pages?
30-
- What method allows for custom page sizing in RadRichTextEditor documents?
25+
This knowledge base article also answers how to define custom dimensions of a document in RadRichTextEditor. Baically, RadRichTextEditor provides **Telerik.WinForms.Documents.Model.PaperTypes** enumeration, but it does not allow users to define custom sizes such as 3"x3" dimensions.
3126

3227
## Solution
3328

34-
To set a custom page size in RadRichTextEditor, such as 3"x3", use the `ChangeSectionPageSize()` method. This method should be called after the document is loaded. Follow the steps below to implement custom page sizing:
35-
36-
1. Initialize a new size with the desired dimensions. Keep in mind that the size should be specified in DIPs (Document Independent Pixels). For a 3"x3" size, considering 96 DIPs equals 1 inch, calculate the size in DIPs as follows:
37-
38-
```csharp
39-
var size = new Telerik.WinControls.RichTextEditor.UI.Size(762, 762); // 3"x3" in DIPs
40-
```
29+
To set a custom page size in RadRichTextEditor, such as 3"x 3", use the `ChangeSectionPageSize()` method. This method should be called after the document is loaded. Follow the steps below to implement custom page sizing:
4130

42-
2. Apply the custom size to the document using the `ChangeSectionPageSize()` method:
31+
````C#
4332

44-
```csharp
33+
var size = new Telerik.WinControls.RichTextEditor.UI.Size(762, 762);
4534
this.radRichTextEditor1.RichTextBoxElement.ActiveDocumentEditor.ChangeSectionPageSize(size);
46-
```
4735

48-
By applying these steps, you can set a custom page size for your documents in RadRichTextEditor.
36+
````
4937

5038
## See Also
5139

52-
- [RadRichTextEditor Documentation](https://docs.telerik.com/devtools/winforms/controls/radrichtexteditor/overview)
53-
- [Working with Sections in RadRichTextEditor](https://docs.telerik.com/devtools/winforms/controls/radrichtexteditor/features/sections)
54-
- [Understanding DIPs in Document Processing](https://docs.telerik.com/devtools/document-processing/concepts/dip-units)
40+
- [RadRichTextEditor Documentation](https://docs.telerik.com/devtools/winforms/controls/richtexteditor/overview)
41+
- [Working with Sections in RadRichTextEditor](https://docs.telerik.com/devtools/winforms/controls/richtexteditor/document-elements/section)

0 commit comments

Comments
 (0)