Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A9A2C200CFE for ; Fri, 8 Sep 2017 21:50:35 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A7F861609A7; Fri, 8 Sep 2017 19:50:35 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id ED8DA1609BE for ; Fri, 8 Sep 2017 21:50:34 +0200 (CEST) Received: (qmail 3467 invoked by uid 500); 8 Sep 2017 19:50:33 -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 3438 invoked by uid 99); 8 Sep 2017 19:50:32 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Sep 2017 19:50:32 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id D909CD97B7 for ; Fri, 8 Sep 2017 19:50:31 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.279 X-Spam-Level: ** X-Spam-Status: No, score=2.279 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, RP_MATCHES_RCVD=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id KHBr7kd57owy for ; Fri, 8 Sep 2017 19:50:29 +0000 (UTC) Received: from mailout05.t-online.de (mailout05.t-online.de [194.25.134.82]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 347355F3CF for ; Fri, 8 Sep 2017 19:50:29 +0000 (UTC) Received: from fwd00.aul.t-online.de (fwd00.aul.t-online.de [172.20.26.147]) by mailout05.t-online.de (Postfix) with SMTP id 73ED94261533 for ; Fri, 8 Sep 2017 21:50:22 +0200 (CEST) Received: from [192.168.2.105] (Sg6LAoZvghXNRMVOoQ9OCQnvI4jiFz9sXVJEIOgRiS6VCpd1IysPil8vEAguEJVwqk@[217.231.152.232]) by fwd00.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384 encrypted) esmtp id 1dqPI6-2sKUT20; Fri, 8 Sep 2017 21:50:14 +0200 Subject: Re: PDBorderStyleDictionary.setWidth (was RE: QUADDING constants) To: users@pdfbox.apache.org References: From: Tilman Hausherr Message-ID: Date: Fri, 8 Sep 2017 21:51:09 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-ID: Sg6LAoZvghXNRMVOoQ9OCQnvI4jiFz9sXVJEIOgRiS6VCpd1IysPil8vEAguEJVwqk X-TOI-MSGID: 353d2856-d929-45ba-9f90-03f0bb9f4689 archived-at: Fri, 08 Sep 2017 19:50:35 -0000 Ok, I got it: PDBorderStyleDictionary.setWidth() doesn't work at all in your example because Adobe secretly wants integer numbers. However... in the AddAnnotations example, it is possible to use float numbers and the effect is different (6 and 6.5) when displaying with Adobe Reader. So maybe the effect is only with widget annotations (which are used for Acroform). So I don't know what to do for now. You can either set the style directly, or set a border array instead of the /BS. Maybe this should be reported to Adobe. Or we should identify float numbers, and then set an integer. Or include a warning in the javadoc. Or all of the above... https://stackoverflow.com/questions/4727569/how-to-check-whether-input-value-is-integer-or-float https://stackoverflow.com/questions/5502548/checking-if-a-number-is-an-integer-in-java Tilman Am 07.09.2017 um 16:16 schrieb Gary Grosso: > Very sorry, I see that was confusing as heck. I must have overstayed my caffeine. > > I'm calling setQ with 0, 1, or 2 for now. End of subject. > > > New subject: PDBorderStyleDictionary.setWidth() > > It seems this produces output like http://aapro.net/PDF/BorderWeightTest.pdf but I need it to produce output like http://aapro.net/PDF/BorderWeightTestAcrobat.pdf in order for Acrobat/Reader to display different border thicknesses. > > I'm doing the following which makes Adobe products happy: > > private static void setBorderWeight(PDBorderStyleDictionary borderStyle, String string) { > int wt; > try { > wt = Integer.parseInt(string); > } catch (NumberFormatException exc) { > wt = 1; > } > COSDictionary dict = borderStyle.getCOSObject(); > dict.setInt("W", wt); > //borderStyle.setWidth(wt); > } > > Hopefully I'm making sense this time. > > > Thanks, > Gary > > > > -----Original Message----- > From: Tilman Hausherr [mailto:THausherr@t-online.de] > Sent: Thursday, September 7, 2017 2:29 AM > To: users@pdfbox.apache.org > Subject: Re: QUADDING constants > > ??? > > Is this about width or about Q ? > > Tilman > > Am 06.09.2017 um 22:42 schrieb Gary Grosso: >> I can call PDBorderStyleDictionary.setWidth with 0, 1, or 2, for now, but it looks to me like setWidth() sets the COSObject to a float, e.g., 0.0, 1.0, etc., which Acrobat XI and Reader DC ignore. It should be set to an integer. >> >> See http://aapro.net/PDF/BorderWeightTestAcrobat.pdf vs aapro.net/PDF/BorderWeightTest.pdf. >> >> The BorderWeightTestAcrobat.pdf was created by opening BorderWeightTest.pdf in Acrobat, setting the borders, and saving. >> >> It's a little awkward, since setWidth should really take an int argument, not a float to begin with. The PDF spec, to my reading, is looking for an integer number of points. So truly fixing it would break any applications trying to pass in a float. OTOH, I don't see how any such applications could be working, even though they'd compile. I suppose non-Adobe PDF renderers might work with float data. >> >> Gary >> >> -----Original Message----- >> From: Tilman Hausherr [mailto:THausherr@t-online.de] >> Sent: Wednesday, September 6, 2017 12:48 PM >> To: users@pdfbox.apache.org >> Subject: Re: QUADDING constants >> >> Am 06.09.2017 um 17:11 schrieb Gary Grosso: >>> Thanks Tilman, I thought they were public but not visible, which was disturbing my fragile sense of competency. >> I first thought you were using Netbeans (which requires to press CTRL SPACE twice to see the statics sometimes) but then I saw the missing public. I'll create an issue later tonight or tomorrow (unless you do) to put it back in. I don't see a reason why this was removed. >> >> Tilman >> >> >>> -----Original Message----- >>> From: Tilman Hausherr [mailto:THausherr@t-online.de] >>> Sent: Wednesday, September 6, 2017 11:03 AM >>> To: users@pdfbox.apache.org >>> Subject: Re: QUADDING constants >>> >>> Am 06.09.2017 um 16:54 schrieb Gary Grosso: >>>> Sigh. This must be something about Java I need to understand better. I get "The field PDVariableText.QUADDING_LEFT is not visible". >>> You're right... these are not public. That explains why google found it only for an older version. >>> >>> Tilman >>> >>> >>>> -----Original Message----- >>>> From: Tilman Hausherr [mailto:THausherr@t-online.de] >>>> Sent: Wednesday, September 6, 2017 2:13 AM >>>> To: users@pdfbox.apache.org >>>> Subject: Re: QUADDING constants >>>> >>>> Am 06.09.2017 um 02:42 schrieb Gary Grosso: >>>>> PDVariableText.setQ (and various other methods) suggest seeing the "QUADDING constants". >>>>> >>>>> Can someone please post a link? Or tell me what class to look at? I've searched, googled, etc., for close to a half hour. I suspect this is something that everyone "just knows" but I have to admit ignorance. >>>> It's also mentioned in the PDF 32000 specification: >>>> >>>> A code specifying the form of quadding (justification) that shall be used in displaying the annotation's text: >>>> 0 Left-justified >>>> 1 Centered >>>> 2 Right-justified >>>> Default value: 0 (left-justified). >>>> >>>> And then I enter "PDVariableText quadding" (without quotes) in google I find the constants that Andreas mentioned, although for an older version. If you don't get these, check if some plugin manipulated your browser's search results. >>>> >>>> Tilman >>>> >>>> >>>> -------------------------------------------------------------------- >>>> - To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org >>>> For additional commands, e-mail: users-help@pdfbox.apache.org >>>> >>>> >>>> -------------------------------------------------------------------- >>>> - To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org >>>> For additional commands, e-mail: users-help@pdfbox.apache.org >>>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org >>> For additional commands, e-mail: users-help@pdfbox.apache.org >>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org >>> For additional commands, e-mail: users-help@pdfbox.apache.org >>> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org >> For additional commands, e-mail: users-help@pdfbox.apache.org >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org >> For additional commands, e-mail: users-help@pdfbox.apache.org >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org > For additional commands, e-mail: users-help@pdfbox.apache.org > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org > For additional commands, e-mail: users-help@pdfbox.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org For additional commands, e-mail: users-help@pdfbox.apache.org