Printing PNG edge to edge from command line

Kurt Pfeifle kpfeifle at danka.de
Thu Apr 27 12:16:45 PDT 2006


> Hi all, we are working on a program here at my company to replace
> pre-printed forms for a legacy dot-matrix printer system.  I'm using
> a2ps and a combination of ImageMagick and postscript programs to
> composite ASCII text over a form file, and the result is a high
> resolution PNG image that I would like to print scaled to fit the entire
> page with no margins.  I've read the documentation but the commands to
> set the page margins are not working for me (page-top, etc.).
>
> Here's the command I'm using:
> lp -d printer -o scaling=3D100 -o page-left=3D0 -o page-right=3D0 ... =
> file.png

-o page-top=NNN etc. is meant to work for text files only.

You can't really print to the edge of any media if the printer's physics does not support it. The "PPD" file for the printer does describe what size the "ImageableArea" for each paper size is. Sometimes the description is more conservative than the real capabilities of the printer are; then you can expand the ImageableArea by editing the PPD. But if you overdo it, the printout will have missing areas...

-o scaling=100 is all you need for graphics printing; it will print to fill up the "ImageableArea" (as defined in the printqueue's PPD) to the maximum without changing the aspect ratio of your image.


> The printer is using the CUPS LaserJet 1.1 driver, and prints everything
> fine.  I can send PS files to it using -o raw and it prints edge to edge
> with no problems.  The printer itself is an HP 4350dtn.
>
> I know I could convert the PNG to a PS or EPS file, but they tend to be
> pretty big in comparison (almost 1MB per page vs. ~100K per page as a
> PNG), and the printers they will be printing to are on 256K leased
> lines, so printing 20 pages at 1MB per page would not work very well
> (especially double sided forms...).
>
> I've googled for days trying to find the right options to use, can
> anybody help with this?
>





More information about the cups mailing list