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 97157200C72 for ; Fri, 28 Apr 2017 07:59:50 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 959BE160BB2; Fri, 28 Apr 2017 05:59:50 +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 B4625160BA7 for ; Fri, 28 Apr 2017 07:59:49 +0200 (CEST) Received: (qmail 20615 invoked by uid 500); 28 Apr 2017 05:59:48 -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 20604 invoked by uid 99); 28 Apr 2017 05:59:48 -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, 28 Apr 2017 05:59:48 +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 30A4ECD7C3 for ; Fri, 28 Apr 2017 05:59:48 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.1 X-Spam-Level: * X-Spam-Status: No, score=1.1 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_LOW=-0.7] 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 ts2DsPlGzzBL for ; Fri, 28 Apr 2017 05:59:44 +0000 (UTC) Received: from www168.your-server.de (www168.your-server.de [213.133.104.168]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 06DF45F4EE for ; Fri, 28 Apr 2017 05:59:43 +0000 (UTC) Received: from [88.198.220.131] (helo=sslproxy02.your-server.de) by www168.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.85_2) (envelope-from ) id 1d3ywL-00088u-9p for users@pdfbox.apache.org; Fri, 28 Apr 2017 07:59:37 +0200 Received: from [2a02:908:740:c620:e176:80c5:237c:38a9] by sslproxy02.your-server.de with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.84_2) (envelope-from ) id 1d3ywL-0004lP-2W for users@pdfbox.apache.org; Fri, 28 Apr 2017 07:59:37 +0200 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: Text appears reverted in textbox From: Maruan Sahyoun In-Reply-To: Date: Fri, 28 Apr 2017 07:59:36 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <294B0B1E-E183-4CE6-80B8-7D9C98DF7BA4@fileaffairs.de> <4CB8CAC1-D9F0-4C1E-826C-E3D6FA438F62@fileaffairs.de> To: users@pdfbox.apache.org X-Mailer: Apple Mail (2.3124) X-Authenticated-Sender: sahyoun@fileaffairs.de X-Virus-Scanned: Clear (ClamAV 0.99.2/23337/Fri Apr 28 06:56:26 2017) archived-at: Fri, 28 Apr 2017 05:59:50 -0000 Hi, > Am 28.04.2017 um 05:44 schrieb Mickael Marrache = : >=20 > Thanks for looking at this. >=20 > Is there an estimate for when PDFBox will be able to support it? >=20 no, as this is a volunteers effort I can't give you any timing on this. = We are planning to do it but maybe in another major release as one of = the options we are looking into is dependent on Java 8 (and we are just = moving to Java 7 for PDFBox 3.0). Is it Java libraries you are looking for? I could give you some names = but as I havn't tried filling forms in Hebrew with these I don't know if = they are able to handle your requirements. BR Maruan > Could you please propose alternative libraries that we can use in the > meantime? Free libraries preferred but not only. >=20 > Thanks, > Mickael >=20 > Le 28 avr. 2017 01:14, "Maruan Sahyoun" a = =C3=A9crit : >=20 >> OK, I had a look at this. >>=20 >> At this point in time PDFBox doesn't support the appearance = generation for >> RTL text. The reason you see the text reverted is because one would = need to >> handle the text in visual order. >>=20 >> So where PDFBox writes the string as >>=20 >> \000\250\000\243\000\245\000\232\000\246 >>=20 >> Adobe Reader writes the string as >>=20 >> \000\246\000\232\000\245\000\243\000\250 >>=20 >> This could be fixed but wouldn't be sufficient to completely handle = Hebrew >> and other languages whith complex-text requirements (word forming, >> character shaping, BIDI =E2=80=A6). >>=20 >> At that point in time PDFBox doesn't provide the capabilites needed. >>=20 >> BR >> Maruan >>=20 >>=20 >>> Am 26.04.2017 um 12:34 schrieb Mickael Marrache < >> mickael@wakeuppension.com>: >>>=20 >>> The PDF before filling: >>>=20 >>> http://docdro.id/ybLln7x >>>=20 >>> The PDF after filling: >>>=20 >>> http://docdro.id/QcZfT9H >>>=20 >>> On 2017-04-26 10:56 (+0300), Maruan Sahyoun >> wrote: >>>> Hi, >>>>=20 >>>>> Am 26.04.2017 um 08:19 schrieb Mickael Marrache < >> mickaelmarrache@gmail.com>: >>>>>=20 >>>>> Hi, >>>>>=20 >>>>> I'm trying to fill a PDF form using PDFBox 2.0.5 as follows: >>>>>=20 >>>>> PDDocument pdfDocument =3D >>>>> PDDocument.load(this.getClass().getClassLoader(). >> getResourceAsStream("form.pdf")); >>>>> PDAcroForm acroForm =3D = pdfDocument.getDocumentCatalog().getAcroForm(); >>>>>=20 >>>>> PDResources formResources =3D acroForm.getDefaultResources(); >>>>> PDTrueTypeFont font =3D (PDTrueTypeFont) >>>>> formResources.getFont(COSName.getPDFName("David,Bold")); >>>>>=20 >>>>> TrueTypeFont ttFont =3D font.getTrueTypeFont(); >>>>>=20 >>>>> PDFont font2 =3D PDType0Font.load(pdfDocument, ttFont, true); >>>>> ttFont.close(); >>>>>=20 >>>>> formResources.put(COSName.getPDFName("F0"), font2); >>>>>=20 >>>>> if (acroForm !=3D null) { >>>>> PDTextField field =3D (PDTextField) = acroForm.getField("full_name"); >>>>> field.setDefaultAppearance("/F0 10 Tf 0 g"); >>>>> field.setValue(/* hebrew text here*/); >>>>> } >>>>>=20 >>>>> File targetFile =3D File.createTempFile("", ".pdf"); >>>>> pdfDocument.save(targetFile); >>>>> pdfDocument.close(); >>>>>=20 >>>>> The reason I embed the David,Bold font is explained here >>>>> http://stackoverflow.com/questions/42903217/write- >> cyrillic-chars-into-pdf-form-fields-with-pdfbox >>>>=20 >>>>=20 >>>> could you upload a PDF before and after filling to a public = location? >>>>=20 >>>> BR >>>> Maruan >>>>=20 >>>>=20 >>>>> . >>>>>=20 >>>>> The issue is that the resulting PDF file has the text in the = full_name >>>>> textbox displayed in the reverse direction. However, if I click on = the >>>>> textbox, the text appears correctly. I precise that the text = filled in >> the >>>>> textbox is in Hebrew (right-to-left). >>>>>=20 >>>>> Any idea? >>>>>=20 >>>>> Thanks, >>>>> Mickael >>>>=20 >>>>=20 >>>> = --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org >>>> For additional commands, e-mail: users-help@pdfbox.apache.org >>>>=20 >>>>=20 >>>=20 >>> = --------------------------------------------------------------------- >>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org >>> For additional commands, e-mail: users-help@pdfbox.apache.org >>>=20 >>=20 >>=20 >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org >> For additional commands, e-mail: users-help@pdfbox.apache.org >>=20 >>=20 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org For additional commands, e-mail: users-help@pdfbox.apache.org