RadRichTextBox print margin error

3 posts, 0 answers
  1. Angel
    Angel avatar
    8 posts
    Member since:
    Apr 2011

    Posted 28 Feb 2014 Link to this post

    I have a radrichtextbox with a xaml import raddocument.The document view is correctly in de user control, but i have a problem when i want print. In the windows i set one button to print directly with the next code.

            private void DirectPrintRadRibbonButton_Click(object sender, RoutedEventArgs e)
                Telerik.Windows.Documents.UI.PrintSettings ps = new Telerik.Windows.Documents.UI.PrintSettings();
                ps.PrintMode = Telerik.Windows.Documents.UI.PrintMode.Native;
                ps.UseDefaultPrinter = false;
                ps.ForceVector = true;
                ps.PrintScaling = Telerik.Windows.Documents.UI.PrintScaling.None;

    When i print form the RadRichTextBoxRibbonUI

          <telerik:RadRibbonButton BorderBrush="Gray" CommandParameter="Native" CornerRadius="3" Height="80" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding PrintCommand}" telerik:RadRichTextBoxRibbonUI.ShouldCloseBackstage="True" VerticalContentAlignment="Center" Width="90">
                     <Image HorizontalAlignment="Center" Source="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/ApplicationMenu/pagesetup.png" Stretch="None"/>

    the print result it's fine, but when I use my direct button all my text is shifted to the right and down (Top and left margins i guess).
  2. Yancho
    Yancho avatar
    72 posts

    Posted 04 Mar 2014 Link to this post

    Hi Angel,

    Thank you for your interest in RadRichTextBox!

    The most probable cause for such a strange behavior is because of the PrintScaling settings. The default printing which is executed from the RadRichTextBoxRibbonUI sets different PrintScaling mode than yours.

    In the given code you define PrintScaling like this:
    ps.PrintScaling = Telerik.Windows.Documents.UI.PrintScaling.None;

    Could you try to replace the above code with the following one:
    ps.PrintScaling = Telerik.Windows.Documents.UI.PrintScaling.ShrinkToPageSize;

    In case this does not help please provide further details on your setup. I would be glad to provide any assistance.

  3. DevCraft R3 2016 release webinar banner
  4. Angel
    Angel avatar
    8 posts
    Member since:
    Apr 2011

    Posted 11 Apr 2014 in reply to Yancho Link to this post

    Hi Yancho, Your comments work well.
    Thank you
Back to Top