1834446 Members
2912 Online
110067 Solutions
New Discussion

Re: xpr

 
SOLVED
Go to solution
MarkSyder
Honored Contributor

xpr

Hi everybody,

My users are creating screen dumps and trying to print them to an HPLJ5000N via xpr. The resulting prints are too small and cramped in the top right-hand corner of the page.

I have used xwud to confirm that the screen dump has worked correctly and I have played about with the xpr settings (mainly the grey, left, and top) but not managed to improve things greatly.

The command we are using is /usr/contrib/bin/X11/xpr -device ljet -gray 2 | lp -oraw -dlvpdplia04 -onb

Any ideas?

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
23 REPLIES 23
Pete Randall
Outstanding Contributor

Re: xpr

Mark,

Here's how we do it:

XPR=/usr/contrib/bin/X11/xpr
XWD=/usr/bin/X11/xwd
HEADER="Printed by `whoami` on `date`"
$XWD -frame | $XPR -header "$HEADER" -cutoff 75| lp -o nb -oraw -d$printer


Pete

Pete
Mark Greene_1
Honored Contributor

Re: xpr

take the -gray" out altogether and try various values with "-scale" and "-density". What may be compounding the problem is the printer definition you are using in lp. What driver is it using?

mark
the future will be a lot like now, only later
Bill Hassell
Honored Contributor
Solution

Re: xpr

xpr is really, really outdated. Look at the man pages for the 'supported' printers and all of them have been obsolete for more than a decade. Unfirtunately, there really isn't anything useful for printing graphics images. What your users probably need is a word processing program that can insert graphics images, but the xwd format is unique to Xwindows.

You can get a copy of the Portable BitMap utilities from http://hpux.connect.org.uk/hppd/hpux/X11/Graphics/netpbm-10.6/
The PBM utils can convert more than a dozen different bitmap formats (including xwd) into a format-neutral ASCII file which can then be manipulated (rotated, colors converted, contrast changed, brightness changed, etc) by running the PBM file through command-line filters. Once converted, the result can then be written to a different format (jpeg, bmp, gif, etc) and included in a formatting program.


Bill Hassell, sysadmin
MarkSyder
Honored Contributor

Re: xpr

Hi everybody,

Just working my way through your suggestions one at a time and awarding points after I've tried them.

Thanks for the suggestion Pete - the same result unfortunately.

Everyone else - please be patient while you wait for your points! This was my top priority problem when I posted this message on Thursday, but that was before I downloaded a patch to a workstation and sh***ed it!

HP are helping me with the workstation, which obviously takes priority over printing problems. I will try your suggestions in due course and give you your points.

Mark
The triumph of evil requires only that good men do nothing
MarkSyder
Honored Contributor

Re: xpr

Hi Mark/Bill.

Mark - I didn't try your suggestion because Bill's suggestion worked, but 3 points for trying to help.

Bill - I've converted the file to pbm then used xv to convert it to ps (having tried gif, jpeg, and tiff without much success).

In xv I've increased the size to A4 then clicked on smooth. This produces print that the users say they can live with, although they're not the same quality they used to get from xpr. 10 points up for grabs if anyone can help me to improve the quality of postscript files created with xv.

Mark
The triumph of evil requires only that good men do nothing
Pete Randall
Outstanding Contributor

Re: xpr

Mark,

You've got me concerned now. We've been doing this without problem for years (I've tried to break the users of their habit of having to print screens - to no avail, alas). Now it seems that there's a possibility of it not working someday.

I tried your exact command line on 10.20, 11.0 and 11i systems and it worked fine printing to a HP8100DN printer, 8150(s), old LJIII(s) and 4(s). I can't find a LJ5000 - I'm wondering if that makes any difference. Do you have any other printers available that you could try this on?


Pete

Pete
MarkSyder
Honored Contributor

Re: xpr

Hi Pete,

I retried your command just in case, but got exactly the same result.

We don't have an alternative printer at present - we're waiting to get it repaired.

The users tell me that the xpr command worked until about six months ago. Unfortunately, they don't do screen prints every day so they can't pinpoint when it went wrong. If they could, I could look for changes that occurred at that time.

I'm due to upgrade this server to 11i in about a month's time and I'm wondering if I should leave it as it is for now and see if the upgrade improves things.

Any more ideas would be welcome.

Mark
The triumph of evil requires only that good men do nothing
Pete Randall
Outstanding Contributor

Re: xpr

Mark,

Just my opinion based on what works here, but I would like to see you wait until after the upgrade before you abandon xpr altogether. Of course, if you have time on your hands, and are looking for something to do, the migration to Bill's PBM utilities might make you more "portable" in the future.

In any case, I wish you luck!


Pete

Pete
MarkSyder
Honored Contributor

Re: xpr

Thanks Pete.

I will certainly persevere after the upgrade - the users prefer xpr to the workaround.

No extra points for the humorous emulation of my signature in that other thread though - as I said to Jeff, I was only awarding points to the first person to do that!

Mark
The triumph of evil requires only that good men do nothing
Pete Randall
Outstanding Contributor

Re: xpr

Mark,

That's OK, I certainly wasn't looking to gain any extra points, just showing off my feeble sense of humor!

Cheers,

Pete

Pete
MarkSyder
Honored Contributor

Re: xpr

You can stop worrying Pete. The alternative printer is now working and xpr works fine to that - exactly the same command with just the printer name changed.

So I've now got to check what changed on the other printer approx. 7 - 8 months ago (don't you just love it when users give you a precise date to work from?).

The only thing I've changed on the printer since I started this job 11 months ago is to increase the memory. I would have expected an increase in memory to alleviate problems rather than cause them. Unless someone out there knows different.

Mark
The triumph of evil requires only that good men do nothing
MarkSyder
Honored Contributor

Re: xpr

Hi everybody,

Now that the other printer is working I think we may be getting somewhere.

The printers are both networked and on different servers. I have nulled the /var/adm/lp/log on each server and sent a print. The working one just showed a print, but the failing one showed:

Xlib: connection to "(workstation):0.0" refused by server
Xlib: Client is not authorized to connect to Server
Error: can't open display: (workstation):0.0
Error: couldn't find per display information

I have dug around a bit and looked for Xlib on these forums. This led me to check the .Xauthority file, which is dated 11 September 2003 - six months ago. The users say the fault started seven or eight months ago.

Any suggestions gratefully received.

Mark
The triumph of evil requires only that good men do nothing
Pete Randall
Outstanding Contributor

Re: xpr

Mark,

That almost looks like a name resolution issue ("can't open display/couldn't find per display info"). Is everybody known to everybody else on these two networks?


Pete

Pete
Pete Randall
Outstanding Contributor

Re: xpr

Sorry, "on these two servers"?


Pete

Pete
MarkSyder
Honored Contributor

Re: xpr

Hi Pete.

There are four workstations affected. The server with the problem is the apps server for these four users. They're on the same network.

Digression: I've just seen your name on a different thread where you said you hoped the rest of the world wasn't paying much attention to "dubya". It was my daughter's birthday earlier this week and she got a card from relatives in USA which had George's wife on the front saying "George used to have lots of questions on his birthday". On the inside it said "So now I just read his cards to him".

Mark
The triumph of evil requires only that good men do nothing
MarkSyder
Honored Contributor

Re: xpr

I really should have read your second posting before replying to your first! The first came in just as I was leaving the building for my dinner - I left it up on screen and replied immediately I got back.

Both servers and all four workstations are on the same network. I really would have expected the four users and their workstations to be known to their server, but - computers are strange things.

Mark
The triumph of evil requires only that good men do nothing
Alex Glennie
Honored Contributor

Re: xpr

Just a thought but if you cp /usr/dt/config/Xconfig -> /etc/dt/config/Xconfig and vi it and uncomment the line ;

Dtlogin*authorize: False

/sbin/init 2 then back to 3 .... try xpr again ... result ?( also try xhost + )


MarkSyder
Honored Contributor

Re: xpr

Thanks Alex.

I've amended the file but am hesitating on the next bit. I know it's not the same as a reboot, but can someone give me a cast-iron guarantee that switching run level won't affect users? For the Frasier fans amongst you, this server is in use 24/7 five days a week.

Seriously, the users are working 24 hour days (between them, not each!) and if switching run level is going to affect them they would rather wait for the weekly reboot in the small hours of Monday morning.

xhost + gave the error:

xhost: unable to open display ""

Mark
The triumph of evil requires only that good men do nothing
Alex Glennie
Honored Contributor

Re: xpr

OK hold back on the drop in run-level for a sec : xhost errored ? Was this run under an X session on the workstation .... if yes can you run echo $DISPLAY and confirm with nslookup it resolves correctly this hosts details for both hostname and ip address.

Have your users su'd at all ?
MarkSyder
Honored Contributor

Re: xpr

OK, I concede that logging into the server from my PC and running xhost + wasn't my brightest move!

I've now run it from the server console and it worked. But the prints are as bad as ever and I still get the same error message in /var/adm/lp/log. The users always log in as themselves, never su.

Mark
The triumph of evil requires only that good men do nothing
Alex Glennie
Honored Contributor

Re: xpr

xwd | xwd2sb | pcltrans -C -P -g1.5 -q -e2 | lp -oraw -dprintername ... result ?

Note: The '-e2' option means that all pixels will be enlarged by a factor two; therefore, if you want to enlarge the printout, you will need to modify this parameter.

or ....

xwd | xpr -device ljet | lp -oraw -dprintername
MarkSyder
Honored Contributor

Re: xpr

First command - result was a thin black line along one edge of the paper.

Second command - error message xpr not found (?).

Mark
The triumph of evil requires only that good men do nothing
MarkSyder
Honored Contributor

Re: xpr

Following the weekly reboot the error message in /var/adm/lp/log has stopped, but the prints are just the same.

If anyone has any more ideas I will be grateful to hear them.

Mark
The triumph of evil requires only that good men do nothing