DynaPDF Manual - Page 638

Previous Page 637   Index   Next Page 639

Function Reference
Page 638 of 839
ReEncryptPDF
Syntax:
SI32 pdfReEncryptPDF(
const PPDF* IPDF,
// Instance pointer
const char* FileName,
// File to encrypt
TPwdType PwdType,
// Kind of password see below
const char* InPwd,
// Password to open the PDF file
const char* NewOpenPwd,
// New open password (can be NULL)
const char* NewOwnerPwd, // New owner password (can be NULL)
TKeyLen NewKeyLen,
// Key length for RC4 encryption
TRestrictions Restrict)
// Restrictions
This function encrypts an already encrypted or unencrypted PDF file. The file is recompressed
during import; this reduces the file size in most cases.
By using specific import flags (see SetImportFlags()), it is also possible to remove unwanted objects
from the PDF file, such as annotations, form fields, bookmarks and so on.
If the input file contains a compressed object structure, it will be converted back to a normal PDF
file.
The input PDF file will be replaced with the new one if no error occurred during import. If an error
occurred the file is left unchanged.
It is not possible to change the file except removing specific objects by using specific import flags.
However, the document info entries are changed to new values if they were set beforehand. See
SetDocInfo() for further information.
The encryption flags are described in detail under CloseFileEx().
Remarks:
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 password is required to open the
file. Pass the return value to the macro PDF_WRONG_PWD(), if the macro returns true a password
is required to open the file.
 

Previous topic: Rectangle, Redraw (Rendering Engine)

Next topic: RenameSpotColor, RenderAnnotOrField