Research windowsId for printers
Closed this issue · 4 comments
I have a research task for you. Doesn't require you to know anything really, just find the correct places to ask questions, then ask the questions. I haven't pushed yet, so you won't have the all of the comments, but I want you to research the use of windowsId.
In the current branch I'm ripping out PPD support for Linux, upgrading to IPP. Almost all of the "driverless" printers on the market are running some kind of embedded Linux with some kind of CUPS server. After digging into a bit of CUPS code it is obvious that CUPS itself has been generating PPD for driverless printers and possibly direct connected tractor feed printers that support known emulation modes. That means all libraries "just using PPD" are holding their breath for the day coming very soon when PPD support is completely removed from CUPS.
https://www.antixforum.com/forums/topic/cups-3x-will-remove-ppd-support/
https://forum.endeavouros.com/t/cups-will-drop-driver-support/7543
Our base development environment; Ubuntu 20.04 has Cups 2.3.1-9
Really kicking myself for having thrown out a working dot-matrix a couple years ago. It was old and if CUPS generates IPP values for it based on its emulation I would have some real answers. Yes, dot-matrix is still widely used. They print nearly 100% of airplane boarding passes and many new dot-matrix printers are network compatible. It's the old ones I ponder about.
You don't happen to have one do you? When I get back to my "it builds" state you could run my little cups demo program and see what gets spit out. No, what is there now should not be used. This CUPS thing was ignored far too long.
In the second image you see the windowsId column in the center. This has a very Windows 3.x feel.
Ah, the task.
Do various Web searches and ask in various C/C++/Windows programming forums about the values/names in that middle column. Yes, they still work, but are they deprecated? If so, what is the new Windows printing world view? Really probably just need a link to a very good article.
Since you wish to have this still support Windows 7 when it finally supports Windows, the answer you find needs to be supported in both Windows 7 and 10.
I suspect Windows 10 is basically using a "Windows version of CUPS" due to the WSL thing, but I do not know.
Driverless printers have been out for a long time but I do not know when they first appeared. The comment at the top of this page may be how you have to back into the answer. If that Mopria (sp?) and/or WiFi Direct are supported in Windows 7 then your task gets easy. Just find example C++ code on how to use that under Windows 7. (Same code should work on Windows 10.)
I think a large part of the existing printing code should go away. Most of it, like the PPD stuff, was there to find information the servers couldn't tell you. Now that most of the servers are actually running on the printers, the local print facilities only have to be able to provide some usable "defaults" for dot-matrix and other direct connect printers with common emulation.
Here is the output from my cups example at my office.
`oland@roland-HP-Z820-Workstation:/mnt/data6tb/github_projects/ls-cs_examples_install/cups-experiment$ ./cups-experiment
flags: 2
Dest Name: Brother_MFC_L3770CDW_series
uri: ipp://localhost/printers/Brother_MFC_L3770CDW_series
resolution printer-resolution-default: 600dpi
text value: 600 integer value: 600
`````````` output-bin-default: output-bin-default value: face-down
---------- CUPS_PRINT_COLOR_MODE name: print-color-mode-default default: color
........... CUPS_SIDES name: sides-default default: one-sided
Option# Name Value
0 copies 1
1 cups-browsed true
2 device-uri implicitclass://Brother_MFC_L3770CDW_series/
3 finishings 3
4 job-cancel-after 10800
5 job-hold-until no-hold
6 job-priority 50
7 job-sheets none,none
8 marker-change-time 0
9 number-up 1
10 printer-commands none
11 printer-info
12 printer-is-accepting-jobs true
13 printer-is-shared false
14 printer-is-temporary false
15 printer-location
16 printer-make-and-model Brother MFC-L3770CDW series, driverless, cups-filters 1.27.4
17 printer-state 3
18 printer-state-change-time 1733205621
19 printer-state-reasons none
20 printer-type 2134108 duplex color copies
21 printer-uri-supported ipp://localhost/printers/Brother_MFC_L3770CDW_series
flags: 2
Dest Name: Brother_MFC_L8900CDW_series
uri: ipp://localhost/printers/Brother_MFC_L8900CDW_series
resolution printer-resolution-default: 600dpi
text value: 600 integer value: 600
`````````` output-bin-default: output-bin-default value: face-down
---------- CUPS_PRINT_COLOR_MODE name: print-color-mode-default default: color
........... CUPS_SIDES name: sides-default default: one-sided
Option# Name Value
0 copies 1
1 cups-browsed true
2 device-uri implicitclass://Brother_MFC_L8900CDW_series/
3 finishings 3
4 job-cancel-after 10800
5 job-hold-until no-hold
6 job-priority 50
7 job-sheets none,none
8 marker-change-time 0
9 number-up 1
10 printer-commands none
11 printer-info
12 printer-is-accepting-jobs true
13 printer-is-shared false
14 printer-is-temporary false
15 printer-location
16 printer-make-and-model Brother MFC-L8900CDW series, driverless, cups-filters 1.27.4
17 printer-state 3
18 printer-state-change-time 1733205621
19 printer-state-reasons none
20 printer-type 2265180 *********** Default printer duplex color copies
21 printer-uri-supported ipp://localhost/printers/Brother_MFC_L8900CDW_series
flags: 0
Dest Name: Officejet_Pro_8100_09E040_
uri: ipp://localhost/printers/Officejet_Pro_8100_09E040_
resolution printer-resolution-default: 600dpi
text value: 600 integer value: 600
`````````` output-bin-default: output-bin-default value: face-up
---------- CUPS_PRINT_COLOR_MODE name: print-color-mode-default default: color
........... CUPS_SIDES name: sides-default default: one-sided
Option# Name Value
0 copies 1
1 cups-browsed true
2 device-uri implicitclass://Officejet_Pro_8100_09E040_/
3 finishings 3
4 job-cancel-after 10800
5 job-hold-until no-hold
6 job-priority 50
7 job-sheets none,none
8 marker-change-time 0
9 number-up 1
10 printer-commands none
11 printer-info
12 printer-is-accepting-jobs true
13 printer-is-shared false
14 printer-is-temporary false
15 printer-location
16 printer-make-and-model HP Officejet Pro 8100, driverless, cups-filters 1.27.4
17 printer-state 3
18 printer-state-change-time 1733205621
19 printer-state-reasons none
20 printer-type 2101340 duplex color copies
21 printer-uri-supported ipp://localhost/printers/Officejet_Pro_8100_09E040_
flags: 0
Dest Name: Brother_MFC_L3770CDW_series
uri:
resolution printer-resolution-default: 600dpi
text value: 600 integer value: 600
========== media-source: media-source default: auto
`````````` output-bin-default: output-bin-default value: face-down
---------- CUPS_PRINT_COLOR_MODE name: print-color-mode-default default: color
........... CUPS_SIDES name: sides-default default: one-sided
Option# Name Value
0 device-uri ipp://BRN3C2AF49FE253.local:631/ipp/print
1 printer-info Brother MFC-L3770CDW series
2 printer-location
3 printer-make-and-model Brother MFC-L3770CDW series
4 printer-type 83923036 duplex color copies discovered MFP
5 printer-uri-supported ipp://localhost/printers/Brother_MFC_L3770CDW_series
flags: 0
Dest Name: Officejet_Pro_8100_09E040_
uri:
resolution printer-resolution-default: 600dpi
text value: 600 integer value: 600
========== media-source: media-source default: main
`````````` output-bin-default: output-bin-default value: face-up
---------- CUPS_PRINT_COLOR_MODE name: print-color-mode-default default: color
........... CUPS_SIDES name: sides-default default: one-sided
Option# Name Value
0 device-uri ipp://HP09E040.local:631/ipp/printer
1 printer-info Officejet Pro 8100 [09E040]
2 printer-location
3 printer-make-and-model HP Officejet Pro 8100
4 printer-type 16777244 duplex color discovered
5 printer-uri-supported ipp://localhost/printers/Officejet_Pro_8100_09E040_
flags: 0
Dest Name: Brother_MFC_L8900CDW_series
uri:
resolution printer-resolution-default: 600dpi
text value: 600 integer value: 600
========== media-source: media-source default: auto
`````````` output-bin-default: output-bin-default value: face-down
---------- CUPS_PRINT_COLOR_MODE name: print-color-mode-default default: color
........... CUPS_SIDES name: sides-default default: one-sided
Option# Name Value
0 device-uri ipp://BRNB42200BD06C8.local:631/ipp/print
1 printer-info Brother MFC-L8900CDW series
2 printer-location
3 printer-make-and-model Brother MFC-L8900CDW series
4 printer-type 83923036 duplex color copies discovered MFP
5 printer-uri-supported ipp://localhost/printers/Brother_MFC_L8900CDW_series
roland@roland-HP-Z820-Workstation:/mnt/data6tb/github_projects/ls-cs_examples_install/cups-experiment$
`
What is interesting is the output for the HP OfficeJet Pro because I bought that in the 2012-13 timeframe.
According to Wikipedia (a highly unreliable source on the best of days) Windows 7 shipped in 2009. By hook or crook the OfficeJet Pro works with the IPP interface of CUPS.
I will update this issue when I've pushed something that builds and runs under Linux using the IPP API.
This is mostly "just find links that make sense to you" since you claim to know next to nothing because those should have all of the detail I need to make a decision.
Did you ever locate a native C++ compiler for your machine? One that doesn't need Msys2, Cgywin, or any other emulators? We only need one that supports C++17 standard.
I guess, if you want to try the CUPS example, you can install the debian you built with the current Master, then just checkout the branch and build only the demo. That's how I tested legacy. When I have full IPP running I will vet it with that demo.
I have never owned any printers. This research is difficult for me because I don't know how to code. But a quick search with the key DMBIN_UPPER
will lead you to a MSDN article. In case of Google giving different results for you and me, here is the link:
You can have a look at the Win32++ library:
https://win32-framework.sourceforge.net/
Download and extract Win32xx1000.zip
, there is a Windows help file in the help
directory. It has wrapper classes for printing. I don't tell you to use this abstraction layer, but there are useful comments about printing on Windows on this help file.
Okay, we will leave this open. I suspect the first search based on DMBIN_UPPER will be legacy printing, not IPP. Second link might be more relevant. Been away from this project for a few days refinishing the wood floors in the other half of the house and dealing with life in general.
Will have some time today and tomorrow to get back into this. This morning while doing dishes I decided to completely rip out this enum and that horrible mapping effort. We will only support IPP printing. If you need to do live logging you can directly open the serial or parallel port and spew ASCII to the device.
You can read a discussion I have going on here in the OpenPrinting space if you wish. Basically they threw live logging under the bus. This is what happens when people have only worked in the home hobbyist x86 world. No concept of real world uses or laws.
=== name: media-default value: na_letter_8.5x11in
=== name: media-col-default value: {media-size={x-dimension=21590 y-dimension=27940} media-bottom-margin=432 media-left-margin=432 media-right-margin=432 media-top-margin=432}
=== name: media-supported value: custom_215x345mm_215x345mm,na_index-3x5_3x5in,iso_a4_210x297mm,iso_a5_148x210mm,iso_a6_105x148mm,na_number-10_4.125x9.5in,iso_c5_162x229mm,iso_dl_110x220mm,na_monarch_3.875x7.5in,na_executive_7.25x10.5in,na_foolscap_8.5x13in,iso_b5_176x250mm,na_legal_8.5x14in,na_letter_8.5x11in,na_oficio_8.5x13.4in,custom_min_3x5in,custom_max_8.5x14in
=== name: media-size-supported value: {x-dimension=21500 y-dimension=34500},{x-dimension=7620 y-dimension=12700},{x-dimension=21000 y-dimension=29700},{x-dimension=14800 y-dimension=21000},{x-dimension=10500 y-dimension=14800},{x-dimension=10477 y-dimension=24130},{x-dimension=16200 y-dimension=22900},{x-dimension=11000 y-dimension=22000},{x-dimension=9842 y-dimension=19050},{x-dimension=18415 y-dimension=26670},{x-dimension=21590 y-dimension=33020},{x-dimension=17600 y-dimension=25000},{x-dimension=21590 y-dimension=35560},{x-dimension=21590 y-dimension=27940},{x-dimension=21590 y-dimension=34036},{x-dimension=7620-21590 y-dimension=12700-35560}
=== name: media-source-supported value: auto,by-pass-tray,tray-1
=== name: media-type-supported value: stationery,stationery-lightweight,stationery-heavyweight,envelope,envelope,envelope,labels,photographic-glossy,stationery-bond,com.brother.thicker,com.brother.recycled
That is what IPP provides. CUPS has some built-in parsing functions so Windows should have as well. We will just drop support for all non-URI printers. I don't have a link now, but did stumble over some software for Linux one can use to generate IPP driver for non-networked legacy printer that doesn't have any IPP software support.
Ah, here is a starting point for Windows.
Just need to search for "Internet Printing Protocol examples for Windows"
I'm sorry but I'm not interested in this research. Btw, this link will give you more information:
Fine. It will just delay Windows support a few months. For the record, most of software engineering is research. Hackers use Agile and just throw code at things which is why nothing they create is either reliable or worthwhile.