Hi,
We're using princexml, linux version12.3, to render PDF documents.
We've installed prince in a lambda layer with all it's required libraries and env vars (LD_LIBRARY_PATH).
We're running the following prince command from a node.js process:
The /tmp/tmp.html file is written before running this command.
The PDF is generated fine, except if we use custom fonts (Roboto, Ubuntu, etc). For custom fonts, prince defaults to DejaVu.
I replicated the lambda environment in a docker container (as close to the real thing as possible), ran the same prince command from node.js, used the same env vars and libs and we were able to use custom fonts.
I've attached the debug output from the lambda run and the docker run.
On both environments we set the FONTCONFIG_PATH env var as /opt/fonts (lambda unzips layer files under /opt)
If I don't set this env var, prince complains that it can't find any fonts.
All the fonts are under /opt/fonts/<FontName> and there's also a /opt/fonts/fonts.conf file.
I also tried setting the FONTCONFIG_FILE to /opt/fonts/fonts.conf (again, works in our docker test and not in aws lambda layer)
I looked at https://www.freedesktop.org/software/fontconfig/fontconfig-user.html for info on these env vars and configs. I read that fontconfig looks in /etc/fonts/conf.d. That file is not present on the lambda layer nor on my docker image.
I tried looking up which version of fontconfig is installed without any luck.
I'm not really sure what else I can debug.
Thanks for your help and for a great product.
We're using princexml, linux version12.3, to render PDF documents.
We've installed prince in a lambda layer with all it's required libraries and env vars (LD_LIBRARY_PATH).
We're running the following prince command from a node.js process:
/opt/prince/bin/prince --debug --javascript --verbose --structured-log=normal /tmp/tmp.html -o /tmp/tmp.pdf
The /tmp/tmp.html file is written before running this command.
The PDF is generated fine, except if we use custom fonts (Roboto, Ubuntu, etc). For custom fonts, prince defaults to DejaVu.
I replicated the lambda environment in a docker container (as close to the real thing as possible), ran the same prince command from node.js, used the same env vars and libs and we were able to use custom fonts.
I've attached the debug output from the lambda run and the docker run.
On both environments we set the FONTCONFIG_PATH env var as /opt/fonts (lambda unzips layer files under /opt)
If I don't set this env var, prince complains that it can't find any fonts.
All the fonts are under /opt/fonts/<FontName> and there's also a /opt/fonts/fonts.conf file.
I also tried setting the FONTCONFIG_FILE to /opt/fonts/fonts.conf (again, works in our docker test and not in aws lambda layer)
I looked at https://www.freedesktop.org/software/fontconfig/fontconfig-user.html for info on these env vars and configs. I read that fontconfig looks in /etc/fonts/conf.d. That file is not present on the lambda layer nor on my docker image.
I tried looking up which version of fontconfig is installed without any luck.
I'm not really sure what else I can debug.
Thanks for your help and for a great product.