<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2745.2800" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>As you can see from my earlier email I have
encountered a number of problems when trying to setup a printing regime that
meets our needs. The problem is now very detailed and is therefore no one best
suited to user group help. </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Would anyone in the group like a small amount of
paid consultancy to work with me to resolve the problem? If so, please will you
email me directly ( <A
href="mailto:b_whelan@mistral.co.uk">b_whelan@mistral.co.uk</A> ) with a brief
overview of your skills and your hourly rate. I am based in Steyning but can
happily take the server to anywhere within a reasonable distance.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Brendan</FONT> </DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=b_whelan@mistral.co.uk href="mailto:b_whelan@mistral.co.uk">Brendan
Whelan</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=sussex@mailman.lug.org.uk
href="mailto:sussex@mailman.lug.org.uk">LUG email list for the Sussex
Counties</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Monday, August 13, 2007 12:54
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [Sussex] Printing problems</DIV>
<DIV><BR></DIV>
<DIV><FONT face=Arial size=2>Using Fedora Core 6 and Samsung SCX-4200 -
</FONT><FONT face=Arial size=2>I need to be able to create files with
dynamic content which I can then print. I am testing the printout mechanisms
that I will need but I am encountering various problems when using
both "lpr", for pdf files, or "ooffice", for odt files. Below is PHP script
which I have used to record the ways I have attempted - most of the
problems appear to be with X-server. All suggestions welcome. Many
thanks, Brendan</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><?php<BR>print "Started
dud_print_pdf.php<br>\n";</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>// lpr command for a pdf file<BR>// If I run this
command in a terminal window it works but I am prompted to press an "OK"
button<BR>// When run in program I get error_code -1<BR>//$command = "lpr -# 1
/home/db/support/support_application/dud.pdf";</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>// lpr in command script<BR>// Using script
containing the above command......<BR>// If I run this shell script in a
terminal window it works but I am prompted to press an "OK" button<BR>// When
run via this program - gives error code -1<BR>// and the log produced "lpr:
cannot connect to X server"<BR>// I also get this same error if I run the
shell script on the cron queue <BR>//$command = "bash
/home/db/support/support_application/dud.sh";</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>// oofice command for odt file <BR>// If I run
the command in a terminal window it works but I am prompted to press an "OK"
button<BR>// When run viA this program it gives error code 0 (i.e. no error)
but no printout appears<BR>//$command = "/usr/bin/ooffice -headless -pt
scx4200 /home/bu/belfast/ni_reports/screen_report.odt";</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>// ooffice in command script<BR>// Using script
containing the above command......<BR>// If I run this shell script in a
terminal window it works AND I am NOT prompted to press an "OK" button<BR>//
If I run it via a cron job I get:<BR>//Set DISPLAY environment variable, use
-display option<BR>// or check permissions of your
X-Server<BR>// (See "man X" resp. "man xhost" for
details)<BR>$command = "bash
/home/db/support/support_application/dud1.sh";</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>print
">>>command>$command<<br>\n";</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>$result = exec($command, $output,
$error_code);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>if ($error_code > 0)<BR>{<BR> print
"Unable to execute command - code was
>$error_code<";<BR>}<BR>else<BR>{<BR> print "No error
reported<br>\n";<BR>}</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>print
"Finished<br>\n";<BR>?><BR></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT size=2>
<P><FONT face=Arial></FONT></FONT><FONT face=Arial
size=2></FONT> </P></DIV>
<DIV><FONT face=Arial size=2> </FONT></DIV>
<P>
<HR>
<P></P>__ <BR>Sussex mailing list<BR>Sussex@mailman.lug.org.uk<BR>E-mail
Address: sussex@mailman.lug.org.uk<BR>Sussex LUG Website:
http://www.sussex.lug.org.uk/<BR>https://mailman.lug.org.uk/mailman/listinfo/sussex</BLOCKQUOTE></BODY></HTML>