Scale or resize PDFs on iOS

Nutrient’s Processor class can be used to scale pages of a document.

The page scaling feature is only available if you have the Document Editor component enabled in your license.

Here’s how to scale pages via the Processor API:

// Create a default configuration.
let configuration = Processor.Configuration(document: document)!
// Scale the page down to half its size.
let pageInfo = document.pageInfoForPage(at: page)!
let pageSize = pageInfo.size
let newPageSize = CGSize(width: pageSize.width / 2, height: pageSize.height / 2)
configuration.scalePage(page, to: newPageSize)
// Start the conversion from `document` to `scaledDocumentURL`.
let processor = Processor(configuration: configuration, securityOptions: nil)
try processor.write(toFileURL: scaledDocumentURL)