9

I have one an application that generates ".pcl" files. Once generated they are saved on a folder on my Windows 7.

How do I send these files to the printer (either network printer or USB connected printer) for printing?

AniJ
  • 205
  • 2
  • 4
  • 9
  • Maybe http://openpcl.sourceforge.net/ would do what you want. – Joachim Isaksson Jun 17 '12 at 11:26
  • I tried looking at it but I do not want to view just print them directly from a command line or something. ... I will give it a try. Thanks. – AniJ Jun 17 '12 at 11:30
  • 4
    Assuming your ".pcl" files are raw PCL and simply need the contents sending directly to the printer, the way to do this in the olden days with a network printer was to map a local port with `NET USE LPT3: \\SERVER\printer` and then just `COPY /B file.pcl LPT3:`. I’ve no idea whether that will still work in Windows 7, or whether there’s a way to do the same thing for a USB printer. – Brian Nixon Jun 17 '12 at 11:45
  • 2
    Brian Nixon's idea above does work in Win7, but leave the colon off the LPT3 . Thanks. – Doug J. Huras Sep 12 '14 at 19:45
  • 2
    Incredibly odd that a question with this many views and so useful (to me and others) would be off-topic. Sure it's the answer that's gold, but I only found the answer because someone asked the question. – D_Bester Oct 26 '15 at 02:42

1 Answers1

13

To send a PCL file to an HP printer when the version of the PCL in the file matches the capabilities of the printer you need to send the file as raw data.

RAWPRN

In earlier versions of Windows you could use Microsoft RAWPRN.EXE utility to send PostScript or PCL directly to a printer capable of interpreting it.

This utility is described in Microsoft KB138594 article.

LPR

Apparently Windows also provides a simple LPR utility.

LPR -P LaserPrinter1 "-o l" cad_drawing.pcl

Here LaserPrinter1 is the name of the printer, "-o l" indicates raw data stream and cad_drawing.pcl is the name of the PCL file.

This utility is described in the Windows Server command line reference.

Dima Chubarov
  • 16,199
  • 6
  • 40
  • 76
  • 3
    as mentioned [here](https://superuser.com/a/420447/35237), note you may have to enable the Windows feature "LPR Port Monitor" in order to get the `lpr` command – Tobias Kienzler Mar 31 '16 at 08:44
  • In my case I am trying to print to a virtual printer on a predefined port (which is not an LPR port) so this method will not work for me as far as I can tell. Is there a different method? – Obi Wan Mar 10 '17 at 17:18
  • @ObiWan did you try specifying the name of your virtual printer with the `-P` option (that is instead of `LaserPrinter1` in the example above)? – Dima Chubarov Mar 11 '17 at 04:48
  • Yes I did and it did not work. After further researching I discovered this command only works with certain printers that run on a specific port: the LPR port. In my case I have a virtual printer that runs on its own custom port that cannot be changed. I spent several hours trying to make this work and my conclusion was that it was not going to work for me, but if you can offer a suggestion of how to make it work for my virtual printer, I am interested. – Obi Wan Mar 13 '17 at 13:10