Hello everyone,
I've implemented a night mode for my application, where I've changed the background color of PDFs to black. However, when the PDF has many pages and I scroll through it, the PDF Viewer renders the pages with a white background, which looks quite jarring. Is there any available API or method to modify the background color during PDF rendering? Any help would be greatly appreciated.
Thank you!
Rhyme, As per the provided details, we come to know that you have changed the background color of the pages in the PDF document. Usually PDF document does not have background property for the pages in it, that’s why every PDF viewer application shows the PDF pages in the white color ,this is the default behavior. Can you please provide the document which you have changed the background color, it will be helpful for us to reproduce and analysis on this.
Hello Manigandan,
I would be happy to provide you with the relevant PDF. To make it easier for you to test, I have changed its background color to yellow. When you open it in PdfViewer and quickly scroll through it, the background color will change from yellow to white and then back to yellow again.
Rhyme, As we
mentioned in the previous update, Pdf pages have no property for background
color, so all viewer application will display PDF pages as white before
rendering. You can also check that behavior with Google Chrome and Microsoft
Edge. Additionally, there is no API to alter the background color before
rendering. However, we are looking into possible workarounds to full fill your
requirement. We will analyze and provide further details on July 6, 2023.
Rhyme, we have checked the possibility to achieve your requirement to render different page color from sample. But there is no option to set background color. All other viewer application will also display PDF pages as white before its render. It is the default behavior which you can also check with Google Chrome and Microsoft Edge. So it is not possible to change the page color before its render.
Most welcome.