xTuple.com xTupleU Blog & News Customer Support

Fedora 20 Printing

I am running the 4.5.0 client under Fedora 20 x64 with latest patches as at today.

I can print to PDF... e.g. /home/user/invoice.pdf

I have a HP printer installed under cups.

After starting xTuple from the command line e.g. /opt/xTuple-4.5.0/xTupleERP/xtuple

When I attempt to print to my cups based HP printer I get  "lp: Error - unable to access "lpr" - No such file or directory"

As a test I replaced /usr/bin/lp with a script to echo out the command line arguments and I got  "-d HP-Officejet-Pro-8500-a910b -s lpr A4 lpr media=A4"

ARG_1 -d
ARG_2 HP-Officejet-Pro-8500-a910b
ARG_3 -s
ARG_4 lpr
ARG_5 A4
ARG_6 lpr
ARG_7 media=A4

To me it looks like it's passing information to lp, specifically the first "lpr" which is being interpreted as a file to print. Which is not correct. 

(lp on my system is pointed to /usr/bin/lp.cups from the cups-1.7.4-3.fc20.x86_64 cups package ) 

Installing the qt4-assistant and I can print ok using what looks to be a largely similar print dialog. 

I am wondering where to start looking to fix this

The advanced tab on the xtuple.bin print dialog is blank.

xtuple.bin print dialog advanced tab showing blank

As an attempt at a work-a-round have installed the xtuple 4.5.0 client on a CentOS5.8 install and am still suffering the same issue. I am assuming QPrintDialog should query the printer for the right command line and options but in this case it's not happening. 

A working version of Qt on my Fedora 20 box is 4.8.6.

Perhaps the problem is a bug in Qt 4.8.4 which the xTuple 4.5.0 client is compiled against.

Update: I have a work-a-round to get printing direct from xTuple client to a cups connected printer working which involves replacing the symlink from /usr/bin/lp  to /etc/alternatives/print-lp with a script

So rm /usr/bin/lp and replace it with an executeable script (Warning this will probably break printing for many other apps on the box so do at your own risk)


echo $* > /tmp/lp
# the above echo put the following in /tmp/lp
# -d HP-Officejet-Pro-8500-a910b -s lpr A4 lpr media=A4

# statement to redirect stdin (which contains the file to print) to a file
# cat <&0 > /tmp/file
# contents of file is a %!PS-Adobe-1.0 PostScript document   

# this line works
# /usr/bin/lp.cups -d HP-Officejet-Pro-8500-a910b -s -o media=A4 /tmp/file

# without creating the intermediate /tmp/file file
cat <&0 | /usr/bin/lp.cups -d HP-Officejet-Pro-8500-a910b -s -o media=A4 -

Sadly the above is hacky and not really a fix.

It would be good to know if any others have ran into this problem, or If you have not can you post what version of Linux you are using that works with the xtuple 4.5.0 client. Thanks

Is there any plans to recompile the xtuple client with Qt4.8.6? This may fix the above problem

As a long time user of xTuple on Linux desktop (currently Ubuntu 14.04 64bit)  I have just done some testing and found that I too can no longer print forms/reports from my system.  I suspect the 4.5.0 (and 4.6.0) versions have a new version of OpenRpt embedded which is causing the problems

I am going to check and raise a bug request for this as it is quite a major bug.

Issue Raised: http://www.xtuple.org/xtincident/view/bugs/24335