I can print PDF files to my HP printer which is using an HP ppd file, but it does not work if I send text files to it.

I need to print a lot of envelopes doing a mail merge (in Vim) so the problem is how to format them correctly. Is there a way I can maybe generate a PCL file via Vim with the right orientation and margins so the envelopes come out correctly?

As an aside, how can print plain text files?

  • HP has made a huge number of printer models with different capabilities. What is the exact model of your printer? – telcoM Mar 6 at 5:17
  • @telcoM m605dn and the driver is hp-laserjet_m604_m605_m606-ps.ppd.gz – Tyler Durden Mar 6 at 5:22
  • You have got two or three questions here.... – Rui F Ribeiro Mar 6 at 7:57
  • You have installed this printer driver in your cups configuration? If so, cups should take care of converting plain text into whatever the printer accepts. cups won't accept PCL, your best bet is to generate postscript (which isn't that hard if you can do a bit of programming). – wurtel Mar 6 at 8:36
  • enscript can be used to convert text files to PostScript. Typically, on Unix systems, PostScript is the desired printing target. PDF and PostScript are (mostly) convertable to each other. Historically, non-gui tools to generate print output are groff (troff) and latex (TeX), so you may find some examples in those languages. – meuh Mar 6 at 14:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.