Completed
Last Updated: 01 Jul 2019 15:00 by ADMIN
Release R3 2019 (LIB 2019.2.708)
Tomasz
Created on: 14 Jun 2019 06:31
Category: RichTextEditor
Type: Bug Report
0
RtfEditor ignore landscape setting in document

1. Document created via MS-Word, Page orientation is set to Landscape. (MS-Word works OK)

2. Document read into Telerik RichTextEditor and print ignore Landscape settings.

3. Documet "Landscape.rtf" and snapshot in attachmet 

please help me 

Attached Files:
6 comments
Tomasz
Posted on: 21 Jun 2019 07:56

Thanks for answer. So I'll be waiting for new release of RichTextEditor control working correctly.

 

ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 19 Jun 2019 08:43
Hello, Jacek,
           
When you call the Print method, a plain RadPrintDocument is created and indeed, the page orientation is not respected in this case. Currently, only with the PrintPreview method the PageOrientation of the document is taken into consideration.

However, it is a reasonable request the PageOrientation to be respected in all printing cases. 

I have logged it in our feedback portal by making this thread public. You can track its progress, subscribe for status changes and add your comments on the following link - feedback item.

Currently, the possible solution that I can suggest is to use the following custom ribbon UI and RadRichTextEditor:

public class CustomRichTextEditorRibbonBar : RichTextEditorRibbonBar
{
    protected override void BackstageButtonPrint_Click(object sender, EventArgs e)
    {
        this.AssociatedRichTextEditor.Print(true);
    }
}
 
public class CustomRichTextEditor : RadRichTextEditor
{
     
    public override void Print(bool showPrinterSettings)
    {
        RadPrintDocument document = new RadPrintDocument();
        if (this.Document.Sections.Count > 0)
        {
            document.Landscape = this.Document.Sections.First.PageOrientation == PageOrientation.Landscape;
        }
        Print(showPrinterSettings, document);
    }
 
    public override void Print(bool showPrinterSettings, RadPrintDocument document)
    {
        if (this.Document.Sections.Count > 0)
        {
            document.Landscape = this.Document.Sections.First.PageOrientation == PageOrientation.Landscape;
        }
        base.Print(showPrinterSettings, document);
    }
}

Should you have further questions please let me know.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tomasz
Posted on: 19 Jun 2019 04:49

Hello,

1. I'd like to show PrintDialog to give ability to choose printer

2. Information about paper orientation is in document (MS Office can manage this)

3. User select different document and I'dont like to keep information about paper orientation somewhere  else outside and set it programmatically

4. ReachText control should detect paper orientation and set proper 

printDoc.DefaultPageSettings
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 18 Jun 2019 14:24
Hello, Jacek,          

If you call directly Print without showing the print preview window, indeed, the Landscape orientation needs to be changed in the Preferences of the printer. Otherwise, it won't be Landscape.

I can suggest you either to use the PrintPreview approach or use the following code snippet:

RadPrintDocument printDoc = new RadPrintDocument();
printDoc.AssociatedObject = this.radRichTextEditor1;
printDoc.DefaultPageSettings.Landscape = true;
printDoc.Print();

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tomasz
Posted on: 18 Jun 2019 10:15

Hi, I do as you said. Behavior is the same.

I think that printer preferences should be set to proper value (Landscape) but they don't

I use function

PageOrientationorientation = this.radRichTextEditor1.Document.SectionDefaultPageOrientation;

and return value is "Portrait" 

Attached Files:
ADMIN
Dimitar
Posted on: 14 Jun 2019 12:35
Hi Jacek,

I have tested this on my side and it appears to work as expected (see attached). Could you please try this by setting "Microsoft Print To PDF" option as default printer? 

I am looking forward to your reply.

Regards,
Dimitar
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Attached Files: