Pdf – Sending pdf files directly to a network printer, using Windows command line

command linenetwork-printerpdfprinting

I have network printers. The new one is a Kyocera P2135dn and can handle PDF documents directly: When I pull a pdf-file into the print-spool-window, the file gets printed properly and no driver dialog window pops up, no Adobe tools involved, I believe. If I take the same pdf-file to the printer via usb-flash-drive, it also prints fine.

Now I have got several hundred pdf-files (all nicely named like 0001.pdf etc.) in one folder and I want to send them to the printer via the windows command line.

(Background: In the next step, I want to wrap hundreds of those commands in a Phyton script, but first I want to learn and test this "manually".)

In the past we have used GSprint from the GSview tool. It is still working, but is internally creating huge bitmap files and is slow to render and also slow over the network (even though the printer has got a fast connection). Typically I can only print about four pages per minute, and I have got hundreds to print. (The new GSview from Artifex does not include any GSprint. So we want to figure out a new workflow.)

I am just looking for the right command to send my pdf to the printer, which is properly configured via standard TCP/IP-port. I am working on Windows 10 pro, 64bit.

I managed to activate lpr on my windows and tried (just in cases) to send the file, and got it sent; but it does not get reckognized as a valid pdf (no surprise) and the printer is just printing lots of gibberish.

So please just tell me what command is needed to send a "binary" accross the network to my printer. And I will read up on it and hopefully figure out the syntax. I believe command line is best – to later integrate into a Phyton script. But Power Shell command might also help me.

(If you want to send examples, that would be awesome, but is optional.)

File is this, for example: C:\Users\martin\MyDocument.pdf

Printer port is called "" (this is its name, no typo)

Thank you.

Best Answer

Most printers cannot print PDFs directly. Some can, but nearly every one of those requires the PDF to be sent to the printer via some special, printer-specifc command. In the case of the Kyocera the command is "KYOCERA Net Direct Print". Note that only Windows versions are available.

The only other way to send a PDF to a printer from the command line is to use a PDF reader with suitable command line options. Old versions of Adobe Acrobat Reader had this capability, but this is no longer supported. However, some other PDF readers like Foxit Reader still do. This should be significantly faster than GSprint. To print a PDF with Foxit, use the following command:

Foxit Reader.exe" /t "FileName

Related Question