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

Theme override for a RadPdfViewer

5 Answers 177 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 10 Apr 2015, 09:29 PM
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?

5 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 13 Apr 2015, 07:01 AM
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.

 
0
David
Top achievements
Rank 1
answered on 13 Apr 2015, 02:30 PM
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?
0
Vanya Pavlova
Telerik team
answered on 13 Apr 2015, 02:40 PM
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.

 
0
David
Top achievements
Rank 1
answered on 13 Apr 2015, 02:56 PM
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?
0
Vanya Pavlova
Telerik team
answered on 13 Apr 2015, 03:28 PM
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.

 
Tags
General Discussions
Asked by
David
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
David
Top achievements
Rank 1
Share this question
or