Loading Encrypted Files

Some file formats (DOC, DOCX, PDF, PPT, PPTX, XLS, XLSX, XLSB, etc) are encrypted using a password. These files will be loaded properly only if your application provides a decryption password.

The decryption password for all formats can be provided through the FILEDECRYPTOPTIONS structure by calling LFileSettings::SetDecryptOptions.

The decryption password for the PDF files can also be provided using FILEPDFOPTIONS.szPassword by calling LFileSettings::SetPDFOptions.

The FILEDECRYPTOPTIONS structure has two mechanisms for providing a password:

If the password provided by FILEDECRYPTCALLBACK callback is not valid, the callback will be called again until one of the following happens:

The user is responsible to avoid infinite loops. If the FILEDECRYPTCALLBACK returns each time the same incorrect password, the application will go into an infinite loop, because when the callback returns an invalid password, LEADTOOLS will call it again. Then the process would never end, consuming a lot of CPU time until the user kills the application.

These settings are only valid for the current thread. In multi-threaded applications, call LFileSettings::SetDecryptOptions in each thread that needs to load encrypted files.

Help Version 22.0.2023.2.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.