Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Password protected documents are not handled successfully #137

Open
tadasauciunas opened this issue Mar 13, 2020 · 1 comment
Open

Password protected documents are not handled successfully #137

tadasauciunas opened this issue Mar 13, 2020 · 1 comment

Comments

@tadasauciunas
Copy link

tadasauciunas commented Mar 13, 2020

In our use case, password protected documents are quite common. People try to preview them, and the lambda conversion function fails because obviously the files are encrypted. I do believe that it's expected behavior for these conversions to fail, but fail in a user-friendly manner.

Currently, this case ends up in a JS error:
Cannot read property '1' of null
It's thrown by this line of code

return logs.match(/\/tmp\/.+->\s(\/tmp\/.+) using/)[1];

Because output of soffice --convert-to command outputs some error instead of converted file path

I might provide a pull request to somehow avoid this in the near future. I think the easiest solution would to find an easy way of finding out whether a file is encrypted or not, but a quick google search did not help me out. Perhaps somebody else has a better solution ?

EDIT: I noticed there has already been an issue regarding this problem, but hopefully I or somebody else will come up with a solution this time. #28

@kuharan
Copy link

kuharan commented Nov 22, 2021

Hi @tadasauciunas . My ask is a little different from the one you posted but on the same subject. I want to know the parameter to pass the "password" in the soffice command so that the word document opens and converts to a pdf. Currently, all my docs without passwords work fine except for the ones with passwords.

The error I am getting is -

[INFO]	2021-11-22T18:04:11.299Z	REQUESTID	CompletedProcess(args=['/tmp/instdir/program/soffice.bin', '--headless', '--norestore', '--invisible', '--nodefault', '--nofirststartwizard', '--nolockcheck', '--nologo', '--convert-to', 'pdf:writer_pdf_Export', '--outdir', '/tmp/path', '/tmp/path/file.doc'], returncode=0, stdout=b'', stderr=b'Fontconfig error: Cannot load default config file\nError: source file could not be loaded\n')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants