DynaPDF Manual - Page 565

Previous Page 564   Index   Next Page 566

Function Reference
Page 565 of 821
if (pdfCloseFileEx(pdf,NULL,"%3Fc&",kl128bit, rsDenyAll & ~rsPrint))
printf("PDF file \"%s\" successfully created!\n", outFile);
ShellExecute(0, "open", outFile, NULL, NULL, SW_SHOWMAXIMIZED);
pdfDeletePDF(pdf); // Do not forget to delete the PDF instance
return 0;
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.
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.

Previous topic: Editing encrypted PDF files, Damaged PDF files

Next topic: OpenOutputFileEncrypted

Start Chat