Xojo Conferences
MBSOct2019CologneDE
XDCMarch2020NashvilleUS

DynaPDF Manual - Page 191

Previous Page 190   Index   Next Page 192

Function Reference
Page 191 of 770
If the function succeeds the signature must be written to the PDF file with FinishSignature(). Take a
look into the example external_signatures to determine how the function can be used. It is usually
best to open the the output file right before FinishSignature() will be called (see OpenOutputFile()).
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
CloseFile
Syntax:
SI32 pdfCloseFile(
const PPDF* IPDF) // Instance pointer
This function finishes the PDF file and frees all used resources if the file was not created in memory.
The buffer of a memory based PDF file can be returned by GetBuffer() after this function was called.
Note that GetBuffer() does not free the used resources because it returns a pointer to the original
buffer. After the buffer was processed by your application call FreePDF() to free the used resources.
See also CreateNewPDF(), GetBuffer(), FreePDF().
Remarks:
To encrypt a PDF file use CloseFileEx() instead of CloseFile().
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
CloseFileEx
Syntax:
SI32 pdfCloseFileEx(
const PPDF* IPDF,
// Instance pointer
const char* OpenPwd,
// Open password (can be NULL)
const char* OwnerPwd,
// Owner password (can be NULL)
TKeyLen KeyLen,
// Key length (40 or 128 bit)
TRestrictions Restrict) // Flags to restrict certain features
typedef enum
{
kl40bit
= 0, // RC4 Encryption -> PDF 1.2, Acrobat 3 or higher
kl128bit
= 1, // RC4 Encryption -> PDF 1.4, Acrobat 5 or higher
kl128bitEx = 2, // RC4 Encryption -> PDF 1.5, Acrobat 6 or higher
klAES128
= 3, // AES Encryption -> PDF 1.6, Acrobat 7 or higher
klAES256
= 4, // AES Encryption -> PDF 1.7, Acrobat 9 or higher
klAESRev6
= 5
// AES Encryption -> PDF 2.0, Acrobat X or higher
}TKeyLen;
typedef SI32 TRestrictions;
#define rsDenyNothing
0x00000000 // Encrypt the file only
#define rsDenyAll
0x00000F3C // Deny anything
#define rsPrint
0x00000004 // Deny printing
 

Previous topic: Supported PKCS#7 Format, Hardware Certificates

Next topic: Passwords