From users-return-10837-archive-asf-public=cust-asf.ponee.io@pdfbox.apache.org Thu Mar 8 23:02:13 2018 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 50E3318064C for ; Thu, 8 Mar 2018 23:02:13 +0100 (CET) Received: (qmail 56728 invoked by uid 500); 8 Mar 2018 22:02:07 -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 56704 invoked by uid 99); 8 Mar 2018 22:02:06 -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; Thu, 08 Mar 2018 22:02:06 +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 36167C7D39 for ; Thu, 8 Mar 2018 22:02:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.3 X-Spam-Level: X-Spam-Status: No, score=0.3 tagged_above=-999 required=6.31 tests=[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 q9TUmoPiDWhE for ; Thu, 8 Mar 2018 22:02:04 +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 22B765F473 for ; Thu, 8 Mar 2018 22:02:04 +0000 (UTC) Received: from [88.198.220.130] (helo=sslproxy01.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 1eu3bp-0005uF-VK for users@pdfbox.apache.org; Thu, 08 Mar 2018 23:01:58 +0100 Received: from [2a02:908:740:c620:6dbf:8ca2:d59a:6658] by sslproxy01.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eu3bp-0002ZY-Mi for users@pdfbox.apache.org; Thu, 08 Mar 2018 23:01:57 +0100 From: Maruan Sahyoun Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (1.0) Date: Thu, 8 Mar 2018 23:01:56 +0100 Subject: Re: International characters only show correctly when form field is selected Message-Id: References: <234DEF9D-EDDB-4254-A508-D5FC3817ABAF@tomer.cc> In-Reply-To: <234DEF9D-EDDB-4254-A508-D5FC3817ABAF@tomer.cc> To: users@pdfbox.apache.org X-Mailer: iPhone Mail (15D100) X-Authenticated-Sender: sahyoun@fileaffairs.de X-Virus-Scanned: Clear (ClamAV 0.99.3/24375/Thu Mar 8 18:11:53 2018) Hi Scott, > Am 08.03.2018 um 20:42 schrieb Scott Tomer : >=20 > All, >=20 > I=E2=80=99m new to the list, but tried to search pdfbox-users.markmail.org= before asking with no luck. >=20 > We are using pdfbox to fill in some form fields in an Adobe generated temp= late but getting odd results when certain international characters are used (= some, not all). When the pdf is first opened, the characters shown are basi= cally garbage. Here is an example: =C3=BE=C3=BFB D A=C3=B3z >=20 > However, when you click into the field (or in certain readers like Okular o= n Linux choose =E2=80=9CShow Forms=E2=80=9D), the correct characters are sho= wn. Here is what is inserted into the field and shown when field is selecte= d: =C5=82 =C5=84 =C5=81 =C3=B3 =C5=BA >=20 > It is almost like the PDF has one font selected for a read-only view and t= he correct font for the view when editing a field. >=20 > This is happening with Polish, Russian, Chinese and other languages. >=20 > This is how I am populating the fields: >=20 > PDDocument pdfDoc =3D LoadPDF.load(cs, document); > PDDocumentCatalog docCatalog =3D pdfDoc.getDocumentCatalog(); > PDAcroForm acroForm =3D docCatalog.getAcroForm(); >=20 > if (acroForm !=3D null) { > for (PDField field : acroForm.getFieldTree()) { > for (PdfField pdfField : pdfFields) { > if (field.getPartialName() !=3D null && field.getPartialName().= equalsIgnoreCase(pdfField.getName())) { > field.setValue(pdfField.getValue()); > } > } > } > } > pdfDoc.save(tempPdf); > pdfDoc.close(); >=20 Looks like there is an issue with the appearance generation. Which PDFBox ve= rsion are you using? Could you upload a sample PDF to a public location for f= urther investigstion? BR Maruan=20 >=20 > Thanks for any help, > Scott --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org For additional commands, e-mail: users-help@pdfbox.apache.org