I can't get headless soffice to tell me why conversion does not work and I cannot seem to figure out what flags I could pass to get some error output.
Version 1:
/usr/bin/soffice --headless --convert-to pdf test.key --outdir .
Version with all my silly attempts:
HOME=/tmp && /usr/bin/soffice --nologo --nofirststartwizard --headless --convert-to pdf test.key --outdir . > logfile.txt 2>&1
When I run the above I get a silent failure: I execute the command and then there's not console output.
Thoughts?
FYI:
- I'm running this on a Debian server.
- This works perfectly well for PowerPoint conversion.
Make sure that not only are you not running an instance of libreoffice on your pc but also that you have not got the libreoffice Quickstarter module running either, both will result in a silent failure, when trying to do this sort of thing.
Closing other instances of LibreOffice may solve it. It seems to be a bug in LibreOffice.org versions <5.3. You can find an explanation and solutions in
this answer.
Related
I have been trying to pip install psycopg2 for some time now
I have just updated to python 3.7.4, before this problem started.
To set my path to a specific python version I used the code below.
nano .bash_profile
I thought that it would now be easy for my system to identify the path of the newly installed python, as to enable it to install psycopg2. Then the below started happening.
The second line of system terminal or python terminal is now always showing:
-bash: zzzzz#: command not found on my terminal
No matter what I type on my terminal, I am always getting command not found
This would mean you literally have "zzzzz" somewhere in the bash_profile. Bash is seeing "zzzzz" as just another command to run at startup like the rest of the profile script. As there is nothing in your PATH matching that string, bash reports the issue back to you.
Either remove the extra line from your .bash_profile. OR use a terribly wasteful work-around!
ln -s /bin/true /bin/zzzzz
This will create a symbolic link to the "true" binary (all it ever does is return true) from zzzzz. Now bash can find zzzzz and run it during start up, which does nothing. No more error and an absurd work around. You should fix the file.
I am trying to use Python's Popen() to retrieve graph data from a multiple rrd files. Due to complexity of app where the following piece of code is utilised, I rely on rrdtool graph parameter -Z for handling missing files for me:
#!/bin/python3
import subprocess
cmd = '/opt/rrdtool/bin/rrdtool graph - -a JSONTIME -Z --width 924 --start 1486428000 --end 1486471200 DEF:foo1=ch1.rrd:flows:MAX DEF:foo2=ch2.rrd:flows:MAX AREA:foo1#000:"ch1" AREA:foo2#606060:"ch2":STACK'
path = '/data/live/pokus/rrd/channels/'
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, cwd=path, shell=True)
p.wait()
if p.returncode is not 0:
print("Error")
else:
print(p.stdout.read().decode(encoding="utf-8"))
Following code works as expected when both files ch1.rrd and ch2.rrd are present. When one of them is missing, whole thing hangs indefinitely until I kill the rrdtool process manually from htop. Then python detects nonzero return code and reports error.
Using shell=False and shlex.split() on cmd does not help.
When I execute the same command from bash, even with the missing files rrdtool does the job as expected.
Unfortunately I can't use rrdtool bindings for python and also I am stuck on python 3.4.5. rrdtool version is 1.6.0.
I am glab for any idea how to overcome this. I would prefer solution that does not include testing whether files exist from python and keeps the -Z parameter in rrdtool command. Also using timeout on p.wait() isn't a viable solution.
Thanks in advance
Ok, I found the solution.
The reason why Python (namely p.wait) hanged was because rrdtool did not know the minimum step size (parameter -S) resulting in step size of two seconds. This way, output of the rrdtool was able to fill the OS buffers and that deadlocked p.wait. According to Python docs, Popen.communicate should be a way to go.
I'm trying to install gearman in my Ubuntu 12.04.
Actually installation is successful. But when I start the daemon, I'm getting this error.
gearmand: Could not open log file "/usr/local/var/log/gearmand.log" from xxxx switching to stderr. (No such file or directory)
Am I missing anything here? I tried installing various versions of gearman, still the result is same.
Any help please...
/usr/local/var/log/gearmand.log is default value of --log-file option.
See gearmand --help
-l [ --log-file ] arg (=/usr/local/var/log/gearmand.log)
Log file to write errors and
information to. If the log-file
parameter is specified as 'stderr',
then output will go to stderr. If
'none', then no logfile will be
generated.
I wana use the pyoo.py package to control libreOffice via Python.
There are good tutorials available. First step is to open a socket with following command.
soffice --nologo --norestore --nodefault --accept="socket,host=localhost,port=2002;urp;"
But it does not work, it stucks.(Stucks means I enter the command in the cmd but no response)
If I kill the sOffice Process in the Task-Manger it will continue.
It worked once and than never again.
I use Win7 64bit and LibreOffice 5
First be sure that all instances and processes of soffice are closed, because if office is already open, it will not start listening on a socket.
Well there is something wrong with your command; it isn't working for me. What I normally use is:
chdir "%ProgramFiles(x86)%\LibreOffice 5\program\"
start soffice -accept=socket,host=0,port=2002;urp;
On Linux I use the following command, and the same arguments work on Windows:
loffice "--accept=socket,host=localhost,port=2002;urp;" --writer
EDIT:
From your comment, it sounds like you were able to get it to work by removing various arguments to see which one was causing the problem.
I am trying to run DOMPDF from a windows command line. I am using the documentation from the domPDF website as a reference. DOMPDF usage
C:\>php -f C:\dompdf\dompdf.php -- C:\example.html
When I run this command I get nothing. No pdf, no errors, noting. I have tried using the -v and the -d flags to turn the verbosity up. I still get no output, neither to the screen or the command line.
When I run,
C:\>php -f C:\dompdf\dompdf.php -- -l
I actually get a listing of the paper sizes, so PHP is installed and I am correctly calling the dompdf php file.
Does anyone have any ideas on why this would not actually produce output?
The html file is on the C: and has information in it.
Does anyone have any example of running DOMPDF from the command line, or see what I am doing wrong?
Thanks for the help.