Portable way to determining of printer is physical or virtual

前端 未结 3 1973
故里飘歌
故里飘歌 2021-01-02 23:28

I need direct-to-printer functionality for my website, with the ability to distinguish a physical printer from a virtual printer (file).

Coupons.com has this functio

3条回答
  •  星月不相逢
    2021-01-02 23:55

    As you say, there appear to be ways of gleaning a bit of information about the printer:

    javax.print.attribute.standard.PrinterMakeAndModel looks promising.

    Disallowing file: Destinations on any printer, and printing to any printer with the word PDF in the printer make and model would likely cover 90% of the cases judging by this list of virtual print software. You realistically aren't going to run into false positives on the word PDF either.

    If this feature isn't perfect, your client isn't likely to notice; your competitors likely also have some horrible kludge because they know just as well this feature is more "security theater" than actual security.

提交回复
热议问题