Theme override for a RadPdfViewer

6 posts, 0 answers
  1. David
    David avatar
    4 posts
    Member since:
    Jan 2015

    Posted 10 Apr 2015 Link to this post

    We have an application wide theme that I need to override. Our application has a black background on everything but within the RadPdfViewer I need it to have a white background so the pdf files are easier to read. How do I override the background color just in this one control?
  2. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 13 Apr 2015 Link to this post

    Hello David,


    You could check the following forum thread, where the same topic has been already discussed. 
    Hope this helps. 


    Regards,
    Vanya Pavlova
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. David
    David avatar
    4 posts
    Member since:
    Jan 2015

    Posted 13 Apr 2015 in reply to Vanya Pavlova Link to this post

    This still doesnt seem to fix my issue. I have tried using Blend and it will let me change the colors of the scroll bars but when I click on the area where the document actually shows it doesnt give me a background option. What is happening is because of our theme the color behind the pdf is black and makes it hard to view the document so I need to be able to have a white background just in this one control on this one window. If i break it down to the individual parts, this part is referred to as the "ContentPresenter" I believe but I just cant seem to get it to let me give it a background color.  Any other ideas on how I can get a white background behind my pdf documents?
  5. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 13 Apr 2015 Link to this post

    Hi David,


    As described in this forum thread you should declare a style targeted at FixedDocumentPagesPresenter and set the Background from there. 

    I'm attaching you sample demo that illustrates this approach. 


    Regards,
    Vanya Pavlova
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  6. David
    David avatar
    4 posts
    Member since:
    Jan 2015

    Posted 13 Apr 2015 in reply to Vanya Pavlova Link to this post

    I just tried your code in my program and gave it a DocumentSource of just a local pdf that I have that has a white background and as you can see in the screenshots at runtime our theme overrides the style and puts it back to a black background behind the pdf which doesnt display well. Do you have any other ideas on how to fix this?
  7. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 13 Apr 2015 Link to this post

    Hi David,


    The style for RadPdfViewer's background is correctly applied. The dark background of the page might come from a style targeted at a Page.


    Can you please check whether you have a defined style similar to the following? :

     
      xmlns:fixedui="clr-namespace:Telerik.Windows.Documents.Fixed.UI;assembly=Telerik.Windows.Controls.FixedDocumentViewers"
     
    <Style x:Key="PageStyle" TargetType="fixedui:Page">
         <Setter Property="Background" Value="{StaticResource SomeDarkColor}"/>
    </Style>


    Regards,
    Vanya Pavlova
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top
UI for WPF is Visual Studio 2017 Ready