4

I need to send the scan instruction to the printer via Python and get the PDF file back. The standard Windows Paint program, for example, can send a scan instruction to any printer in the world, I need to do the same as Paint does only in Python, that is, I use a Pyhon function and it sends the instruction to mine printer she needs to scan and then the Python program takes the PDF scan back. Can you help me?

Example (something like this):

printers = list_my_pc_printers()

my_printer = printers[0]

scan_on_my_printer(my_printer, path_to_save_the_pdf_file)

My Structure:

  • Windows 10 64x PC
  • USB Commom HP Printer with Scanner
koder613
  • 1,486
  • 5
  • 21
brung11
  • 69
  • 3

1 Answers1

4

The only project I could find that supports Windows is Libinsane. It claims to work with Python, there is an example available. But I haven't tested it myself, and it looks like you have to build it from source for Windows.

For Linux, I would try out Python Sane which is a Python wrapper to access the Sane project. Sane claims to support a lot of different scanners. Again, haven't tested it myself, but the module has 40+ stars on Github, so it must work at least if you put some effort in.

Cornelius Roemer
  • 3,772
  • 1
  • 24
  • 55