Return-Path: X-Original-To: apmail-pdfbox-users-archive@www.apache.org Delivered-To: apmail-pdfbox-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E70D218C18 for ; Wed, 19 Aug 2015 20:44:53 +0000 (UTC) Received: (qmail 72511 invoked by uid 500); 19 Aug 2015 20:44:53 -0000 Delivered-To: apmail-pdfbox-users-archive@pdfbox.apache.org Received: (qmail 72488 invoked by uid 500); 19 Aug 2015 20:44:53 -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 72477 invoked by uid 99); 19 Aug 2015 20:44:53 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Aug 2015 20:44:53 +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 B1810DF4A5 for ; Wed, 19 Aug 2015 20:44:52 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1 X-Spam-Level: * X-Spam-Status: No, score=1 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id lm5TquLkP-Lc for ; Wed, 19 Aug 2015 20:44:46 +0000 (UTC) Received: from www168.your-server.de (www168.your-server.de [213.133.104.168]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id B7014210CA for ; Wed, 19 Aug 2015 20:44:45 +0000 (UTC) Received: from [88.198.220.132] (helo=sslproxy03.your-server.de) by www168.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.80.1) (envelope-from ) id 1ZSAE0-0005Bc-C0 for users@pdfbox.apache.org; Wed, 19 Aug 2015 22:44:44 +0200 Received: from [79.242.104.84] (helo=mbp001.fritz.box) by sslproxy03.your-server.de with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.80) (envelope-from ) id 1ZSADx-00078J-1U for users@pdfbox.apache.org; Wed, 19 Aug 2015 22:44:41 +0200 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: Textbox word wrap and multiline help... From: Maruan Sahyoun In-Reply-To: Date: Wed, 19 Aug 2015 22:44:37 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: To: users@pdfbox.apache.org X-Mailer: Apple Mail (2.2104) X-Authenticated-Sender: sahyoun@fileaffairs.de X-Virus-Scanned: Clear (ClamAV 0.98.5/20809/Wed Aug 19 14:41:33 2015) Hi, multiline has to be set before setting the fields value BR Maruan > Am 19.08.2015 um 20:04 schrieb ragunath marudhachalam = : >=20 > Hello, >=20 > In one of the mailing list posting, it was mentioned that pdfbox2.0 > snapshot supports multiline in a pdtextbox. I downloaded 2.0 snapshot = and > setmultiline to true. But I still get only a single line without word > wrap. I am attaching my code where I set the value for the field and = set > multiline to true. Can someone please assist me and suggest how I can = get > the word wrap working if the text is larger than the textbox. Thank = you > very much for your help and time.. >=20 > while (fieldsIter.hasNext()) > { > PDField field =3D (PDField) fieldsIter.next(); > String fieldName =3D field.getPartialName(); > //logger.error("field name "+ fieldName); > if(field instanceof PDCheckbox) > { > PDCheckbox cb =3D (PDCheckbox)field; > //cb.check(); > } > else > { > if(!field.isReadonly()) > { > if(field instanceof PDVariableText) > { > logger.error("variable text"); > String fieldNameToCheck =3D = field.getPartialName().substring(0, > 3); > if(map.get(fieldNameToCheck) !=3D null) > { > if(field.getPartialName().contains("CURRENCY")) > { > field.setValue("$ "+ (String)map.get(fieldNameToCheck)); > } > else if(field.getPartialName().contains("PERCENT")) > { > field.setValue((String)map.get(fieldNameToCheck) +"%"); > } > else > { > field.setValue(map.get(fieldNameToCheck)); > } > ((PDVariableText) field).setMultiline(true); > //field.setReadonly(true); > } >=20 > } > else > { > String fieldNameToCheck =3D = field.getPartialName().substring(0, > 3); > if(map.get(fieldNameToCheck) !=3D null) > { > if(field.getPartialName().contains("CURRENCY")) > { > field.setValue("$ "+ (String)map.get(fieldNameToCheck)); > } > else if(field.getPartialName().contains("PERCENT")) > { > field.setValue((String)map.get(fieldNameToCheck) +"%"); > } > else > { > field.setValue(map.get(fieldNameToCheck)); > } > //field.setReadonly(true); > } > } > } >=20 >=20 > } > //processField(pdf, field, "|--", field.getPartialName()); > } > } --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org For additional commands, e-mail: users-help@pdfbox.apache.org