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

PDF conversion for the password protected doc file #28

Closed
krisalay opened this issue Oct 5, 2018 · 10 comments
Closed

PDF conversion for the password protected doc file #28

krisalay opened this issue Oct 5, 2018 · 10 comments

Comments

@krisalay
Copy link

krisalay commented Oct 5, 2018

Hello,

I am trying to convert the password protected .docx file to pdf using this nodejs package.
But I am not able to figure out the way to do so. Can you please let me know the best way to achieve this functionality?

@vladholubiev
Copy link
Member

Hey @krisalay!

I'm glad you found my package useful, but unfortunately, I haven't worked with password-protected files so can't advise you on this topic.

However, if you find a way to do this from LibreOffice CLI you can pass any arguments you want to execSync, as all it does is wrapping original LibreOffice CLI

@krisalay
Copy link
Author

krisalay commented Oct 5, 2018

@vladgolubev Thank you for your quick response. I will try to do it using the CLI.

@krisalay
Copy link
Author

krisalay commented Oct 5, 2018

@vladgolubev
I have another issue.
I am running my service in kubernetes with 32 replica sets. And I passes about 11k requests to the server for the conversion process.
For about 1.5k requests, I get the following error:

[Error: Command failed: /tmp/instdir/program/soffice --headless --invisible --nodefault --view --nolockcheck --nologo --norestore --convert-to pdf _local_bucket/ec805320-720d-4781-b74e-abfab751b5ed.docx --outdir _local_bucket
terminate called after throwing an instance of 'com::sun::star::lang::WrappedTargetRuntimeException'
Application Error](url)

Can you please let me know what the issue is?

@vladholubiev
Copy link
Member

@krisalay I can't give any guarantees this package will work in Kubernetes

It was compiled to work in AWS Lambda, as the name of the package states aws-lambda-libreoffice

So, unfortunately, I can't tell what this issue is. You may find help on LibreOffice/StackOverflow/Kubernetes forums

@krisalay
Copy link
Author

krisalay commented Oct 5, 2018

@vladgolubev Thanks, I will look into it.

@ncruces
Copy link

ncruces commented Oct 5, 2018

About that, @vladgolubev (this only working in AWS).

First of all, thanks for this package. Helped me tremendously.
I've been meaning to say this, and wasn't sure where.

I can report that this package works out-of-the-box in Google Cloud Functions (and I imagine Firebase), as long as I select the beta Node.js 8 runtime (because of #15).

I'm using a 2048MB/2.4GHz “VM”, but the 1024MB/1.4GHz would do as well.

@vladholubiev
Copy link
Member

vladholubiev commented Oct 5, 2018

Thanks for the info @ncruces! I'll add this to README

UPD: done

@ghost
Copy link

ghost commented Dec 3, 2018

@ncruces I have just tested for Google Cloud Functions ... And out-of-the box (i take example from the readme.md), it's not working for me :( ... How did you make the plugin working so easily ?

Here is my error : "Cannot find LibreOffice. Document conversion cannot be used"

Thanks in advance,

@ncruces
Copy link

ncruces commented Dec 3, 2018

Package as changed since I've used it last. I don't use this out-of-the-box any more. I also don't recognize that error message.

Things to look for: are you using Node.js 8 Beta?
Do you have sufficient memory to deploy this (you need at least 1 GB)?

I'm using the same LibreOffice binaries compiled here (lo.tar.br), so I'm sure those work. But I'm using Go instead of Node.js. Cloud Functions Go is still a closed alpha and under NDA, so it doesn't make sense to contribute my solution. I'll revisit that decision in the future. Changes I made are "documented" here.

@ghost
Copy link

ghost commented Dec 3, 2018

Thanks @ncruces for your answers !!!
I found my error ... I use a local LibreOffice on local env for testing and this awesome plugin in prod env ... Bad "if" implementation ...

And I can confirm ... the plugin is still working out-of-the-box on Cloud Functions !!! :)

Thanks to all !!!

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

3 participants