Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 7.5   8.0   8.1   8.2   8.3   8.4   8.5   9.0   9.1   9.2    Statistic  


Enables encryption for next save command.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
DynaPDF 3.4 Yes Yes Yes Yes Yes
MBS( "DynaPDF.EnableEncryption"; PDF; OpenPwd; OwnerPwd; Encryption { ; RestrictFlags } )   More


Parameter Description Example value
PDF The PDF reference returned from DynaPDF.New. $pdf
OpenPwd Open password. ""
OwnerPwd Owner password. "Hello"
Encryption Which encryption to use. Can be 40bit, 128bit, 128bitEx, AES128, AES256 or AESRev6. "AES256"
RestrictFlags Optional
What restrictions to apply. See above.


Returns OK on success.


Enables encryption for next save command.

Available Encryption methods:
IDEncryptionPDF VersionAcrobat Version
0RC4 40bitPDF 1.2Acrobat 3 or higher
1RC4 128bitPDF 1.4Acrobat 5 or higher
2RC4 128bit improvedPDF 1.5Acrobat 6 or higher
3AES 128bitPDF 1.6Acrobat 7 or higher
4AES 256bitPDF 1.7Acrobat 9 or higher

Available restrictions:
DenyNothing0Encrypt the file only
DenyAll3900Deny anything
Print4Deny printing
Modify8Deny modification of contents
CopyObj16Deny copying of contents
AddObj32No commenting
FillInFormFields256requires Modify + AddObj
ExtractObj512requires Modify
Assemble1024requires Modify
PrintHighRes2048Disable high res. printing
ExlMetadata4096PDF 1.5 Exclude metadata streams
EmbFilesOnly8192PDF 1.6 AES Encryption only

FillInFormFields and later are for 128/256 bit encryption only, so ignored if 40 bit encryption is used.
Please combine those like this: Print and Modify = 4 + 8 = 12.
Please see DynaPDF manual on CloseFileEx function for details on which combination of restrictions are possible.
For passwords, please use only ASCII characters to avoid trouble with text encodings.

Requires DynaPDF Pro license.


Don't allow adding content:

MBS( "DynaPDF.EnableEncryption"; $PDF; ""; "secret"; 1; 16 + 32 + 256 + 1024 )

See also

Blog Entries

Created 18th August 2014, last changed 16th July 2016

DynaPDF.Ellipse   -   DynaPDF.EndLayer

Feedback: Report problem or ask question.

MBS Xojo blog