Disabling adding pages with images

You might want to disable letting a user add new pages from their Photo Library or the Camera in Document Editor.

New page view

To do this, you can remove the item outlined in red in the screenshot above by filtering out the page template with the image identifier from the pageTemplates of the documentEditorConfiguration of the main Nutrient configuration.

let pdfViewController = PDFViewController(document: document) { mainConfigBuilder in
mainConfigBuilder.documentEditorConfiguration = mainConfigBuilder.documentEditorConfiguration.configurationUpdated { docEditorConfigBuilder in
docEditorConfigBuilder.pageTemplates = docEditorConfigBuilder.pageTemplates.filter { pageTemplate -> Bool in
pageTemplate.identifier != .image
}
}
}