Change zoom level to fit two pages.

2 posts, 0 answers
  1. Pavel
    Pavel avatar
    32 posts
    Member since:
    Sep 2016

    Posted 27 Dec 2016 Link to this post

    I am working on a template editor, so I have a simple layout with a RadGridView on the left, and a RichTextEditor on the right. When the row gets changed, I load a template into the the RichTextEditor. The editor is readonly (the template is edited in a different window). How can I change the zoom level to automatically show two full pages.

     

    Here's what I have when I load the template the first time http://i.imgur.com/a8vyyov.png
    And here's what I can see when I hold ctrl and use the mousewheel to zoom in 1 level. http://imgur.com/angvElk.png
    I am looking for something in the middle, where I can see 2 pages, and it takes up 100% of the space available.

    Thanks!

  2. Hristo
    Admin
    Hristo avatar
    1508 posts

    Posted 28 Dec 2016 Link to this post

    Hi Pavel,

    Thank you for writing.

    You can achieve the desired result by specifying the scale factor of the editor: 
    this.radRichTextEditor1.Document.LayoutMode = DocumentLayoutMode.Paged;
    ChangePaperTypeCommand command = new ChangePaperTypeCommand(this.radRichTextEditor1.RichTextBoxElement);
    command.Execute(Telerik.WinForms.Documents.Model.PaperTypes.A4);
    this.radRichTextEditor1.ScaleFactor = new Telerik.WinForms.Documents.Model.SizeF(.5f, .5f);

    Additionally, you may check the following forum thread discussing a similar question: http://www.telerik.com/forums/programmatically-zooming#d8zvODRwHkSAIYm3xBCrvQ.

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

    Regards,
    Hristo
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top