Last active
March 16, 2018 06:15
-
-
Save HashRaygoza/a5e8a4f79851546b65aefa3c30ae09fa to your computer and use it in GitHub Desktop.
Encuentra el objeto PrintService que representa la impresora que deseamos usar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Nos regresa el PrintService que representa la impresora con el nombre que | |
| * le indiquemos | |
| * @param printerName nombre de la impresora que deseamos usar | |
| * @return PrintService que representa la impresora que deseamos usar | |
| */ | |
| private PrintService findPrintService(String printerName) { | |
| PrintService[] printServices = PrintServiceLookup.lookupPrintServices(null, null); | |
| for (PrintService printService: printServices) { | |
| System.out.println(printService.getName()); | |
| if (printService.getName().trim().equals(printerName)) { | |
| return printService; | |
| } | |
| } | |
| return null; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment