Programmatically zooming ?

3 posts, 0 answers
  1. Bekir
    Bekir avatar
    16 posts
    Member since:
    Sep 2010

    Posted 03 Mar 2015 Link to this post

    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. Hristo
    Admin
    Hristo avatar
    716 posts

    Posted 06 Mar 2015 Link to this post

    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.

     
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Bekir
    Bekir avatar
    16 posts
    Member since:
    Sep 2010

    Posted 06 Mar 2015 in reply to Hristo Link to this post

    Hello Hristo,
    Thank you.
    Regards.
Back to Top