From users-return-10980-archive-asf-public=cust-asf.ponee.io@pdfbox.apache.org Fri Apr 27 08:13:46 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 D789F180608 for ; Fri, 27 Apr 2018 08:13:45 +0200 (CEST) Received: (qmail 99205 invoked by uid 500); 27 Apr 2018 06:13:44 -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 99149 invoked by uid 99); 27 Apr 2018 06:13:43 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Apr 2018 06:13:43 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id C4A8AC00DB for ; Fri, 27 Apr 2018 06:13:42 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.879 X-Spam-Level: * X-Spam-Status: No, score=1.879 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id kOT-lM72fz3w for ; Fri, 27 Apr 2018 06:13:40 +0000 (UTC) Received: from mail-qt0-f169.google.com (mail-qt0-f169.google.com [209.85.216.169]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id DBC305FBF7 for ; Fri, 27 Apr 2018 06:13:36 +0000 (UTC) Received: by mail-qt0-f169.google.com with SMTP id f16-v6so939702qth.0 for ; Thu, 26 Apr 2018 23:13:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=+aYOztzi2huvN3mS78PnCqx2lrnAIdVzRi7piZK0+cQ=; b=ssjr3DJKBjA5H7WNNGM8ayXMdpVZRudq2MFzYbT+Fgzp9JQPzdcjs43Ksfx8I4W0u5 cH7zuRydUum2E8yu8OLJXcV0tMbIaiuWQK6LYDrkoXf+3h73vQogIuSgoUsQDlISbhMZ xstU69wursp4lq3uc6pNHct4ctkdCTfxDwsKx7ZL6KaajdwI0jy+nBxxTGAhgR4IVvfm xMAw+CQ4wAHrCMgAXkNUA9nsotaH7ZolGXJ8uY2/28LxFJgNAHX48hdOFNHdWwYUZAAl ot5htYFE3+/tgEQ3ad6t4VMqwrKad6EkFJICSHuZHG181IalPxAsmMb5tJyK20TZjHDQ h9fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=+aYOztzi2huvN3mS78PnCqx2lrnAIdVzRi7piZK0+cQ=; b=It1LzGQomsYlZ6Cbam1IdUGCw9VQNiCBsSnBdoWm6txj9R1RwowKDod5iCLDvs14Y+ yP6w0Zlh5S/4OxM4CTyW525lF7bDHhvdq7WZm8qTdyoigRbhrrFW3UVM8UTguMlibLs7 TbeS2EZNVr+/yYtPVzUYnugKSlUge95rIgtD6IXKyRuJqq46Lakwt5mNIBlQl1O0vCWC E8w2CriFZIo9hh6mesWF1o69gu09NlrrNHhwgZ/qkp5/gySnMLJVQcA76XjVHynYHdQ8 rr5uwpiDqzMRndrI4ebCOg6jk34NFDCFEVmkHEFMWZFnQAxNLj3P+QJU+LSgMjVkJd8J Oi2g== X-Gm-Message-State: ALQs6tC4q/JvkkszSSgpvmPo4MK6BUPsS3yvSlKJ4+grw5Fa/k/2VOku aUHXk9uXuy3tH9scy4pec/2VztSVLmgTtLrPlz/2IK4j X-Google-Smtp-Source: AB8JxZo1g4SVB+cc0hy/NiDE91io91SgMrnEqUklsKgxrCCpza2/FS96kh+pmQkL09AW7RhemTCrzXVTzmsq8sL/5fk= X-Received: by 2002:ac8:3294:: with SMTP id z20-v6mr834482qta.366.1524809615408; Thu, 26 Apr 2018 23:13:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.200.103.76 with HTTP; Thu, 26 Apr 2018 23:13:34 -0700 (PDT) From: Mickael Marrache Date: Fri, 27 Apr 2018 09:13:34 +0300 Message-ID: Subject: PDFBOX cache warning and embedded fonts To: users@pdfbox.apache.org Content-Type: multipart/alternative; boundary="0000000000007a0257056ace677b" --0000000000007a0257056ace677b Content-Type: text/plain; charset="UTF-8" Hi, After encountering the following error: java.lang.IllegalArgumentException: U+05E5 ('afii57685') is not available in this font Helvetica encoding: WinAnsiEncoding at org.apache.pdfbox.pdmodel.font.PDType1Font.encode(PDType1Font.java:426) I'm embedding the font I want to use as follows: PDAcroForm acroForm = pdfDocument.getDocumentCatalog().getAcroForm(); PDResources res = acroForm.getDefaultResources(); PDType0Font font = PDType0Font.load(pdfDocument, PDFBoxUtils.class.getClassLoader().getResourceAsStream("DAVID.TTF")); COSName fontName = res.add(font); acroForm.setDefaultResources(res); textField.setDefaultAppearance("/" + fontName.getName() + " 0 Tf 0 g"); I expect the font to be embedded but then I see the following in the logs: [org.apache.pdfbox.pdmodel.font.PDCIDFontType2] - Using fallback font LiberationSans for CID-keyed TrueType font David Before fixing fonts for text fields using the snippet above, the text fields are set with the font David (via Acrobat DC). I can understand PDFBOX can't find this font because it is not installed on the server. However, the fonts are changed with an embedded font available on the classpath so I don't understand why I get that warning. I also thought the warnings are generated when the document is loaded (before text fields are fixed) but then I tried to open the generated PDF with Acrobat Reader and I see squares instead of valid characters. I also precise I flatten the acroform. Thanks, Mickael --0000000000007a0257056ace677b--