write(toFile:withOptions:)
Writes the document to a file at the specified path with the specified options.
Declaration
func write(toFile path: String, withOptions options: [PDFDocumentWriteOption : Any]? = nil) -> BoolDiscussion
The most commonly-used options are kCGPDFContextOwnerPassword, kCGPDFContextUserPassword, kCGPDFContextAllowsCopying and kCGPDFContextAllowsPrinting. For more details about these options, see Auxiliary Dictionary Keys.