DynaPDF Manual - Page 319

Previous Page 318   Index   Next Page 320

Function Reference
Page 319 of 839
If document information entries are set before calling the function, existing entries in the PDF file
will be replaced with the new values, see the example below.
This function is implemented in an Ansi and Unicode compatible version. The Unicode version is
supported by Windows NT systems only. The file path is converted back to Ansi if the Unicode
version is used under Linux or UNIX.
Return values:
If the function succeeds the return value is 0. If the function fails the return value is a negative error
code. The returned error code can be used to determine whether a wrong password was supplied to
the function. This can be done with the macro PDF_WRONG_PWD(). This macro returns true if the
password was wrong. In Delphi, the C macro is defined as a normal function.
Example (C++):
#include "dynapdf.h"
using namespace DynaPDF;
// First we declare an error callback function.
SI32 PDF_CALL PDFError(const void* Data, SI32 ErrCode, const char*
ErrMessage, SI32 ErrType)
printf("%s\n", ErrMessage);
return 0;
int main(int argc, char* argv[])
pdfSetOnErrorProc(NULL, PDFError);
// The document info entries are changed by the function if set
pdfSetDocInfo(diSubject, "Decrypt PDF files");
pdfSetDocInfo(diCreator, "C++ example test project");
pdfSetDocInfo(diTitle, "Changed title");
pdfDecryptPDF("c:/test.pdf", ptOpen, NULL);
return 0;
void pdfDeleteAcroForm(
const PPDF* IPDF) // Instance pointer
The function deletes a maybe existing Interactive Form. If the document contains no interactive form
the function does nothing.

Previous topic: CreateXFAStream, DecryptPDF

Next topic: DeleteActionFromObj, DeleteActionFromObjEx