Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.1   6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4    Statistic  

DynaPDF.EnableEncryption

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 } )

Parameters

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.
4+8

Result

Returns OK on success.

Description

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.

Examples

Don't allow adding content:

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

See also


DynaPDF.Ellipse   -   DynaPDF.EndLayer

Feedback: Report problem or ask question.




Links
MBS FileMaker Plugins