Some test text!
iOS / Guides / Themes
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.
To set the color mode:
Find the constant value of the color mode
Color mode | Constant value |
---|---|
Normal color mode | e_ptpostprocess_none |
Night mode | e_ptpostprocess_night_mode |
Inverted color mode | e_ptpostprocess_invert |
Custom color mode | e_ptpostprocess_gradient_map |
Call setColorPostProcessMode(_ mode: PTColorPostProcessMode)
.
Optionally, set the PDFViewCtrl
background color for the best visual result. You can set background color by calling setBackgroundColor(_ r: UInt8, g: UInt8, b: UInt8, a: UInt8)
.
For example, set the background color to black for night mode:
pdfViewCtrl.setBackgroundColor(0, g: 0, b: 0, a: 255)
If you are using postprocess_gradient_map
, call setColorPostProcessColors(_ white_color: UIColor!, black_color: UIColor!)
to set the white and black points. For example, for a sepia effect, try:
let darkBrown = UIColor(red:0.24, green:0.15, blue:0.04, alpha:1.0)
let lightBrown = UIColor(red:0.96, green:0.88, blue:0.79, alpha:1.0)
pdfViewCtrl.setColorPostProcessColors(lightBrown, black_color: darkBrown)
Update PDFViewCtrl
to redraw the contents:
pdfViewCtrl.update(true)
Sample result when using postprocess_gradient_map
and a light/dark brown for the white/black color:
Trial setup questions? Ask experts on Discord
Need other help? Contact Support
Pricing or product questions? Contact Sales