Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
9.5
10.0
10.1
10.2
10.3
10.4
10.5
11.0
11.1
11.2
Statistic
FMM
Blog
Enables encryption for next save command.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
DynaPDF | 3.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example | Flags |
---|---|---|---|
The PDF reference returned from DynaPDF.New. | |||
OpenPwd | Open password. | "" | |
OwnerPwd | Owner password. | "Hello" | |
Encryption | Which encryption to use. Can be 40bit, 128bit, 128bitEx, AES128, AES256 or AESRev6. | "AES256" | |
RestrictFlags | What restrictions to apply. See above. | 4+8 | Optional |
Returns OK on success.
ID | Encryption | PDF Version | Acrobat Version |
0 | RC4 40bit | PDF 1.2 | Acrobat 3 or higher |
1 | RC4 128bit | PDF 1.4 | Acrobat 5 or higher |
2 | RC4 128bit improved | PDF 1.5 | Acrobat 6 or higher |
3 | AES 128bit | PDF 1.6 | Acrobat 7 or higher |
4 | AES 256bit | PDF 1.7 | Acrobat 9 or higher |
DenyNothing | 0 | Encrypt the file only |
DenyAll | 3900 | Deny anything |
4 | Deny printing | |
Modify | 8 | Deny modification of contents |
CopyObj | 16 | Deny copying of contents |
AddObj | 32 | No commenting |
FillInFormFields | 256 | requires Modify + AddObj |
ExtractObj | 512 | requires Modify |
Assemble | 1024 | requires Modify |
PrintHighRes | 2048 | Disable high res. printing |
ExlMetadata | 4096 | PDF 1.5 Exclude metadata streams |
EmbFilesOnly | 8192 | PDF 1.6 AES Encryption only |
Don't allow adding content:
MBS( "DynaPDF.EnableEncryption"; $PDF; ""; "secret"; 1; 16 + 32 + 256 + 1024 )
Create AES 256-bit encrypted PDF:
# Initialize DynaPDF if needed
If [ MBS("DynaPDF.IsInitialized") ≠ 1 ]
Perform Script [ Specified: From list ; “InitDynaPDF” ; Parameter: ]
End If
# Clear current PDF document
Set Variable [ $pdf ; Value: MBS("DynaPDF.New") ]
# Add page
Set Variable [ $r ; Value: MBS("DynaPDF.AppendPage"; $pdf) ]
# Write some text
Set Variable [ $r ; Value: MBS("DynaPDF.SetFont"; $pdf; "Helvetica"; 0; 12) ]
Set Variable [ $x ; Value: MBS("DynaPDF.GetPageHeight"; $pdf)-100 ]
Set Variable [ $r ; Value: MBS("DynaPDF.SetFillColor"; $pdf; 0; 0; 0) ]
Set Variable [ $r ; Value: MBS("DynaPDF.WriteText"; $pdf; 100; $x; "Some black text") ]
# End page
Set Variable [ $r ; Value: MBS("DynaPDF.EndPage"; $pdf) ]
# Add encryption with AES
Set Variable [ $r ; Value: MBS( "DynaPDF.EnableEncryption"; $PDF; "xxx"; "yyy"; "AES256"; 8+16+32+256+512+1024+2048+4096 ) ]
# Save PDF to put in container later
Set Variable [ $PDFData ; Value: MBS("DynaPDF.Save"; $pdf; "hello.pdf") ]
Set Variable [ $r ; Value: MBS("DynaPDF.Release"; $pdf) ]
# Put in Container
Set Field [ Create Text::PDF ; $PDFData ]
Created 18th August 2014, last changed 15th July 2019
DynaPDF.Ellipse - DynaPDF.EndLayer
Feedback: Report problem or ask question.