This question is locked. New answers and comments are not allowed.
How to do that with telerik with simple direct printing and RadRichTextBox.Printing functionality.
...
// TELERIK example event - can not find PrintPage event analogy
RadRichTextBox PrintPoorTelerikTextBox;
this
.PrintPoorTelerikTextBox.Document =
this
;
this
.PrintPoorTelerikTextBox.AllowScaling =
true
;
this
.PrintPoorTelerikTextBox.ChangeSectionPageOrientation(PageOrientation.Landscape);
this
.PrintPoorTelerikTextBox.PrintCompleted -= _printEventHandler;
_printEventHandler = (s, a) =>
{
Wave.Platform.PortalFramework.Infrastructure.MessageBox.WaveMessageBox.Info(
"Report was successfully printed."
);
this
.PrintPoorTelerikTextBox.Document =
new
RadDocument();
};
this
.PrintPoorTelerikTextBox.PrintCompleted += _printEventHandler;
this
.PrintPoorTelerikTextBox.PrintStarted+=
delegate
(
object
sender, EventArgs e)
{
};
this
.PrintPoorTelerikTextBox.Print(
this
.PrintOptions);
// none telerik and work very well, hell yeah ;)
--------
PrintDocument pd =
new
PrintDocument();
pd.PrintPage += (sender, e) =>
{
double
scale = 1;
if
(e.PrintableArea.Height <
this
.PrintPoorTelerikTextBox.ActualHeight)
scale = e.PrintableArea.Height /
this
.PrintPoorTelerikTextBox.ActualHeight;
if
(e.PrintableArea.Width <
this
.PrintPoorTelerikTextBox.ActualWidth && e.PrintableArea.Width /
this
.PrintPoorTelerikTextBox.ActualWidth < scale)
scale = e.PrintableArea.Width /
this
.PrintPoorTelerikTextBox.ActualWidth;
if
(scale < 1)
{
ScaleTransform scaleTransform =
new
ScaleTransform();
scaleTransform.ScaleX = scale;
scaleTransform.ScaleY = scale;
this
.PrintPoorTelerikTextBox.RenderTransform = scaleTransform;
}
e.PageVisual =
this
.PrintPoorTelerikTextBox;
};
...