ToFile
function. The arguments are the PDF, the filename and two booleans - the first is true if the file is to be linearized, the second if a new /ID is to be made for the file.
To write a file encrypted, use ToFileEncrypted
.
Here are the possible permissions:
So to write a file encypted, we pass the PDF object, an encryption method, an array of permissions, an owner password, user password, linearize flag and the filename.