From users-return-11730-archive-asf-public=cust-asf.ponee.io@pdfbox.apache.org Tue May 14 08:03:07 2019 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 [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id CC97918065D for ; Tue, 14 May 2019 10:03:06 +0200 (CEST) Received: (qmail 98159 invoked by uid 500); 14 May 2019 08:03:05 -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 98146 invoked by uid 99); 14 May 2019 08:03:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 May 2019 08:03:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id E2E53180DBE for ; Tue, 14 May 2019 08:03:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.8 X-Spam-Level: * X-Spam-Status: No, score=1.8 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id Z31TyCv1Lkw4 for ; Tue, 14 May 2019 08:03:00 +0000 (UTC) Received: from mail-yw1-f45.google.com (mail-yw1-f45.google.com [209.85.161.45]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id E17C86117A for ; Tue, 14 May 2019 08:02:59 +0000 (UTC) Received: by mail-yw1-f45.google.com with SMTP id s5so13271228ywd.9 for ; Tue, 14 May 2019 01:02:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=PD3NyZ+ncAT8xlVFpj6IXxT/ofgzM5V6PmzpSSvXxgI=; b=kJuT6s9GzOj3eWDRyXD5/flqFyO9S0kGo536DWxh0/zD1LAyeSmZfYI1QtvyA9zKMB ovXueeYHoj0pAXc/tXOXWK0XysG9k9qDpL8ZYGjR08IVtu/N8IzJqCK+m6wZk1+1yVnS 6Nc4jibkJzoj71qcNYd3N7mtHBLnSC6GP5uPO4gvpCfgqr1pl1rbC5G3LqvJm3o69n09 g9yovt50NA8+EKdqk6FS66SmWf9bRDphcA9o7o/fvgEBKd9IPkBm2Ve2kDilTTlj96XK /WAXMzoqFqFu/jwk84WK6EycaaoSozgJ7eegJL3lgJa9kp6cZhBwsSYxNpPoanm7yy5K viXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=PD3NyZ+ncAT8xlVFpj6IXxT/ofgzM5V6PmzpSSvXxgI=; b=dAV4CKFMBzpdQzX9PVDz4lp6FxMqAaFwWLWs2ih1H0RgwjKRL3WQ24kRL0ArN6wGpY yrDstLYcFg1ztNjcR3waBlaGML/2MQO3f97TIMJ5m7CskEGN+LCtzuMr+JVeqBSnJb1u PJsje2oaow4WPu8SF3cNy7DKps6+Pigw73VA/CcThZi2p8VF0cLQVpk+qD0qe2MwN9fD uFYq/KV6opFlUyPogJGjd2ggop+PuYrmwtt/MByfV8t9HtK5KDYuNPX+yOz125Mu63DT elFZFaMaxSKyXgLN1cHfpymqTFFae6HmSZOV3vvwfNLrJsyZdA5jfSYoNatQVot9vwAg TWPg== X-Gm-Message-State: APjAAAU6CwXdP3IdYQJW3isSiEjRul6fCpaGCYJM2+Jkb4ZPQljHhKs/ eEcZN8JT81lqr6T4ZcrSFdUcYgzuU1wNTbU7Bd2bqph1 X-Google-Smtp-Source: APXvYqxgADyxavlslNXMHsanx77i5U5NqYRN2DYSrshRJ75TrLPFiVpt+gtCsfeWrrQjEKVL5ZK/BgS85g8D4YfLk+A= X-Received: by 2002:a81:68c5:: with SMTP id d188mr16158588ywc.272.1557820978414; Tue, 14 May 2019 01:02:58 -0700 (PDT) MIME-Version: 1.0 References: <3774ee196c71c6b1d4b10404a7604e349235546e.camel@fileaffairs.de> In-Reply-To: <3774ee196c71c6b1d4b10404a7604e349235546e.camel@fileaffairs.de> From: Andrea Vacondio Date: Tue, 14 May 2019 10:02:46 +0200 Message-ID: Subject: Re: Form flattening with or without refresh To: users@pdfbox.apache.org Content-Type: multipart/alternative; boundary="0000000000000ac8d50588d476f8" --0000000000000ac8d50588d476f8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable It looks like they behave the same way. I added the generated files to the Dropbox folder. Andrea Il giorno lun 13 mag 2019 alle ore 22:38 Maruan Sahyoun < sahyoun@fileaffairs.de> ha scritto: > Hi Andrea, > > would you mind testing with 2.0.14 and 2.0.13 just to see if that is a > regression? > > BR > Maruan > > > Understood, thanks for clarifying. > > So in my algorithm, given I don't modify the form I could use > > refreshAppearance=3Dtrue only when the NeedAppearance=3Dtrue in the for= m, > > correct? > > Andrea > > > > Il giorno lun 13 mag 2019 alle ore 16:26 Maruan Sahyoun < > > sahyoun@fileaffairs.de> ha scritto: > > > > > Hi, > > > > > > in theory you should get the same result but the rendering is > dependent on > > > the forms content stream. Letting PDFBox reconstruct > > > the content stream might leasd to differences compared to Adobe Reade= r > as > > > the details of formatting content such as text is not > > > part of the PDF specification. Adobe is using it's own layout model > which > > > is not published so the current state was achieved by > > > looking at sample PDFs and reworking that. > > > > > > I'll look into the PDF provided to get an idea where the difference i= s > > > coming from. > > > > > > Having said that - as long as you didn't change the form content - > using > > > refreshAppearance=3Dtrue should't be neccesary when > > > flattening. > > > > > > BR > > > Maruan > > > > > > > Hi, we are having some issue when we try to flatten the form in the > file > > > > f1040_sample.pdf > > > > We get slightly different results depending on the value of refresh > > > > appearance, in particular when we set it to true we get a slightly > wrong > > > > positioning of the text field value. > > > > Shouldn't we expect the same result in both cases? > > > > This is the test code (PDFBox 2.0.15): > > > > > > > > @Test > > > > public void testFlatten() throws IOException { > > > > PDDocument testPdf =3D PDDocument.load(new > > > > File("/home/torakiki/tmp/delete/f1040_sample.pdf")); > > > > PDAcroForm form =3D testPdf.getDocumentCatalog().getAcroFor= m(); > > > > List fields =3D new ArrayList(); > > > > > > > > > > > > fields.add(form.getField("topmostSubform[0].Page1[0].YourSocial[0].f1_04[= 0]")); > > > > testPdf.getDocumentCatalog().getAcroForm().flatten(fields, > > > false); > > > > File file =3D new > > > > File("/home/torakiki/tmp/delete/f1040_sample_pdfbox_no_refresh.pdf"= ); > > > > testPdf.save(file); > > > > } > > > > > > > > I isolated the field in the test case but we also get the same resu= lt > > > when > > > > flattening the whole form, I included the Acrobat version of the > > > flattened > > > > pdf. > > > > If we flatten the whole form with refreshAppearance=3Dfalse we get > pretty > > > > much the same result as Acrobat, same number From XObjects, but if = we > > > > flatten with refreshAppearance=3Dtrue we get a lot of Form XObjects= (I > > > guess > > > > one for each field, even empty ones) and a slightly wrong > positioning of > > > > the text field. > > > > Could you please help me understand what's the issue here? > > > > Thanks > > > > > > > > Here the files: > > > > > > > > https://www.dropbox.com/sh/rmywlrmftolvwil/AADcz1Djfe59YAm8ykKnpIN5a?dl= =3D0 > > > -- > > > Maruan Sahyoun > > > > > > FileAffairs GmbH > > > Josef-Schappe-Stra=C3=9Fe 21 > > > 40882 Ratingen > > > > > > Tel: +49 (2102) 89497 88 > > > Fax: +49 (2102) 89497 91 > > > sahyoun@fileaffairs.de > > > www.fileaffairs.de > > > > > > Gesch=C3=A4ftsf=C3=BChrer: Maruan Sahyoun > > > Handelsregister: AG D=C3=BCsseldorf, HRB 53837 > > > UST.-ID: DE248275827 > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org > > > For additional commands, e-mail: users-help@ > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org > For additional commands, e-mail: users-help@pdfbox.apache.org > > --0000000000000ac8d50588d476f8--