DynaPDF Manual - Page 230
Previous Page 229 Index Next Page 231

Function Reference
Page 230 of 874
Note that it is not possible to extend or widen an active clipping path. It is only possible to intersect
it with a new one. The intersection of two clipping paths is never larger than the initial clipping
path.
Remarks:
Text objects are handled separately in PDF for use as clipping path. See SetTextDrawMode() for
further information.
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
CloseAndSignFile
Syntax:
SI32 pdfCloseAndSignFile(
const PPDF* IPDF,
// Instance pointer
const char* CertFile, // File path to a PKCS#12 certificate file
const char* Password, // Password to decrypt the cert's private key
const char* Reason,
// Optional reason string
const char* Location) // Optional signers location string
This function finishes the PDF file, digitally signs it, and frees all used resources if the file was not
created in memory. The parameter CertFile must be a valid path to a PKCS#12 certificate file.
DynaPDF signs PDF files on Windows with the Windows Crypt API. This signature handler
supports certificates with up to 4096 bits key length. Note that this function does not add a
timestamp to the signature. If a timestamp should be added then call CloseAndSignFileExt() with a
certificate handle instead.
On non-Windows systems the function uses the AiCrpyto library to sign PDF files. This signature
handler supports certificates with up to 1024 bits key lengths only. However, if certificates with a
stronger encryption should be used it is possible to sign the file with an external signature handler
(see CloseAndSignFileExt() for further information).
The parameter Password holds the password to decrypt the private key. The parameters Reason and
Location are both optional. These strings are printed into the signature field if set.
Digital signatures are stored in a signature field which is a special type of Interactive Form field. If
no signature field exist when the function is called then DynaPDF creates an invisible signature
field. Hidden signature fields appear in the signatures tab of Adobe's Acrobat.
If one or more signature fields exist when the function is called then the first signature field is used
for signing. Signature fields can be created with the function CreateSigField() but it is also possible
to import empty signature fields from an external PDF file.
Previous topic: ClipPath
Next topic: Importing signed PDF files, Possible function errors, CloseAndSignFileEx