LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 11-01-2009, 11:43 PM   #1
bartonski
Member
 
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 443
Blog Entries: 1

Rep: Reputation: 47
Printing non-standard paper sizes on Lexmark E330 via CUPS


According to the documentation for my Lexmark E330 laser printer (found here), the printer will accept document sizes down to 3x5 inches. I would like to print on index cards. Unfortunately, I'm having a very hard time making this happen.

The printer has a manual feed on the front with paper guides which do, in fact, go down to 3 inches.

I very often use enscript to print text files, so my first attempt was to create ~/.enscriptrc that looked like this:

Code:
# Media definitions:
#       name            width   height  llx     lly     urx     ury
Media:  Notecard          216     320    18      36     198     314
My print command looked like this:

Code:
echo "This is a test of the emergency notecard system" | enscript -D ManualFeed -M Notecard
The card fed through the printer correctly, and came out blank.

I ran the same command with no card in the manual feed tray, only to find out that I was getting a 3x5 print area in the lower left hand corner of an letter size page (the print guides center the 3x5 card, so the card had not passed through the area that was not actually printed on).

I tried setting the paper size in Open Office to 3x5, once again, I got the same behavior.

Next, after some googling, I found the following:

Code:
lp -d printername -o PageSize=Custom.4x6in -o fitplot /path/to/PDF
The site said that '-o fitplot' could be removed when printing text, so I used the following

Code:
echo "I really want more cowbell... I need you to really explore the space..." | lp -o PageSize=Custom.3x6in

This did not change the output from what I was seeing if I printed directly to a letter size page.

(The site that I found these on is here. )

Finally, I think that the paper size options are set in the printers PPD file. Here's the page size configuration for /etc/cups/ppd/Lexmark_E330.ppd:

Code:
*DefaultPageSize: Letter
*PageSize Letter/US Letter: "<</PageSize[612 792]/ImagingBBox null>>setpagedevice"
*PageSize A4/A4: "<</PageSize[595 842]/ImagingBBox null>>setpagedevice"
*PageSize 11x17/11x17: "<</PageSize[792 1224]/ImagingBBox null>>setpagedevice"
*PageSize A3/A3: "<</PageSize[842 1191]/ImagingBBox null>>setpagedevice"
*PageSize A5/A5: "<</PageSize[421 595]/ImagingBBox null>>setpagedevice"
*PageSize B5/B5 (JIS): "<</PageSize[516 729]/ImagingBBox null>>setpagedevice"
*PageSize Env10/Envelope #10: "<</PageSize[297 684]/ImagingBBox null>>setpagedevice"
*PageSize EnvC5/Envelope C5: "<</PageSize[459 649]/ImagingBBox null>>setpagedevice"
*PageSize EnvDL/Envelope DL: "<</PageSize[312 624]/ImagingBBox null>>setpagedevice"
*PageSize EnvISOB5/Envelope B5: "<</PageSize[499 709]/ImagingBBox null>>setpagedevice"
*PageSize EnvMonarch/Envelope Monarch: "<</PageSize[279 540]/ImagingBBox null>>setpagedevice"
*PageSize Executive/Executive: "<</PageSize[522 756]/ImagingBBox null>>setpagedevice"
*PageSize Legal/US Legal: "<</PageSize[612 1008]/ImagingBBox null>>setpagedevice"
*CloseUI: *PageSize

*OpenUI *PageRegion: PickOne
*OrderDependency: 100 AnySetup *PageRegion
*DefaultPageRegion: Letter
*PageRegion Letter/US Letter: "<</PageSize[612 792]/ImagingBBox null>>setpagedevice"
*PageRegion A4/A4: "<</PageSize[595 842]/ImagingBBox null>>setpagedevice"
*PageRegion 11x17/11x17: "<</PageSize[792 1224]/ImagingBBox null>>setpagedevice"
*PageRegion A3/A3: "<</PageSize[842 1191]/ImagingBBox null>>setpagedevice"
*PageRegion A5/A5: "<</PageSize[421 595]/ImagingBBox null>>setpagedevice"
*PageRegion B5/B5 (JIS): "<</PageSize[516 729]/ImagingBBox null>>setpagedevice"
*PageRegion Env10/Envelope #10: "<</PageSize[297 684]/ImagingBBox null>>setpagedevice"
*PageRegion EnvC5/Envelope C5: "<</PageSize[459 649]/ImagingBBox null>>setpagedevice"
*PageRegion EnvDL/Envelope DL: "<</PageSize[312 624]/ImagingBBox null>>setpagedevice"
*PageRegion EnvISOB5/Envelope B5: "<</PageSize[499 709]/ImagingBBox null>>setpagedevice"
*PageRegion EnvMonarch/Envelope Monarch: "<</PageSize[279 540]/ImagingBBox null>>setpagedevice"
*PageRegion Executive/Executive: "<</PageSize[522 756]/ImagingBBox null>>setpagedevice"
*PageRegion Legal/US Legal: "<</PageSize[612 1008]/ImagingBBox null>>setpagedevice"
*CloseUI: *PageRegion

*DefaultImageableArea: Letter
*ImageableArea Letter/US Letter: "18 36 594 756"
*ImageableArea A4/A4: "18 36 577 806"
*ImageableArea 11x17/11x17: "18 36 774 1188"
*ImageableArea A3/A3: "18 36 824 1155"
*ImageableArea A5/A5: "18 36 403 559"
*ImageableArea B5/B5 (JIS): "18 36 498 693"
*ImageableArea Env10/Envelope #10: "18 36 279 648"
*ImageableArea EnvC5/Envelope C5: "18 36 441 613"
*ImageableArea EnvDL/Envelope DL: "18 36 294 588"
*ImageableArea EnvISOB5/Envelope B5: "18 36 481 673"
*ImageableArea EnvMonarch/Envelope Monarch: "18 36 261 504"
*ImageableArea Executive/Executive: "18 36 504 720"
*ImageableArea Legal/US Legal: "18 36 594 972"

*DefaultPaperDimension: Letter
*PaperDimension Letter/US Letter: "612 792"
*PaperDimension A4/A4: "595 842"
*PaperDimension 11x17/11x17: "792 1224"
*PaperDimension A3/A3: "842 1191"
*PaperDimension A5/A5: "421 595"
*PaperDimension B5/B5 (JIS): "516 729"
*PaperDimension Env10/Envelope #10: "297 684"
*PaperDimension EnvC5/Envelope C5: "459 649"
*PaperDimension EnvDL/Envelope DL: "312 624"
*PaperDimension EnvISOB5/Envelope B5: "499 709"
*PaperDimension EnvMonarch/Envelope Monarch: "279 540"
*PaperDimension Executive/Executive: "522 756"
*PaperDimension Legal/US Legal: "612 1008"
All dimensions are in PostScript points (1/72nd of an inch). I'm not clear on all of the distinctions between PageSize, PageRegion, ImageableArea and PaperDimension; PaperSize and PaperDimension for 'Letter' are both 612x792, which corresponds to 8.5x11. ImageableArea seems to form the printable area on a letter size page. PageRegion... I have no idea abut.

I would love to hear from anyone with any clues as to a) PPD files/PostScript b) Lexmark E330 printers, c) Setting Print Dimensions in CUPS. or d) Any other ideas as to how to approach this problem.
 
Old 11-02-2009, 05:32 AM   #2
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 231Reputation: 231Reputation: 231
I have to apologize for my original, totally bogus, solution which took this thread off the 0-reply list prematurely. Here are my later results:

Warning: I did my testing on a Brother HL-1240 which centers both the manual feed & the stock in the regular tray. I suspect that it's centering of both is the reason I didn't have to use the "-D ManualFeed" option.

I also did my testing on regular 8-1/2 x 11 paper, but I don't think it makes any difference to my results. BTW, & this may be crucial difference, my results were always at the top of the paper & centered -- right where they should go on a card.


The only thing I see wrong w/ what you did is that 72 pts/in x 5" = 360, not 320.


Here's the .enscriptrc I made:
Code:
# Media definitions:
#       name  width  height    llx     lly      urx     ury
Media:  card    216     360     18      36      198     324
Media:  3x5     216     360     18      36      198     324
Here are 3 of the trials that worked:
Code:
$ echo -e "\n\n\nenscript test"    | enscript -B -Mcard
[ 1 pages * 1 copy ] sent to printer

$ echo -e "\n\n\t\tenscript test"  | enscript -B -M3x5
[ 1 pages * 1 copy ] sent to printer
1 line(s) were wrapped

$ echo -e "\n\n\t\tenscript test"  | enscript -B -M3x5 -r
[ 1 pages * 1 copy ] sent to printer
I tried putting a "Media:" definition in /etc/enscript.cfg, which also worked.

I hacked (carefully saving the orig.) my /etc/cups/ppd/BroLaser.ppd w/ no effect. BTW, except for the fact that mine doesn't seem to need margins, mine is the same as yours.


Since enscript is working for me using your configuration methods, I suspect your problem is in your printer not your enscript configuration. Sorry I couldn't help more. HTH at least a little bit.

Finally, thanks for introducing me to enscript.

Last edited by archtoad6; 11-02-2009 at 09:07 AM.
 
1 members found this post helpful.
Old 11-04-2009, 12:56 AM   #3
bartonski
Member
 
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 443
Blog Entries: 1

Original Poster
Rep: Reputation: 47
Quote:
Originally Posted by archtoad6 View Post
Since enscript is working for me using your configuration methods, I suspect your problem is in your printer not your enscript configuration. Sorry I couldn't help more. HTH at least a little bit.

Finally, thanks for introducing me to enscript.
Thank you for checking this out for me; it definitely eliminates some variables.

I think that I might be able to set up the media statement so that I'm actually printing in the place where I want on the page... the trouble is that I think that I would end up messing up portrait vs. landscape. I'm quite sure that there is a correct way to do this, after all, the printer is capable of printing envelopes which are not centered the same way as letter stock...

At this point, the part of me that wants to get it right is working harder than the part that just wants to get things running... but neither part has time to fiddle with it right now ;-).

Also, you're welcome for the introduction to enscript. It's one of my favorite unix utilities. You can even pipe it through ps2pdf and create good looking PDF images on the fly.
 
Old 11-04-2009, 07:33 AM   #4
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 231Reputation: 231Reputation: 231
You're welcome, I hoped that eliminating variables would be helpful.

Let us know your progress when it happens.

Last edited by archtoad6; 11-08-2009 at 06:07 AM. Reason: missing word
 
Old 11-07-2009, 02:33 PM   #5
bartonski
Member
 
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 443
Blog Entries: 1

Original Poster
Rep: Reputation: 47
I've got something that works now...

I set up my .enscriptrc as follows:

Code:
# Media definitions:
#       name            width   height  llx     lly     urx     ury
Media:  Notecard          216     360   216     450     396     782
This will allow me to print 3x5 index cards in either portrait or landscape orientation, using enscript. (the -r flag in enscript will print landscape).

The 'width' and 'height' fields seem to be entirely ignored; llx, lly, urx and ury variables are set as if I was restricting the print area to the top center region of a piece of letter size paper.

I also tried messing around with alternative .ppd files. I backed up Lexmark_E330.ppd and replaced it with this one, which does have a 3x5 media type: http://www.datahelper.com/download/m...1320-hpijs.ppd.

I restarted cups; at this point 3x5 did show up as a media type in the printer configuration dialog, but when I selected this and tried to print too it, it simply printed as if it were printing to a standard letter size page.

I may lift the 3x5 section of the HP-LaserJet_1320-hpijs.ppd and put it in to the Lexmark_E330.ppd and see if that gives me any better luck, but my curioscity is signifigantly blunted now that I know that I can print index cards in landscape configuration throiugh enscript. This is enough to create a killer hipster PDA, which is really where I was headed with all of this to begin with.

Last edited by bartonski; 11-07-2009 at 02:54 PM.
 
Old 11-08-2009, 06:11 AM   #6
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 231Reputation: 231Reputation: 231
I discovered the "-r" flag but didn't point it out in my post because I thought you knew it already. (LOL)
OTOH, it is good to have it mentioned here for the sake of others reading the thread.

Double thanks for the link -- both for bothering to provide a link (so many don't) & for the interesting article.
 
Old 11-08-2009, 10:16 AM   #7
bartonski
Member
 
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 443
Blog Entries: 1

Original Poster
Rep: Reputation: 47
Quote:
Originally Posted by archtoad6 View Post
I discovered the "-r" flag but didn't point it out in my post because I thought you knew it already. (LOL)
OTOH, it is good to have it mentioned here for the sake of others reading the thread.

Double thanks for the link -- both for bothering to provide a link (so many don't) & for the interesting article.
It wasn't so much that I didn't know about the -r flag, as that I didn't think that it would work with the media definition that I set up. I figured that when I used the -r flag, it would rotate relative to the letter sized page, rather than relative to the print area that I set up for the index card.

By the way, In earlier versions of the man page for 'enscript', the 'bugs' section used to list 'too many command line options'. Don't know why they removed that comment, it's still true... ;-).
 
  


Reply

Tags
cups, ppd, print


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CUPS spools paper halfway, starts printing then stops Kourosh Mandriva 0 09-18-2008 10:35 PM
LXer: Printing Secrets Revealed: How to set Custom Page Sizes with CUPS Printjobs LXer Syndicated Linux News 0 09-08-2007 07:00 PM
Samba+Cups lexmark printing from windows MORA Debian 3 02-25-2006 04:52 PM
Printing - Lexmark 4039 10R - Cups - PPD camorri Linux - Hardware 2 04-23-2005 05:01 PM
HP Deskjet 1220C Paper sizes P4C970 Linux - Hardware 0 08-17-2003 08:50 PM


All times are GMT -5. The time now is 05:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration