2

This is driving me nuts. UPS sends our system a 1400x800 GIF image of a shipping label, which is supposed to fit nicely on a 4x6 page.

Unfortunately, I can't seem to get the command line options right to make it happen.

We're using an Eltron/Zebra 2844 with a network adapter, and printing from our Ubuntu 8.04 server using CUPS. We're using the correct drivers, and test pages print correctly.

No matter what I try though, it insists on printing the UPS labels accross 6 pages, with a little bit of the label on each page, or way too small.

I've tried a bazillion different lpr settings, most of them producing garbage. The closest I've gotten is this:

    lpr -P Eltron2844 -o natural-scaling=55 -o page-right=0 -o page-left=0 -o landscape -o media="4x6" ./1ZY437560399620027.gif

but it causes the image to be too small on the page. It's about an inch too short, and there's a 1/2" margin on both sides. If I bump the scale up to 56, it explodes the image onto two pages, and squashes it.

Any ideas?

Nick
  • 4,433
  • 29
  • 67
  • 95

3 Answers3

5

Have you tried converting the gif to a postscript file? If you have imagemagick you can use:

convert 1ZY437560399620027.gif 1ZY437560399620027.ps

and print that? You can also use print to file in gimp or others.

I'm assuming the issue is that lpr is going through a helper application that is creating the margins you have a problem with.

Best of luck,
João Miguel Neves

jneves
  • 1,043
  • 6
  • 15
  • Yep, create PostScript commands and print that. – Jé Queue Oct 28 '10 at 22:30
  • 1
    This was exactly what I needed to print at my label printer's native PPI. I have a Zebra 2844, and I converted to 203PPI. Here's my completed script. https://gist.github.com/4668402 – Nick Woodhams Jan 31 '13 at 08:58
0

800 x 1400 on a 4x6 translates to 200 dpi x 233.33333 dpi so you aren't going to get the image to fill the label exactly.

If you use 200 dpi then the longer side is 1 inch too long for the label, assuming you're keeping the aspect ratio the same.

If you use 233.333 dpi then the shorter side is approximately .58 inches too short.

So you're going to have to live with either the image being squashed or a border, unless you contact UPS and ask them to supply an image that will fit the label exactly.

ChrisF
  • 1,861
  • 1
  • 21
  • 28
0

My guess is that your printer driver's PPD (look at /etc/cups/ppd/[printername].ppd) has a definition for *ImageableArea that does not allow marginless printing.

If your hardware in fact does support edge-to-edge printing (or if it tolerates smaller margins than defined in the PPD), you could try to edit the PPD. See here for some hints about PPD manipulation regarding the keywords *PageSize, *PageRegion, *PaperDimension and *ImageableArea: https://stackoverflow.com/questions/1028891/whats-the-easiest-way-to-add-custom-page-sizes-to-a-ppd.

My suggestion would be to...

  1. ...investigate your PPD, and
  2. ...set the values for *ImageableArea of your 4x6 media definition to a value that means borderless printing.

My guess is that you should use a line like *ImageableArea 4x6/4x6in: "0 0 288 432" (in case your PaperDimension line is *PaperDimension 4x6/4x6in: "288 432").

Now that you have set the print queue to send an job image file that assumes the hardware to be able to print borderless, you'll see...

  • ...if the printer hardware does in fact support borderless printing,
  • ...or if the hardware does simply clip the printed image to the real supported values.

With that knowledge, you may be able to tweak the PPD to an *ImageableArea that's more close to what the hardware supports.


(For the PPD numerical values in said dimensions: 72 pt == 1 inch. So 288x432pt == 4x6in)

Kurt Pfeifle
  • 1,746
  • 2
  • 12
  • 19