locked
Cannot print text with style from Rich Edit Box RRS feed

  • Question

    1. I used Print API of Window RT API to print canvas but it cannot print text with style from Rich Edit Box. Is there any way to print text with style?
    2. To workaround, we used Render Target Bitmap to render RichEditBox to a image and add it to canvas. The problem is it cannot run through RenderAsync() method. I think it need to be deferred to wait RenderAsync() but I cannot find any deferral for Print. Do you have any ideas about it?
    Monday, December 30, 2013 4:04 AM

Answers

  • Hi Tung,

    Question 1, Yes, if you have a RTF document, you could display the styled text by the code show on this page: http://msdn.microsoft.com/library/windows/apps/br227548.

    Question 2, Need deferral to print? Try with following code to ask for a deferral time:

    TimeSpan period = TimeSpan.FromMiliseconds(100);
    
    Windows.System.Threading.ThreadPoolTimer.CreateTimer(async (source) => 
                 {
                        await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, ()=>{});
                 }
        , period);

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, December 30, 2013 11:36 AM
    Moderator