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
0
Hello David,
You could check the following forum thread, where the same topic has been already discussed.
Hope this helps.
Regards,
Vanya Pavlova
Telerik
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
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
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
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? :
Regards,
Vanya Pavlova
Telerik
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.