SWB-Consulting
asked on
How to fix X11 display issue?
When running this cronjob on my Fedora 7 Server:
# create pdfs and preview
*/15 * * * * /usr/bin/convertdir2pdf restart /var/www/html/_files >> /var/www/html/_logs/conver tdir2pdf.l og 2>> /var/www/html/_logs/conver tdir2pdf.l og #JOB_ID_5
I am getting this error :
/usr/lib/openoffice.org/pr ogram/swri ter.bin X11 error: Can't open display: localhost:0.0
Set DISPLAY environment variable, use -display option
or check permissions of your X-Server
(See "man X" resp. "man xhost" for details)
I made sure that DISPLAY=:0.0 is in the crontab file but still giving my problems, any solution ?
My guess is that the problem is because of this line in the macro (see macro below)
"oDoc = StarDesktop.loadComponentF romURL(cUR L, "_blank", 0, Array(MakePropertyValue("H idden", True), ))"
so that the macro needs a X11 running, is there any solution to run this macro w/o GUI?
# create pdfs and preview
*/15 * * * * /usr/bin/convertdir2pdf restart /var/www/html/_files >> /var/www/html/_logs/conver
I am getting this error :
/usr/lib/openoffice.org/pr
Set DISPLAY environment variable, use -display option
or check permissions of your X-Server
(See "man X" resp. "man xhost" for details)
I made sure that DISPLAY=:0.0 is in the crontab file but still giving my problems, any solution ?
My guess is that the problem is because of this line in the macro (see macro below)
"oDoc = StarDesktop.loadComponentF
so that the macro needs a X11 running, is there any solution to run this macro w/o GUI?
This is the content of "/usr/bin/convertdir2pdf" :
/usr/bin/oowriter -display localhost:0.0 -accept="socket,host=localhost,port=2002;urp;" -headless "macro:///Standard.Module1.ConvertWordToPDF($1)";
And this is the macro:
REM ***** BASIC *****
Sub ConvertWordToPDF(cFile)
cURL = ConvertToURL(cFile)
' Open the document.
' Just blindly assume that the document is of a type that OOo will
' correctly recognize and open -- without specifying an import filter.
oDoc = StarDesktop.loadComponentFromURL(cURL, "_blank", 0, Array(MakePropertyValue("Hidden", True), ))
cFile = Left(cFile, Len(cFile) - 4) + ".pdf"
cURL = ConvertToURL(cFile)
' Save the document using a filter.
oDoc.storeToURL(cURL, Array(MakePropertyValue("FilterName", "writer_pdf_Export"), ))
oDoc.close(True)
End Sub
Function MakePropertyValue( Optional cName As String, Optional uValue ) As com.sun.star.beans.PropertyValue
Dim oPropertyValue As New com.sun.star.beans.PropertyValue
If Not IsMissing( cName ) Then
oPropertyValue.Name = cName
EndIf
If Not IsMissing( uValue ) Then
oPropertyValue.Value = uValue
EndIf
MakePropertyValue() = oPropertyValue
End Function
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Xvfb should fix this issue - not clear if asker managed to do it though?