From users-return-11431-archive-asf-public=cust-asf.ponee.io@pdfbox.apache.org Tue Feb 5 17:14:40 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id E0EC7180608 for ; Tue, 5 Feb 2019 18:14:39 +0100 (CET) Received: (qmail 76271 invoked by uid 500); 5 Feb 2019 17:14:38 -0000 Mailing-List: contact users-help@pdfbox.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@pdfbox.apache.org Delivered-To: mailing list users@pdfbox.apache.org Received: (qmail 76260 invoked by uid 99); 5 Feb 2019 17:14:38 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Feb 2019 17:14:38 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 9D171183B82 for ; Tue, 5 Feb 2019 17:14:37 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.009 X-Spam-Level: X-Spam-Status: No, score=0.009 tagged_above=-999 required=6.31 tests=[RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_FILL_THIS_FORM_SHORT=0.01] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id T4vB7PWebxVr for ; Tue, 5 Feb 2019 17:14:36 +0000 (UTC) Received: from mail.am-soft.de (mail.am-soft.de [83.218.36.120]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 18A395F3EA for ; Tue, 5 Feb 2019 17:14:35 +0000 (UTC) Received: from mail.am-soft.de (localhost [127.0.0.1]) by mail.am-soft.de (Postfix) with ESMTP id 91C74107F8E3 for ; Tue, 5 Feb 2019 18:14:29 +0100 (CET) Envelope-To: users@pdfbox.apache.org Received: from tschoening-nb.fritz.box (dslb-094-223-125-059.094.223.pools.vodafone-ip.de [94.223.125.59]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.am-soft.de (Postfix) with ESMTPSA id 6E0D2107F8E1 for ; Tue, 5 Feb 2019 18:14:28 +0100 (CET) Date: Tue, 5 Feb 2019 18:14:28 +0100 From: =?utf-8?Q?Thorsten_Sch=C3=B6ning?= Organization: AM-SoFT GmbH IT-Systeme Message-ID: <1536014645.20190205181428@am-soft.de> To: users@pdfbox.apache.org Subject: PrintPDF doesn't support 1:1 printer name matching MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-AV-Checked: ClamAV using ClamSMTP 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/p= dfbox/tools/PrintPDF.java?view=3Dmarkup#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/p= dfbox/tools/PrintPDF.java?annotate=3D682412&pathrev=3D1852674#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 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=C3=BC=C3=9Fen, Thorsten Sch=C3=B6ning --=20 Thorsten Sch=C3=B6ning E-Mail: Thorsten.Schoening@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=C3=A4ftsf=C3=BChrer: Andreas Muchow --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org For additional commands, e-mail: users-help@pdfbox.apache.org