Jump to content
  • Announcements

    • spinynorman

      Mandriva Official Documentation

      Official documentation for extant versions of Mandriva can be found at doc.mandriva.com.   Documentation for the latest release may take some time to appear there. You can install all the manuals from the main repository if you have Mandriva installed - files are prefixed mandriva-doc.
    • paul

      Forum software upgrade   10/29/17

      So you may have noticed the forum software has upgraded !!!
      A few things that have changed. We no longer have community blogs (was never really used) We no longer have a portal page.
      We can discuss this, and decide whether it is needed (It costs money) See this thread: Here
Sign in to follow this  
phunni

Printing is always skew...

Recommended Posts

If I try to print from an application that just uses lpr <filename> - i.e. nedit, sylpheed etc... then the printed text page doesn't fit the paper - it starts too high and too far to the left.

 

Does anyone know how I can fix this?

 

I've tried doing an lpr <filename> direct from the command line with the same results...

Share this post


Link to post
Share on other sites

anyone have any ideas? at all?

 

BTW my setup is that I'm printing to a computer acting as a server which runs MDK 9.1

 

All commands have been issued from my desktop computer.

 

Edit: I have just run the same command (lpr <filename>) from the server and it works perfectly. This is a problem happening over the network somewhere...

Share this post


Link to post
Share on other sites
anyone have any ideas? at all?

 

Nothing too particular, just in terms of troubleshooting. Is the "client" PC also running mdk9.1? Same configuration generally?

 

If you print a postscript or pdf file using lpr, do you get the same off-kilter result?

 

Is it possible that lpr is using the wrong paper settings? (ie, you're printing on A4 paper with the letter setting)

 

That's all I've got off the top of my head.

Share this post


Link to post
Share on other sites

running gentoo...

 

It only seems to happen for normal text files. Although the other programs have settings dialogs...

 

How would I find out if I'm printing to letter or whatever? The paper is actually A4

Share this post


Link to post
Share on other sites
How would I find out if I'm printing to letter or whatever? 

The paper is actually A4

 

I'm not sure what lpr's default is -- it likely depends on the printer and driver -- but to specify A4 size, try this:

 

lpr -o media=A4 filename

 

If you're using CUPS, you can also set the paper size in the printer setup. Because

Share this post


Link to post
Share on other sites
How would I find out if I'm printing to letter or whatever? 

The paper is actually A4

 

I'm not sure what lpr's default is -- it likely depends on the printer and driver -- but to specify A4 size, try this:

 

lpr -o media=A4 filename

 

If you're using CUPS, you can also set the paper size in the printer setup. Because

 

Because what?

 

I tried setting the paper size manually as you suggested - but this made no difference...

Share this post


Link to post
Share on other sites
Because what?

Sorry, that was an aborted sentence. I think I was about to suggest something related to the print dialogs of other applications, like Acrobat Reader. Chances are those send all the proper options to the printer, which is why a PDF, for instance, seems to print normally. But what happens if you print a PDF from the command line, using lpr? If you get the same funny offset, it's almost certainly a problem with the paper size setting.

I tried setting the paper size manually as you suggested - but this made no difference...

Hrrrm. I don't know that much about the ins and outs of lpr; that suggestion was just the result of some googling. It's possible that the printer driver is incorrectly set, disallowing the modification of the paper size. Can you try a generic driver? Maybe install and give CUPS a try?

Share this post


Link to post
Share on other sites

OK - here's a more detailed run dow nof the system.

 

I have a server running MdK 9.1 with a CUPS server and a printer connected to it.

 

This machine is viible on the LAN to three others - 2 windows laptops and my main desktop running gentoo.

 

The laptops print to the server via a simple setup of networking printing on windows.

 

The Linux desktop prints to the server my simply pointing to it as the printing server in cupsclient.conf (or whatever that file is called)

 

I'll try and print a PDF from the command lina and post my results

Share this post


Link to post
Share on other sites
A PDF prints perfectly from the command line using lpr filename

Well, in that case, I'm stumped. We have officially exhausted my knowledge of printing. Maybe monkeying with the driver or trying CUPS?

Share this post


Link to post
Share on other sites

I haven't used this myself , but according to the CUPS users manual http://localhost:631/sum.html, the following can be used to change your margins -

 

lpr -o page-top=value filename ENTER

lpr -o page-left=value filename ENTER

 

I suppose the above could mess up your settings in applications, so perhaps you could set up a specific printer instance -

 

lpoptions -p laserjet/lprtext -o page-top=value ENTER

lpoptions -p laserjet/lprtext -o page-left=value ENTER

 

lpr -P laserjet/lprtext filename ENTER

 

Hope this helps. :)

Share this post


Link to post
Share on other sites

ok - I've set some default options including media and the page margins

 

This has fixed the above problem, but I am presented with a new one.

 

The text is not wrapped. If any lines are longer than will fit on the page - only the first section of the line is printed :(

 

In the CUPS docs I can't find any option to wrap the printed text. If I can fix this then (finally) printing will (I think!) behave as I want it to!

Share this post


Link to post
Share on other sites

I've found this command called 'enscript', which you can use at the command line - or do you want to print from within your applications?

 

Anyway, the link describes how it converts plain text to PostScript, and further on, in Outputting Text as a Poster or Sign, it uses word-wrap.

 

www.tldp.org/LDP/linuxcookbook/html/cookbook_19.html#SEC288

 

Use 'man enscript' for all the options... :)

Share this post


Link to post
Share on other sites
I've found this command called 'enscript', which you can use at the command line - or do you want to print from within your applications?

 

Anyway, the link describes how it converts plain text to PostScript, and further on, in Outputting Text as a Poster or Sign, it uses word-wrap.

 

www.tldp.org/LDP/linuxcookbook/html/cookbook_19.html#SEC288

 

Use 'man enscript' for all the options...  :)

 

Thanks - I'll give it a go. I do want to print from apps - but the problematic apps all let me specify a command to use so this is probably still a good solution...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×