Update return statement, from '{}/program/soffice'... to '{}/program/soffice.bin'...
To make use of libreoffice, I've used subprocess in python and please note that you have to call the command twice to make it work (reason:
still unknown).
Just to bring to your kind notice: I didn't wrap pdf:writer_pdf_Export in quotes like ... --convert-to "pdf:writer_pdf_Export"... because it won't work. Many bloggers wrote this command wrong, resulting in failure of conversion.
Enjoy serverless libreoffice with python, Cheers!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Few things that I change in 2021 to make this work for python 3.8 runtime in Lambda:
decompressor.process
todecompressor.decompress
Create fonts/fonts.conf in your dependency package with following content (assuming libreoffice is extracted under /tmp/instdir dir):
Environment variables:
FONTCONFIG_FILE= /var/task/fonts/fonts.conf
HOME=/tmp
Update return statement, from
'{}/program/soffice'...
to'{}/program/soffice.bin'...
To make use of libreoffice, I've used subprocess in python and please note that you have to call the command twice to make it work (reason:
still unknown).
Just to bring to your kind notice: I didn't wrap pdf:writer_pdf_Export in quotes like ... --convert-to "pdf:writer_pdf_Export"... because it won't work. Many bloggers wrote this command wrong, resulting in failure of conversion.
Enjoy serverless libreoffice with python, Cheers!