How do I slave print to a text file instead of a printer in PuTTY?

5,093

Solution 1

Update:

It's a "feature" of Putty:

Since PuTTY sends data to the printer raw, it cannot offer options such as portrait versus landscape, print quality, or paper tray selection. All these things would be done by your PC printer driver (which PuTTY bypasses); if you need them done, you will have to find a way to configure your remote server to do them.

PuTTY bypasses the driver that normally puts up the file-name selection dialog box

Update 2:

You could set the server to print to a file and then use PuTTY (it has an SCP client pscp) to retrieve that text file.

I have a server that uses zmodem to send files, PuTTY doesn't support zmodem but various forks do, such as Kitty.

(original answer follows)


You need to set up a printer that always prints to file

Win 7 dialog

Then in Putty go to Settings, Terminal, Printer to send ANSI output to. Choose the printer you just added to Windows.

Solution 2

I ask putty to direct it to a "Microsoft XPS Document Writer" in the default printer insert. Configure ports as "PORTPROMPT". Dumps a .OXPS file to "my documents". Open file with Wordpad and print direct to any printer.

Share:
5,093

Related videos on Youtube

spdegabrielle
Author by

spdegabrielle

Programmer and Project Manager

Updated on September 18, 2022

Comments

  • spdegabrielle
    spdegabrielle almost 2 years

    I have a large report that can only be extracted form a legacy system as a print job. Printing to screen is impractical as it is 590 pages of text, and printing to screen requests the user to press enter for each new page.

    I can print to a specified slave printer in PuTTY, by setting the printer in the terminal settings.

    I have created a 'Generic /Text Only' Printer, and selected it in PuTTY.

    When I print I get two jobs in the queue; the first is always 13 bytes - and gives a status of 'Error - Printing', the second is ~2.54 MB, but never prints.

    I was expecting a file dialog to open so I could specify a destination file, but I've not had any luck.

    Any suggestions?

  • spdegabrielle
    spdegabrielle almost 12 years
    I did that but it doesn't allow you to specify a file. If you do a test print you can specify a file - but I get the same behaviour - a 13 byte file and the main file - and they both fail to print (or aske for a destination filename)
  • user5249203
    user5249203 almost 12 years
    @spdegabrielle: My error - Putty doesn't facilitate what you want to do. See updated answer.
  • spdegabrielle
    spdegabrielle almost 12 years
    I'll see about that. leaving the question open in case there is an answer out there.