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:
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
13.5
Statistic
FMM
Blog
Saves and signs the current PDF.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
DynaPDF | 11.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example | Flags |
---|---|---|---|
The PDF reference returned from DynaPDF.New. | |||
PKCS12 Reference | The reference to the PKCS12. See PKCS12.ReadFromContainer or PKCS12.ReadFromFile to load a PKCS#12 file. |
$pkcs12 | |
ContactInfo | The contact info. | Optional | |
Location | Signers location string | $location | Optional |
Reason | Reason string. | $reason | Optional |
Signer | Signers name string | $signer | Optional |
FileName | The file name to be associated with the container value. The file name should include pdf file extension. |
"hello.pdf" | Optional |
Preview | Whether to include a preview JPEG. Default is 1 for including one. Pass zero to disable preview. |
1 | Optional |
Returns PDF container, OK or error.
See also SaveAndSignFileExt function in DynaPDF manual.
Sign a PDF with PKCS#12 key:
# Initialize DynaPDF if needed
If [ MBS("DynaPDF.IsInitialized") ≠ 1 ]
Perform Script [ Specified: From list ; “InitDynaPDF” ; Parameter: ]
End If
# New PDF
Set Variable [ $pdf ; Value: MBS("DynaPDF.New") ]
#
# output to file
Set Variable [ $destPath ; Value: MBS("Folders.UserDesktop") & "/test.pdf" ]
Set Variable [ $r ; Value: MBS("DynaPDF.OpenOutputFile"; $pdf; $destPath) ]
#
# Load PDF from container
Set Variable [ $r ; Value: MBS("DynaPDF.OpenPDFFromContainer"; $pdf; Merge PDFs::InputPDF) ]
Set Variable [ $r ; Value: MBS("DynaPDF.ImportPDFFile"; $pdf; 1) ]
#
# or sign it on saving
Set Variable [ $pkey ; Value: MBS( "PKCS12.ReadFromFile"; "/Users/cs/Desktop/test_cert.pfx"; "123456" ) ]
Set Field [ Merge PDFs::MergeStatus ; MBS("DynaPDF.SaveAndSignFileExt"; $pdf; $pkey; "Hello"; "World"; ""; ""; "Merged.pdf") ]
#
# cleanup
Set Variable [ $r ; Value: MBS( "PKCS12.Release"; $pkey) ]
Set Variable [ $r ; Value: MBS("DynaPDF.Release"; $pdf) ]
This function checks for a license.
Created 8th January 2021, last changed 18th January 2023