如何将PCL文件发送到打印机?
问题描述:
如何用C ++将PCL文件发送到打印机?
我已经在我的机器上安装了5台打印机,我想选择打印机并将PCL发送到该打印机......
我可以手动将PCL文件发送到打印机,但是,我需要共享打印机并使用dos的COPY命令发送文件。
我想知道如何将该文件发送到指定的打印机,在Windows的打印机对话框中选择...
How I can send a PCL file to printer in C++ ?
I have installed in my machine 5 printers, I want to choice the printer and send the PCL to that printer...
I can send the PCL file to printer by hand, but, I need to share the printer and send the file using a COPY command of dos.
I want to know how I can send that file to specified printer, selected in Printer Dialog of windows...
答
有一篇旧的知识库文章 HOWTO:使用Win32 API将原始数据发送到打印机 [ ^ ]指的是Windows 9x和NT。所以我不知道它是否也适用于较新的Windows版本。您需要知道的只是打印机的名称。然后从PCL文件中读取数据并将其写入打印机。
There is an old KB article HOWTO: Send Raw Data to a Printer by Using the Win32 API[^] referring to Windows 9x and NT. So I don't know if it is also working with newer Windows versions. All you need to know is the name of the printer. Then read the data from the PCL file and write it to the printer.
dos命令是 copy file.pcl LTP n
。但是,如果它是网络或USB打印机,您可能无法做到这一点,因为DOS不知道这些设备......
The dos command is copy file.pcl LTPn
. However if it's a network or USB printer you may not able to do that as DOS does not know about that devices...