Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

DynaPDF Manual - Page 186

Previous Page 185   Index   Next Page 187

Function Reference
Page 186 of 750
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
#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
 

Previous topic: Hardware Certificates

Next topic: Passwords