1. Home
  2. Foxit PDF SDK for Android
  3. How can I set the night mode color?

How can I set the night mode color?

From version 5.1, Foxit PDF SDK for Android supports setting the night mode color as desired. To set the night mode color, you should call the PDFViewCtrl.setMappingModeBackgroundColor(int) and PDFViewCtrl.setMappingModeForegroundColor(int) APIs to set the color as you wish, then set the color mode by using PDFViewCtrl.setColorMode(int).

Note: If the color mode is already set to Renderer.e_ColorModeMapping, you still need to set it again after calling PDFViewCtrl.setMappingModeBackgroundColor(int) and PDFViewCtrl.setMappingModeForegroundColor(int). Otherwise, the settings may not work.

Following is a sample to set the night mode color:

private UIExtensionsManager uiExtensionsManager = null;
...
PDFViewCtrl pdfViewCtrl = uiExtensionsManager.getPDFViewCtrl();
pdfViewCtrl.setMappingModeBackgroundColor(0xff87cefa);
pdfViewCtrl.setMappingModeForegroundColor(0xff7cfc00);
pdfViewCtrl.setColorMode(Renderer.e_ColorModeMapping);
Updated on October 7, 2019

Was this article helpful?

Related Articles

Ready to try Foxit PDF SDK?
Click the link below to download your trial
Free Trial