Skip to Content.
Sympa Menu

baslinux - Re: [BL] Printing CLI with BL without lpr - using cat and netpbm

baslinux AT lists.ibiblio.org

Subject: Baslinux mailing list

List archive

Chronological Thread  
  • From: sindi keesan <keesan AT sdf.lonestar.org>
  • To: baslinux AT lists.ibiblio.org
  • Subject: Re: [BL] Printing CLI with BL without lpr - using cat and netpbm
  • Date: Sun, 3 Apr 2005 22:47:43 +0000 (UTC)

How to print a pdf file to a HP Deskjet (540 in this case, with black only) using netpbm and xpdf:

1. Use the cli part of xpdf - pdfimages - to made pdf into pbm
pdfimage filename.pdf root

(root is what the new files start with - they end in .pbm). This took 19 seconds to convert one pdf with 2 pages to two pbm files of 800K or so.

For color pdf files use pdftoppm, which took 80 sec on the same B/W pdf file and produced two 6G instead of 823K files. file-001.pbm and -002.pbm

2. Netpbm does not seem to have a program to print to deskjet and the pbmtolj program prints things 4 times too wide and high, so:

pbmreduce 4 file-001.pbm > newfile1.pbm (same for file-002.pbm)

Took about 3 seconds.


3. pdftolj newfile.pbm > /dev/lp0 printed almost immediately.

The output appears to contain 1/4 as many dots as what I get on the screen (the original pdf file) or when printing the pdf file with gs (using the deskjet.filter in a script). It is therefore less legible.

gs took 26 seconds to process the pdf file with 2 pages and then a while to print.

pdfimages (19 sec) + pbmreduce (7 sec) = 26 seconds

No savings in time, loss in quality. But if you have a small hard drive it saves a lot of space not to use gs to print with deskjet.

The program ppmtopcl3 would hopefully print better quality directly to a deskjet and would be very helpful to have for BL3 and also BL2 if you don't want to install gs.

The xpdf (CLI) pdfimages is 300K compressed with upx.
The netpbm pbmreduce is 8K. pbmtolj about 10K.

gs is 3MB and uses lots of extra files. And the version I compiled to work with X requires 5 X libraries to even load and may not work with BL3 unless you add these libraries for BL2. The version that does work with BL3 does not handle pdf 1.5. The latest precompiled xpdf (which handles 1.5 pdf) needs the SW81 glibc-so so there is really no good way to print pdf files in BL3 without upgrading lots of libraries.

For just printing images not pdf there are jpegtopnm and giftopnm and pngtopnm, which don't involve xpdf at all, and would work in BL3 since they were compiled to do so. Then pbmtolj filename.pnm > /dev/lp0

On a deskjet this will produce fuzzy output if you pbmreduce but it is somewhat better than nothing at all. I am hoping David or I can compile ppmtopcl3 for the deskjet instead. Maybe David also wants to compile the xpdf CLI programs for BL3.

I will check out pbmtolj on a real laserjet printer and pbmtoescp2 on the epson stylus printers. And ppmtoppa on the 'Windows' HP printers.



keesan AT sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org




Archive powered by MHonArc 2.6.24.

Top of Page