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 3251F1875E for ; Thu, 16 Jul 2015 23:46:27 +0000 (UTC) Received: (qmail 68780 invoked by uid 500); 16 Jul 2015 23:46:27 -0000 Delivered-To: apmail-pdfbox-users-archive@pdfbox.apache.org Received: (qmail 68756 invoked by uid 500); 16 Jul 2015 23:46:26 -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 68743 invoked by uid 99); 16 Jul 2015 23:46:26 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Jul 2015 23:46:26 +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 13CA918286D for ; Thu, 16 Jul 2015 23:46:26 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.891 X-Spam-Level: X-Spam-Status: No, score=0.891 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, T_DKIM_INVALID=0.01, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=neutral reason="invalid (public key: not available)" header.d=jahewson.com Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id yeh97oQaQCdi for ; Thu, 16 Jul 2015 23:46:18 +0000 (UTC) Received: from mail-pa0-f41.google.com (mail-pa0-f41.google.com [209.85.220.41]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id F123E43DDB for ; Thu, 16 Jul 2015 23:46:17 +0000 (UTC) Received: by pachj5 with SMTP id hj5so50529214pac.3 for ; Thu, 16 Jul 2015 16:45:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jahewson.com; s=google; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=NDlTkPKiwWp7jZw2ZzET5175KrjS3jCxLnWbpM+DeM4=; b=auy8U+1fjjY3Im3fgJXuTNq4rp8lVkivlPCNQkcYVlVfSfyck9ddO5EEbvolibf3oe PIYOGIbWEDzjjbUIyhvf6HY5pD/8uKRKR0K4wRCwB/QrZQCv8ZESFmrV61zDufqlEgxq 3F2eC0BoldVtt1qtcFGYB3tUMWKlAZdi1POB8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:content-transfer-encoding:message-id:references:to; bh=NDlTkPKiwWp7jZw2ZzET5175KrjS3jCxLnWbpM+DeM4=; b=FMXaVSxcE6QW9tVD+OhY0h7ZnNU36G10G2mbDee6XEGuOd0vLSN8hJtKTBVo195qCH mvaVtIKN7Nm7JgrO88yXa/73nhZ8/EZqL6+DOOPNXIu2yChK6YwiUTmv57zz0461lCE1 ELH+ymTwQ4FbcTOaN/3PJSTcelL4tiUPuIP2FuUIm92egcyzuk39QYcf6FQ+73KYkpdv V8/2vWx8koIElwpLkPL/iWOpfYnmA7Cz/VALHQRLAmIcY1LEcdn3O63rqjU3P+cy4GNW uMTsYncO1JMtCDNAB2UOd/J+fllGTDs5L6m8QojQKl3Aztw/5KTVKUfjqXLO000x6ZYX zhxw== X-Gm-Message-State: ALoCoQnERTKmDSk6OCEAQJmH+8R/6CaRsoZcM1wEeE4gmi3kuqklKklQqOZt1ddkchpYyZ48dRtl X-Received: by 10.70.49.5 with SMTP id q5mr23443468pdn.151.1437090332010; Thu, 16 Jul 2015 16:45:32 -0700 (PDT) Received: from [10.0.1.7] (c-73-202-194-89.hsd1.ca.comcast.net. [73.202.194.89]) by smtp.gmail.com with ESMTPSA id de2sm9136817pdb.15.2015.07.16.16.45.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 16 Jul 2015 16:45:31 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Subject: Re: PDFBox 2.0.0 Snapshot PDChoice and Increased Runtime Execution Time From: John Hewson In-Reply-To: <1437089540.90565.YahooMailBasic@web141204.mail.bf1.yahoo.com> Date: Thu, 16 Jul 2015 16:46:05 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <1437089540.90565.YahooMailBasic@web141204.mail.bf1.yahoo.com> To: users@pdfbox.apache.org X-Mailer: Apple Mail (2.2098) > On 16 Jul 2015, at 16:32, jarrod wrote: >=20 > Hello John, >=20 > Adding setNeedAppearances(true) did allow me to set PDChoice fields = similar to version 1.8.9. I noticed that you did not have to add the = value if it didn't exist first like you would have had to do in version = 1.8.9. >=20 > Additionally, adding that line of code reduced the runtime for saving = by a few seconds and also removed those warnings I was getting = previously. >=20 > On top of all that, it appears to have resolved the auto sizing issue = that I was facing and working on with Maruan. >=20 > So does this, "This tells consumers of the PDF that they will need to = generate the appearances themselves, i.e. they are not pre-generated" = mean that pdf reader's will then have to generate the appearance when it = opens? I guess the danger there is that it can appear differently across = different readers and versions. Yes, unfortunately, that=E2=80=99s exactly what it means. We have plans = to implement more appearances in the medium-term future. In general, PDF = readers should support NeedAppearances, but your milage may vary. =E2=80=94 John > Now I'm just wondering if there is anyway to reduce the 8seconds to = save. >=20 > Thanks for all the support! >=20 > Jarrod >=20 >=20 > -------------------------------------------- > On Thu, 7/16/15, John Hewson wrote: >=20 > Subject: Re: PDFBox 2.0.0 Snapshot PDChoice and Increased Runtime = Execution Time > To: users@pdfbox.apache.org > Date: Thursday, July 16, 2015, 5:29 PM >=20 >=20 >=20 >> On 16 Jul 2015, at 15:28, John Hewson > > wrote: >>=20 >>>=20 >>> On 16 Jul 2015, at 11:53, jarrod > > wrote: >>>=20 >>>=20 > Hello, >>>=20 >>>=20 > I've converted a 1.8.9 project to the latest 2.0.0 > shapshot (as of 20150716). This project fill's in > acroForm fields and then saves to a new file. >>>=20 >>> 1. I'm > having difficulty in assigning the selected value to a > PDChoice field. In 1.8.9, I was able to use > .setValue(strValueGoesHere) as long as the item already > existed. When it didn't exist, i would add it first. In > version 2.0.0, using .setValue(strValueGoesHere) throws an > exception "not implemented". Then I proceeded to > try using .setSelectedOptionsIndex but that throws the > following exception "Setting the indices is not allowed > for choice fields not allowing multiple selections." >>>=20 >>> How should I > be setting this PDChoice field? >>=20 >> We don=E2=80=99t support generating the > appearance for a choice field yet, but you can generate > forms without appearances (as 1.8.9 does) by first calling > setNeedAppearances(false) on the PDAcroForm. >=20 > Sorry, that should have been > setNeedAppearances(true). This tells consumers of the PDF > that they will need to generate the appearances themselves, > i.e. they are not pre-generated. >=20 > =E2=80=94 John >>=20 >>>=20 >>> 2.=20 > Additionally, I've noticed the runtime execution time > has dramatically increased when saving the document. The > following lines of code only took 0 seconds previously and > now takes 14 seconds; >>>=20 >>> java.util.Date startTime2 =3D new > java.util.Date(); >>>=20 > pdfDocument.save(dest); >>>=20 > pdfDocument.close(); >>> java.util.Date > endTime2 =3D new java.util.Date(); >>>=20 > System.out.println("Save Time: " + > ((endTime2.getTime()-startTime2.getTime())/1000)); >>>=20 >>=20 >> Andreas, any thoughts? >>=20 >>> 3. Also, > I'm getting the following log entries during runtime > although I'm guessing they are not very important; >>>=20 >>> Jul 16, 2015 > 1:43:30 PM java.util.prefs.WindowsPreferences > >>> WARNING: Could not > open/create prefs root node Software\JavaSoft\Prefs at root > 0x80000002. Windows RegCreateKeyEx(...) returned error code > 5. >>=20 >> That=E2=80=99s > PDFBox trying to create a local cache of font files and > failing. I=E2=80=99m not sure why, looks like the reason is > Windows-specific. It might take a few extra seconds to load > PDFBox without the cache, but it not a problem. >>=20 >>> Jul 16, 2015 > 1:43:30 PM org.apache.pdfbox.pdmodel.font.PDType1Font > >>> WARNING: Using > fallback font ArialMT for base font ZapfDingbats >>=20 >> I=E2=80=99m surprised that > PDFBox doesn=E2=80=99t find a better substitute for ZapfDingbats, > enable TRACE logging and post the log file. >>=20 >> =E2=80=94 John >>=20 >>>=20 >>> Thanks, >>>=20 >>> Jarrod >>>=20 >>>=20 > --------------------------------------------------------------------- >>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org > >>> For additional commands, e-mail: users-help@pdfbox.apache.org > >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org > For additional commands, e-mail: users-help@pdfbox.apache.org >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org For additional commands, e-mail: users-help@pdfbox.apache.org