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

PrintPreview with document name

3 Answers 35 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Edward
Top achievements
Rank 1
Edward asked on 20 Apr 2012, 08:06 PM
I see that Print has the document name parameter.  However PrintPreveiw() doesn't.  Is there anyway to pass a document name then?

Or alternatively, how do I set the title (I am using HTML provider most of the time).

3 Answers, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 21 Apr 2012, 12:55 PM
Hello Edward,

You can set the document name and show a PrintPreview using this title in the following way:

PrintSettings printSettings = new PrintSettings();
printSettings.DocumentName = myTitle;
printSettings.PrintMode = PrintMode.HtmlPreview;
this.editor.Print(printSettings);

I hope this helps.

All the best,
Iva Toteva
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Edward
Top achievements
Rank 1
answered on 23 Apr 2012, 04:44 PM
It tells me Telerik.Windows.Documents.UI.PrintMode.HtmlPreview is obsolete.

But it looks like I can simply do 

rtb.Print(GenerateTitle(), Telerik.Windows.Documents.UI.PrintMode.HtmlPreview);
0
Iva Toteva
Telerik team
answered on 23 Apr 2012, 05:20 PM
Hi Edward,

You are right, the method I suggested refers to PrintMode.HtmlPreview, which is obsolete. Thank you for pointing this out.
What we have had in mind is that the method of RadRichTextBox PrintPreview() should be used. However, as this method does not accept a document name as a parameter, we will revise our plans and will make sure to provide a way to set the document name in the preview before removing the property.

All the best,
Iva Toteva
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
RichTextBox
Asked by
Edward
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
Edward
Top achievements
Rank 1
Share this question
or