Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

Note : Please dont consider this as a repetitive question because MAC and windows like 2 different worlds so I decided to ask as 2 different questions.

I am very new to MAC.

Like in windows we can differentiate between real n virtual printers using port name of PRINTER_INFO structure..

How can a C++ program distinguish an actual printer from a virtual printer in MAC OS X (e.g. CUPS pdf, paperless printer etc) ?
Posted
Updated 13-Dec-11 19:34pm
v6
Comments
Sergey Alexandrovich Kryukov 13-Dec-11 0:44am    
But why? The whole idea of such "fake" printers is to simulate complete printer interface so there would be no difference.
--SA
sooraj subramanya 13-Dec-11 1:38am    
No SAKryukov !!for ex: in windows there is some difference in port names. We can filter out the unwanted ports.
TRK3 28-Dec-11 18:42pm    
SAKryukov is correct. If it's done correctly you shouldn't be able to tell the difference between a virtual printer and a real printer.

In fact even under windows you can't always tell the difference. If the printer is on the network, it's port is an I/P address. I could write a network application that pretended to be a printer and you wouldn't be able to tell the difference. For that matter I could write a windows printer driver that had appeared to be on a local port but actually had no physical pringer connected. And physical printers can spool print jobs to disk or send them as faxes rather than printing them. Or conversely I could write a service that monitored the output directory of a virtual printer and whenever it saw a new pdf file there it sent it to a physical printer.

I think the most you can say is that under windows there are SOME simulated printers that you can detect by their port names some of the time.

On the MAC OS X, the situation is only going to be worse.

So what is the point?

(NOTE: As a user, if I have a virutal printer set up on my machine it's because I actually don't want to print certain things hardcopy, and I wouldn't want some program selectively prohibiting me from doing that.)

BrainlessLabs.com 14-Dec-11 1:10am    
I think this should not be under C++. This should move to appropriate forum, so that you can get better help.
sooraj subramanya 14-Dec-11 1:33am    
I tried to add MACOS tag, but its not adding after I press update question button...

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