how do I limit "findprinters" output to actual printers on Windows

3 次查看(过去 30 天)
For a to-be deployed program, I need to build a list of available printers. Using [~, p] = findprinters; on my Windows box, yields 'OneNote for Windows 10', 'Microsoft XPS Document Writer', 'Microsoft Print to PDF', 'HP ENVY 4520 series', and 'Fax'. To remove the non-printers, I used the follwing code, and that did the trick:
forbidden_fruits = {'OneNote', 'Microsoft', 'Fax'};
for n = length(p):-1:1, if contains(p{n}, forbidden_fruits), p(n) = []; end, end
However, recently I downloaded a pdf reader, and now Matlab also finds 'PDF-XChange Lite' among the available printers. I added 'PDF' to the forbidden_fruits, but clearly my filtering will fail in the future as I have no control of what the end users have on their PC.
Is there a more printer-specific command or printer filter, as in a way to 'ping' each "printer" to confirm it is an actual printer.
Thanks.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Dates and Time 的更多信息

标签

产品


版本

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by