Switching the printer trays

I know that this question was asked before, but there was no answer.

How to change the software tray of the printer?

I am trying to use python to batch print some pdf files. I need to print different pages from different trays. The printer is a Ricoh 2232C. Is there a way to do this and the Acrobat Reader command line option? I can use the Win32 api to find out which boxes correspond to those bins, but that's about it. Any tips / shortcuts / etc?

+5
source share
4 answers

Ok, I figured it out. Answer:

1. you need a local printer (if you need to print to a network printer, download drivers and add it as a local printer)
2. use win32print to get and set the default printer
3. Also using win32print, use the following code:

import win32print PRINTER_DEFAULTS = {"DesiredAccess":win32print.PRINTER_ALL_ACCESS} pHandle = win32print.OpenPrinter('RICOH-LOCAL', PRINTER_DEFAULTS) properties = win32print.GetPrinter(pHandle, 2) #get the properties pDevModeObj = properties["pDevMode"] #get the devmode automaticTray = 7 tray_one = 1 tray_two = 3 tray_three = 2 printer_tray = [] pDevModeObj.DefaultSource = tray_three #set the tray properties["pDevMode"]=pDevModeObj #write the devmode back to properties win32print.SetPrinter(pHandle,2,properties,0) #save the properties to the printer 
  1. what he tray was changed
  2. printing is done using Internet Explorer (from the Graham King blog)

     from win32com import client import time ie = client.Dispatch("InternetExplorer.Application") def printPDFDocument(filename): ie.Navigate(filename) if ie.Busy: time.sleep(1) ie.Document.printAll() ie.Quit() 

Done

+5
source

There is no easy way to do this, as you indicate that you want to select specific pages from pdf and print them in specific cells using Acrobat Reader

Example: Print page 1 in form 1, page 2 in basket 2

Acrobat Reader allows you to print the entire document from the command line:

You can change the free ghostscript and do what you want.

or this commercial product should do the job. PDFPrint


See Acrobat Reader Developer Questions on page 24 for more information.

AcroRd32.exe / t path "printername" "drivername" "portname" . Launch Adobe Reader and print the file while suppressing the Print dialog box. The path must be fully defined.

Four options for the / t switch evaluate the path, printername, drivername, and port name (all lines).

printername is the name of your printer.

drivername . The name of the printer driver, as shown in the properties of your printers.

portname - The printer port. port name cannot contain - the name of the printer driver as it appears in the properties of your printers.

portname - The printer port. port name cannot contain

+1
source

It is impossible to use a simple PDF, because you are creating a new print job for any particular combination of bins and trays (and not all printers allow this, Xerox 4x and DP Series allow you to do such things).

It would be best to juggle PostScript: convert PDF to PostScript, where you have access to individual pages, and then extract the pages you need, and for each such page (or pages) create a new print job (for example, using a program Windows lpr ). To make things easier, I would create a print queue for any combination of tray and tray that you should print, and then use these queues as printers.

+1
source

You already have a Ricoh machine, just get the Ricoh Print & Share software and there you can determine which trays you want to use!

These videos show how to set up Ricoh Print & Share software:

0
source

Source: https://habr.com/ru/post/895167/


All Articles