Forum > FPSpreadsheet

[fpspreadsheet] Read from ods with password

(1/3) > >>

sorry for my bad english ...

When i must read from a file Ods, i use this code:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---MyWorkbook.ReadFromFile(NomeDocSaleranoTmp, sfOpenDocument);
If a file is protected from a password, how can i read from this?

Thanks, Mario

Sorry, password-protection is supported, in a very elemental form, only for Excel XLSX.

Don't worry, it's no problem.
Thanks anyway for the excellent work done with this Package

Hi Mario

OK - here is a reader for encrypted ods files. Not heavily tested, but it works at least with my test file. Please note that it depends on the Abbrevia (because the FPC zipper cannot extract the encrypted xml subfiles) and DCPCrypt (because FPC does not provide AES decryption) libraries. You can find both libraries in the OPM. No need to install, just download and open the lpk package file so that the IDE knows where they are. Afterwards you can compile the demo program in the attachment.


--- Quote from: wp on July 31, 2023, 12:20:39 pm ---Please note that it depends on  (...) and DCPCrypt (because FPC does not provide AES decryption) libraries.
--- End quote ---
If you don't want the dependency with DCCrypt, I think this could, theoretically, also be done with calls to openssl (aes-256-cbc)  :D

(Not sure if FPC exposes all the necessary calls.)


[0] Message Index

[#] Next page

Go to full version