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 60BF417D4A for ; Wed, 4 Mar 2015 17:40:52 +0000 (UTC) Received: (qmail 1402 invoked by uid 500); 4 Mar 2015 17:40:52 -0000 Delivered-To: apmail-pdfbox-users-archive@pdfbox.apache.org Received: (qmail 1377 invoked by uid 500); 4 Mar 2015 17:40:52 -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 1365 invoked by uid 99); 4 Mar 2015 17:40:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Mar 2015 17:40:51 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW X-Spam-Check-By: apache.org Received-SPF: error (athena.apache.org: local policy) Received: from [209.85.192.177] (HELO mail-pd0-f177.google.com) (209.85.192.177) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Mar 2015 17:40:46 +0000 Received: by pdjz10 with SMTP id z10so8062277pdj.11 for ; Wed, 04 Mar 2015 09:38:34 -0800 (PST) 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=6REw2TNIzDs3lFnfLJe41v03+WiJDLPY5hWQaqOLVEE=; b=VgZ2lJk8pmyx8b+ld8L5jzKDFdMx3E4/A+zkUo3YBfI8+S7u3tjtd3QKgMn0oyHJAC rg7PQxAmFmd5E4eWJ9H3fPKS6VPcdIls/hdEe9rKe/2uNu5TnlMnycVyB/Sggs+WjW+9 0+fd/u/b8+dfDlQalpDC4PCCfheTpFZ719g7s= 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=6REw2TNIzDs3lFnfLJe41v03+WiJDLPY5hWQaqOLVEE=; b=Q5ncNalPTenHYokY7ZHKtHMhR6y4wY2rAXyK0exWIQaG0Q6zIVJF/exGdHTqoO8vFr AVW2FsIsZ9NwlXEiUtytb/IUS8V7j9kaGIRo53zo2qXqMeGzXQKmX2HfhJd9UOID0CFi apSM4TYzatEu3XXMLpjfiyXEacDRBqAMXNGMS3mFOFVLR72BkVQDC8b4N/iC2Ry6VP7T qTrYPPA7gxc/XSAuf+I1OGwcXpUjtSjVpxfnJPHGBoFCNKrDAVOQDKQkTjGapXIIKwKF ZaCBf5mB8FP4Jr90q6i0Yxor2aXH0X6nRzFT8gC6PhXVwtH5/y4AheahKq6GQ+LxOySZ FSWg== X-Gm-Message-State: ALoCoQlqBbgxrNxnJFrNG+Yu5wdehQEX9F4rTzRHoinXqoGWNARSp9q+cEQFUl+1UHaIVhN8I6vX X-Received: by 10.66.65.138 with SMTP id x10mr8557109pas.152.1425490714475; Wed, 04 Mar 2015 09:38:34 -0800 (PST) Received: from [10.0.1.9] (cpe-75-84-33-206.socal.res.rr.com. [75.84.33.206]) by mx.google.com with ESMTPSA id pp9sm4562713pbb.65.2015.03.04.09.38.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 04 Mar 2015 09:38:33 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Subject: Re: PDFRenderer From: John Hewson In-Reply-To: Date: Wed, 4 Mar 2015 09:38:25 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: To: users@pdfbox.apache.org X-Mailer: Apple Mail (2.1993) X-Virus-Checked: Checked by ClamAV on apache.org > On 4 Mar 2015, at 07:35, Eric Douglas wrote: >=20 > I'm using org.apache.pdfbox.rendering.PDFRenderer renderPageToGraphics > method in a GUI component. > This PDFRenderer requires a document in the constructor. This render > method requires the document to be open. PDDocument.load creates and = opens > the document object. How much overhead is in this method? PDDocument.load has significant overhead, opening a PDF is an expensive = operation. > I either need to call the load method every time I call the render = method, > or I need to make sure it loads once and call the close method when = the > component gets destroyed? You want to make sure that you only have one PDDocument open for a given = PDF. > If I don't call the close method I get this message in my logs. > org.apache.pdfbox.cos.COSDocument finalize > WARNING: Warning: You did not close a PDF Document Yep, PDDocument implements Closeable, so you need to call close() on it. =E2=80=94 John= --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org For additional commands, e-mail: users-help@pdfbox.apache.org