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

RadRichTextBox print margin error

2 Answers 39 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Pedro
Top achievements
Rank 1
Pedro asked on 28 Feb 2014, 10:47 AM
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;
            this.radRichTextBox.Print(ps);
       }

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"/>
      </telerik:RadRibbonButton>

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 Answers, 1 is accepted

Sort by
0
Missing User
answered on 04 Mar 2014, 12:29 PM
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.

Regards,
Yancho
Telerik
0
Pedro
Top achievements
Rank 1
answered on 11 Apr 2014, 02:54 PM
Hi Yancho, Your comments work well.
Thank you
Tags
RichTextBox
Asked by
Pedro
Top achievements
Rank 1
Answers by
Missing User
Pedro
Top achievements
Rank 1
Share this question
or