DynaPDF Manual - Page 216

Previous Page 215   Index   Next Page 217

Function Reference
Page 216 of 839
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
CloseFile
Syntax:
LBOOL 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:
LBOOL 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
#define rsModify
0x00000008 // Deny modification of contents
#define rsCopyObj
0x00000010 // Deny copying of contents
#define rsAddObj
0x00000020 // No commenting
/* 128/256 bit encryption only -> ignored if 40 bit encryption is used */
#define rsFillInFormFields 0x00000100 // requires rsModify + rsAddObj
#define rsExtractObj
0x00000200 // requires rsModify
#define rsAssemble
0x00000400 // requires rsModify
#define rsPrintHighRes
0x00000800 // Disable high res. printing
#define rsExlMetadata
0x00001000 // PDF 1.5 Exclude metadata streams
 

Previous topic: Supported PKCS#7 Format, Hardware Certificates

Next topic: Passwords