Approved
Last Updated: 15 Jun 2017 14:06 by ADMIN
ADMIN
Ralitsa
Created on: 08 May 2017 10:40
Category: RichTextEditor
Type: Bug Report
1
IMPROVE. RadRichTextEditor - PrintPreview/Print dialogs should consider changed page size and orientation
Steps to reproduce: 
1. Use the following code snippet: 
public partial class Form1 : RadForm
{
    public Form1()
    {
        InitializeComponent();
        this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
    
        this.radRichTextEditor1.Document = ImportDocx(@"..\..\lorem.docx");
        this.radRichTextEditor1.LayoutMode = DocumentLayoutMode.Paged;
        this.radRichTextEditor1.ChangeSectionPageSize(PaperTypeConverter.ToSize(PaperTypes.A3));
        this.radRichTextEditor1.ChangeSectionPageOrientation(PageOrientation.Landscape);
    }

    private void radButton1_Click_1(object sender, EventArgs e)
    {
        this.radRichTextEditor1.PrintPreview();
    }

    private void radButton3_Click(object sender, EventArgs e)
    {
        this.radRichTextEditor1.Print(true);
    }	
}

Calling the PrintPreview method, the page orientation is updated in PrintSettingDialog. However, the page size is not updated correctly. As result, the printed document is not correct. 
If you call the Print method, the page size and orientation are not updated and the document is printed as in A4/Portrait instead A3/Landscape. 

Workaround:
Use RadPrintDocument: 
private void radButton2_Click(object sender, EventArgs e)
{
    RadPrintDocument radPrintDocument1 = new RadPrintDocument();         
    radPrintDocument1.AssociatedObject = this.radRichTextEditor1;
    radPrintDocument1.Landscape = true;
    PaperSize ps = new PaperSize();
    ps.RawKind = (int)PaperKind.A3;
    radPrintDocument1.DefaultPageSettings.PaperSize = ps;
    radPrintDocument1.Print();
    //this.radRichTextEditor1.Print(true, radPrintDocument1);
}
0 comments