Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
DynaPDF.SaveAndSignFileExt
Saves and signs the current PDF.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
DynaPDF | 11.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameters
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 |
Result
Returns PDF container, OK or error.
Description
Saves and signs the current PDF.On success you either get back the PDF as container value (in memory PDF) or it returns OK after writing PDF to file (file based PDF).
The plugin also renders a JPEG for preview and includes it within the container value (with DynaPDF Pro).
Same as DynaPDF.SaveAndSignFile, but the signing is done by MBS plugin itself instead of DynaPDF. You pass the PKCS#12 key and certificate by reference number. This way we can support more keys than DynaPDF directly, e.g. with 2048 or 4096 bits.
See Plugin.SetPreviewSize to control size of preview picture.
If you have an open page, we close it automatically for you before doing the import.
See also SaveAndSignFileExt function in DynaPDF manual.
Examples
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) ]
See also
- DynaPDF.New
- DynaPDF.OpenOutputFile
- DynaPDF.OpenPDFFromContainer
- DynaPDF.Release
- DynaPDF.SaveAndSignFileExt1
- DynaPDF.SaveAndSignFileExt2
- Folders.UserDesktop
- PKCS12.ReadFromContainer
- PKCS12.ReadFromFile
- Plugin.SetPreviewSize
Release notes
- Version 13.4
- Added new parameter useDetached for DynaPDF.SaveAndSignFileExt1 function.
- Version 13.1
- Added DynaPDF.SaveAndSignFileExt1 and DynaPDF.SaveAndSignFileExt2 functions to sign a PDF using external PKCS7 signature provider.
- Version 11.5
- Fixed documentation for DynaPDF.SaveAndSignFileExt and added missing ContactInfo parameter.
- Version 11.1
- Fixed bug in DynaPDF.SaveAndSignFileExt function.
- Version 11.0
- Added DynaPDF.SaveAndSignFileExt function to sign PDF file with 2048 or 4096 bit key length.
Blog Entries
- MBS FileMaker Plugin, version 11.5pr1
- MBS FileMaker Plugin, version 11.1pr1
- New in MBS FileMaker Plugin 11.0
- Neues MBS FileMaker Plugin 11.0
- MBS FileMaker Plugin 11.0 - More than 6400 Functions In One Plugin
- MBS FileMaker Plugin, version 11.0pr6
This function checks for a license.
Created 8th January 2021, last changed 25th September 2024