Appearance Mode Manager

PSPDFKit allows you to customize PDF rendering styles (i.e page and text colors) and its app theme via PSPDFAppearanceModeManager.

Appearance Mode Night

Night Appearance Mode

Note: Changing the appearance mode will change the PDF rendering style, but it does not modify the PDF on disk.

Appearance Mode

You can programmatically set the appearance mode for your PSPDFViewController’s PSPDFAppearanceModeManager, like so:

1
2
let pdfController = ...
pdfController.appearanceModeManager.appearanceMode = .sepia
1
2
PSPDFViewController *pdfController = ...
pdfController.appearanceModeManager.appearanceMode = PSPDFAppearanceModeSepia;

The default value of the PSPDFAppearanceMode of a PSPDFViewController’s PSPDFAppearanceModeManager is PSPDFAppearanceModeDefault.

Allowed Appearance Modes

You can set the allowedAppearanceModes in PSPDFSettingsViewController in your PSPDFConfiguration, like so:

1
2
3
let configuration = PSPDFConfiguration { (builder) in
    builder.allowedAppearanceModes = [.night]
}
Copy
1
2
3
PSPDFConfiguration *configuration = [PSPDFConfiguration configurationWithBuilder:^(PSPDFConfigurationBuilder *builder) {
    builder.allowedAppearanceModes = PSPDFAppearanceModeNight;
}];
Allowed Appearance Modes