Hi all, I'm using multiple printers following some naming scheme regarding their purpose, like the following:
* FreePDF * FreePDF - SomeProfile * FreePDF - SomeProfile2 * PDFCreator * PDFCreator - ... * ... When using the argument "-printerName FreePDF" on the shell, one of the printers using an additional profile is used to actually print instead of the one I expected. The reason is that printer names are not matched 1:1 or using some glob syntax or whatever, but using "contains": > if (printService[i].getName().contains(printerName)) https://svn.apache.org/viewvc/pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/PrintPDF.java?view=markup#l157 Looking at the history of those lines, this seem to have been the case ever since moving the project to Apache. https://svn.apache.org/viewvc/pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/PrintPDF.java?annotate=682412&pathrev=1852674#l125 At least I don't know of any application behaving the same way, printer names are either matched 1:1 or, if at all, some glob syntax or regular expression is supported optionally. The current behaviour would force me and my customers to rename printers and in my opinion is totally unexpected. It's not even documented that way: > -printerName <name> Print to specified printer. Which is wrong, it's more or less printing to some arbitrary printer containing the name somewhere and without any documented ordering and stuff. :-) So, is that considered a feature or a bug? I vote for the latter and would like to see that fixed. If "contains" is really needed, implementing optional support for globs or regular expressions with proper documentation should be the way to go. Else 1:1 matching is least surprising for most users in my opinion. Thanks! Mit freundlichen Grüßen, Thorsten Schöning -- Thorsten Schöning E-Mail: thorsten.schoen...@am-soft.de AM-SoFT IT-Systeme http://www.AM-SoFT.de/ Telefon...........05151- 9468- 55 Fax...............05151- 9468- 88 Mobil..............0178-8 9468- 04 AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org For additional commands, e-mail: users-h...@pdfbox.apache.org