PrintPreview with document name

4 posts, 0 answers
  1. Edward
    Edward avatar
    83 posts
    Member since:
    Feb 2011

    Posted 20 Apr 2012 Link to this post

    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).
  2. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 21 Apr 2012 Link to this post

    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 >>

  3. DevCraft banner
  4. Edward
    Edward avatar
    83 posts
    Member since:
    Feb 2011

    Posted 23 Apr 2012 Link to this post

    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);
  5. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 23 Apr 2012 Link to this post

    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 >>

Back to Top