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

DynaPDF Manual - Page 515

Previous Page 514   Index   Next Page 516

Function Reference
Page 515 of 750
}
pdfDeletePDF(pdf); // Do not forget to delete the PDF instance
return 0;
}
OpenOutputFile
Syntax:
LBOOL pdfOpenOutputFile(
const PPDF* IPDF,
// Instance pointer
const char* OutPDF) // Output file name
The function opens the output file into which the PDF file should be written. The PDF file must be
created in memory if this function should be used. This is the case if the output file name is set to
NULL or to an empty string in CreateNewPDF().
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.
Remarks:
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.
OpenOutputFileEncrypted
Syntax:
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
{
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
 

Previous topic: Damaged PDF files

Next topic: OpenTag