Skip to content

Latest commit

 

History

History
56 lines (35 loc) · 1.44 KB

README.md

File metadata and controls

56 lines (35 loc) · 1.44 KB

LibreOffice Lambda Base Image

LibreOffice 7.4 base image for Lambda Node.js 16 x86_64 to be used as a base for your own images.

Usage

Includes CJK fonts support! 877 MB in size.

Node.js 16 x86_64

Set environment variable HOME=/tmp in your Lambda function.

FROM public.ecr.aws/shelf/lambda-libreoffice-base:7.4-node16-x86_64

COPY handler.js ${LAMBDA_TASK_ROOT}/

CMD [ "handler.handler" ]

And your handler.js:

const {execSync} = require('child_process');
const {writeFileSync} = require('fs');

module.exports.handler = () => {
  writeFileSync('/tmp/hello.txt', Buffer.from('Hello World!'));

  execSync(`
  cd /tmp
  libreoffice7.3 --headless --invisible --nodefault --view --nolockcheck --nologo --norestore --convert-to pdf --outdir /tmp ./hello.txt
  `);
};

Other platforms are not supported yet. PRs are welcome!

Troubleshooting

Command failed: Fatal Error: The application cannot be started. User installation could not be completed.

Set environment variable HOME=/tmp in your Lambda function.

Available Tags & Versions

  • 7.4-node16-x86_64
  • 7.3-node16-x86_64

See Also