Some test text!

keyboard_arrow_down

Get started

keyboard_arrow_down

Xamarin.Forms

keyboard_arrow_down

Fundamentals

keyboard_arrow_down

Document Viewer

keyboard_arrow_down

Document Viewer components

keyboard_arrow_down

Annotation and collaboration

keyboard_arrow_down

Advanced customization

keyboard_arrow_down

Conversion

keyboard_arrow_down

Parsing and extraction

keyboard_arrow_down

Digital signatures

keyboard_arrow_down

Form filling

keyboard_arrow_down

Search

keyboard_arrow_down

Redaction

keyboard_arrow_down

Advanced topics

keyboard_arrow_down

Reference

keyboard_arrow_down

PDF Processing API

Page color mode

In this document
chevron_rightSet the color mode

PDFViewCtrl has three special color modes: night mode, inverted color mode, and custom color mode. In night mode, colors are adjusted to improve reading at night, in inverted color mode, all colors are inverted, and in custom color mode, you can set a custom color for text and the background color.

Color modes from left to right: normal color mode, inverted color mode, night mode and custom color mode.

linkSet the color mode

To set the color mode:

  1. Find the constant value of the color mode

    Color modeConstant value
    Normal color modePDFRasterizer.ColorPostProcessMode.e_postprocess_none
    Night modePDFRasterizer.ColorPostProcessMode.e_postprocess_night_mode
    Inverted color modePDFRasterizer.ColorPostProcessMode.e_postprocess_invert
    Custom color modePDFRasterizer.ColorPostProcessMode.e_postprocess_gradient_map
  2. Call SetColorPostProcessMode.

  3. Optionally, set the PDFViewCtrl background color for the best visual result. You can set background color by calling SetClientBackgroundColor (Xamarin.Android) or SetBackgroundColor (Xamarin.iOS).

    For example, set the background color to black for night mode:

  4. If you are using postprocess_gradient_map, call PDFViewCtrl.SetColorPostProcessColors to set the white and black points. For example, for a sepia effect, try:

  5. Update PDFViewCtrl to redraw the contents:

    Sample result when using postprocess_gradient_map and a light/dark brown for the white/black color: