This is a migrated thread and some comments may be shown as answers.

Programmatically zooming ?

2 Answers 191 Views
RichTextEditor
This is a migrated thread and some comments may be shown as answers.
Bekir
Top achievements
Rank 1
Iron
Bekir asked on 03 Mar 2015, 10:37 PM
Hello,

1. When RadRichTextEditor is opening (DocumentLayoutMode.Paged) in Paged mode, the document page is shown little.  
Is there a way make it bigger (zoomed) while opening?

2. The zoom function is working perfectly with ctrl + mouse middle button. But I didn't find any descripton about programmatically zooming in Telerik documentations. How can I make zoom with programmatically?

3. And I want to prepare some page sizes (A3, A4 e.g.) for ready to use. I use this code for A4 page size,

documentEditor.ChangeSectionPageSize(new Telerik.WinControls.RichTextEditor.UI.Size(794, 1096));

Is that true?

Best regards...

2 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 06 Mar 2015, 02:26 PM
Hello Bekir,

Thank you for writing.

Straight to your questions:
1. and 2. Zooming in and out a document in the RadRichTextEditor affects the value of the ScaleFactor property. You can globally allow or forbid zooming in and out by modifying the value of the AllowScaling property.

3. A better way to set a page size is to use our PaperTypeConverter static class and set the size to the SectionDefaultPageSize property of the contained RadDocument object. My code snippet below sets a scale factor of 200% and uses a format A4 as section default:
public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
 
        this.Load += Form1_Load;
    }
 
    private void Form1_Load(object sender, EventArgs e)
    {
        this.radRichTextEditor1.Document.LayoutMode = DocumentLayoutMode.Paged;
        this.radRichTextEditor1.ScaleFactor = new Telerik.WinForms.Documents.Model.SizeF(2f, 2f);
        this.radRichTextEditor1.Document.SectionDefaultPageSize = PaperTypeConverter.ToSize(PaperTypes.A4);
    }
}

I hope this information helps. Should you have further questions please do no hesitate to write back.

Regards,
Hristo Merdjanov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Bekir
Top achievements
Rank 1
Iron
answered on 06 Mar 2015, 06:32 PM
Hello Hristo,
Thank you.
Regards.
Tags
RichTextEditor
Asked by
Bekir
Top achievements
Rank 1
Iron
Answers by
Hristo
Telerik team
Bekir
Top achievements
Rank 1
Iron
Share this question
or