DynaPDF Manual - Page 544

Previous Page 543   Index   Next Page 545

Function Reference
Page 544 of 787
After the output file was opened the PDF file is no longer created in memory. So, there is no need to
call FreePDF() after the file was finished with CloseFile() or CloseFileEx().
OpenOutputFile() can be called in a while statement, e.g. to display a open file dialog if the file
could not be opened. Once the function succeeds the PDF file can be finished with CloseFile().
It is strongly recommended to check with HaveOpenDoc() whether a PDF file is still in memory
before calling this function.
This function is implemented in an Ansi and Unicode compatible version. Unicode paths are
converted to UTF-8 on non-Windows operating systems.
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
LBOOL pdfOpenOutputFileEncrypted(
const PPDF* IPDF,
// Instance pointer
const char* OutPDF,
// The output file that should be opened
const char* OpenPwd,
// Optional open password
const char* OwnerPwd,
// Optional owner password (should be set)
TKeyLen KeyLen,
// Encryption key length
TRestrictions Restrict) // Restriction flags (see below)
typedef enum
= 0, // RC4 Encryption -> PDF 1.2, Acrobat 3 or higher
= 1, // RC4 Encryption -> PDF 1.4, Acrobat 5 or higher
kl128bitEx = 2, // RC4 Encryption -> PDF 1.5, Acrobat 6 or higher
= 3, // AES Encryption -> PDF 1.6, Acrobat 7 or higher
= 4, // AES Encryption -> PDF 1.7, Acrobat 9 or higher
= 5
// AES Encryption -> PDF 2.0, Acrobat X or higher
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
#define rsEmbFilesOnly
0x00002000 // PDF 1.6 AES Encryption only
The function opens the output file and sets the encryption parameters. This function enables in
combination with FlushPages() the creation of very large encrypted PDF files with minimal memory

Previous topic: OpenOutputFile

Next topic: OpenTag

Start Chat