I'm trying to convert an xlsx file to pdf using Perl CGI (Mason).
Since I did not find a way to convert a file using pure perl, I'm using
soffice to perform the job.
This works fine until I do it through browser.
The code responsible for conversion is pretty simple:
my @cmd = ( "soffice", "--headless", "--convert-to", "pdf", $filename ); system(@cmd);
This works fine on command line, when ran by a regular user, but running it as Apache user (Mason on Apache), throws an error:
(process:14954): dconf-CRITICAL **: 14:28:42.846: unable to create directory '/usr/share/httpd/.cache/dconf': Permission denied. dconf will not work properly.
Can anyone point me to right direction?
Is there a way to convert xlsx to pdf using just perl, not system commands?
dconf error, I've manually created the directory tree it's complaining about and chowned it to apache user, however, there's next error:
[Java framework] Error in function createSettingsDocument (elements.cxx). javaldx failed! Warning: failed to read path from javaldx
Same goes if I try
Error: Unable to connect or start own listener. Aborting.
unoconv --listener manually before the operation, does the trick and solves my issue. PDF files are being created.