Home > Enterprise >  PowerShell Script to set default paper size on an Epson Printer
PowerShell Script to set default paper size on an Epson Printer

Time:12-08

Epson printers, by default, have a paper size of 80mm x 297mm (or something close to 297)

The datawindow in my program is longer than that, so it prints a second page and duplicates the header.

If you go into the printer properties and set the paper length to 80mm x 2970mm then everything works fine.

I am trying to write a powershell script that will automate this process.

The Printer Name is "EPSON TM-T20IIIL Receipt" and the Paper Size Value that I want it to be set to is "Roll Paper 80 x 3276 mm"

EDIT This is a roll receipt printer

This seems like it would work for a regular printer that has a PaperSize Value of A0-A10. The problem Im facing is that the Epson Roll Receipt printer does not have any of these values. Is there a corresponding value to the size I'm looking for? Set-PrintConfiguration -PrinterName "EPSON TM-T20IIIL Receipt" -PaperSize A4

Printer size options available [1]: https://i.stack.imgur.com/Fo0AY.png

CodePudding user response:

Since Epson receipt printers are not what I would say are "normal" printers, you can't use typical Windows print settings to set these values. When printing, you basically only send text and basic commands to the printer. Most of the configuration settings are actually stored in the Flash memory on the printer and not in the driver. For ex. the logos at the start of a receipt is stored on the printer, and not generated at all by the driver. Similarly, options for automatically cutting paper at the end of printing. I believe that paper/roll size falls under these kind of settings because the printer needs to know the width of the paper to know how to handle the text being sent to it (remember, we are only sending basic raw text to the printer, and the printer determines how to print it).

Therefore to configure the printer, while the basic driver is needed, you actually have to use the Epson Advanced Printer Driver to configure the printer, and then use APD to export the configuration. That exported configuration can be used to set up new printers. For ex. using APD v5 driver.

  1. First install and fully configure the printer with all the configurations that you want. (paper/roll sizes, logos, cut/no cut at end of print, etc.)
  2. Export the configuration by running Start -> All Programs -> EPSON -> EPSON Advanced Printer Driver 5 and open Register, Change and Delete EPSON TM Printer
  3. Select the printer, and from the menu select Copy Installation -> Create
  4. Select the installation package type. e.g. I suggest Complete package (with the APD Utility)

Now you can use that installation package to install a fully configured printer on any new machines.

  • Related