We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to set the page background color ?

Thread ID:

Created:

Updated:

Platform:

Replies:

123799 Apr 22,2016 08:02 AM UTC Apr 27,2016 12:01 PM UTC WPF 4
loading
Tags: PDF
fff
Asked On April 22, 2016 08:02 AM UTC

Hi All,

Must likely be a stupid simple question but I can not find it
I am adding pages to pdf with the typical : page = mypdfdocument.Pages.Add();

But how to set the color of the page background ?
(note: I do not want a trick like inserting one object of the full page width & height, as it creates other problems if page is later changed or other)

thanks,
Fabrice

Chinnu Muniyappan [Syncfusion]
Replied On April 25, 2016 11:39 AM UTC

Hi Fabrice, 

Thank you for contacting Syncfusion support. 

PDF page doesn’t have the support to set the background colors directly, we have to achieve this using draw and fill a rectangle object, we have created a simple sample for your reference, please refer the below sample. 

(note: I do not want a trick like inserting one object of the full page width & height, as it creates other problems if page is later changed or other) 
Please provide a details of the issues you are facing when trying the above solution to set the background color, so that we will provide you a solution. 
 

Please let us know if you have any concern. 

Regards, 
Chinnu 
 


fff
Replied On April 26, 2016 11:17 AM UTC

Hi Chinnu,

thanks for your fast answer.

Yes of course this method is possible, but I was hopping to avoid one more layer in the page
I thought that because acrobat reader permits to change the background color in its interface, that was just a parameter, not one more object.
But if you say the PDF sta,ndard does not have that parameter for page, then ... no choice ... leave it like that

FYI, my reasons:
I have noticed that if the page has many layers/objects (...) per page, there is some visual glitch when reading the pdf in acrobat reader
The page is constructed by adding the elements while scrolling, and with the above method, the page is first displayed white, and very soon after the color changes ; this process is fast but noticeable to the eyes & not very pleasant (not SF fault here, just the method of acrobat & likely the speed of the computer)
This is the same with the other objects in the page, but here much more visible as it changes the whole color in the page, so a big surface

But OK, leave it like that ; nothing more to do here
Thanks again,
Fabrice


Chinnu Muniyappan [Syncfusion]
Replied On April 27, 2016 12:01 PM UTC

Hi Fabrice, 

Thank you for your update. 

As mentioned earlier this is the default behavior of the Adobe reader; this is not an issue from our side,  

Please let us know if you need any further assistance. 

Regards, 
Chinnu 


Chinnu Muniyappan [Syncfusion]
Replied On April 27, 2016 12:01 PM UTC

Hi Fabrice, 

Thank you for your update. 

As mentioned earlier this is the default behavior of the Adobe reader; this is not an issue from our side,  

Please let us know if you need any further assistance. 

Regards, 
Chinnu 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;