Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I'd like to completely control modern color laser printer (which supports BitBlt) -
to be able to print at any point=dot (say 600DPI) any of only 8 really available colors:
Cyan Magenta Yellow blacK C+M=Blue C+Y=Green M+Y=Red (8th - white),

bypassing both color-conversion and dithering blocks of both Windows and printer driver?

Would be most gratefull for some working code example

What I have tried:

DDB with only those 8 colors & BitBlt
Posted
Updated 27-Sep-19 4:02am
v2
Comments
Stefan_Lang 27-Sep-19 3:54am    
IMHO both the operating systems and printer functionality have gotten so complex over the past decades that it is no longer possible to write a reliable printer driver all by yourself, even if you're an expert at the field - much less if you need to ask for code.

AFAIK, printer drivers do offer the ability to control pretty much everything already through the printer API provided by the printer producer. It may be hidden by the driver that Windows automatically installs however.

The real problem is to write a driver - any driver - that doesn't automatically get overriden by the next forced Windows update. Or being kicked out for being potentially harmful according to the Windows Updater.

That said, if your printer understands Postscript, maybe that could give you all the functionality you need.
Member 14605311 27-Sep-19 8:12am    
Thanks. I've suspected exactly this, but still hoped for miracle.
I'll try Postscript. Haw would I send a PS block to printer from inside of my C program? Can you help me with that code?
Richard MacCutchan 27-Sep-19 4:41am    
Maybe you should talk to the printer manufacturer to see if they have an SDK kit which will help. AFAIK the only way to control a printer directly would be to connect it somehow without using PNP.
Member 14605311 27-Sep-19 8:18am    
Thanks. Yes, I've suspected exactly this, but still hoped for miracle.
I'll try Postscript. Haw would I send s PS block to printer from inside my C program? Can you help me with that code?

1 solution

Printer has been abstracted away into the device context decades ago. So you write/draw to the printer in the exact same manner as you do it to the screen. You just use the 'Printer HDC' instead of 'Display HDC'. All the rectangles and coordinates will be that of the printer HDC.

Just look up how to obtain Printer DC and its a good starting place
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900