Jump to content

Printing is always skew...


phunni
 Share

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...

Link to comment
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...

Link to comment
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.

Link to comment
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

Link to comment
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...

Link to comment
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?

Link to comment
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

Link to comment
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. :)

Link to comment
Share on other sites

  • 1 month later...

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!

Link to comment
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... :)

Link to comment
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...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...