Return-Path: Delivered-To: apmail-pdfbox-users-archive@www.apache.org Received: (qmail 98880 invoked from network); 1 Oct 2010 19:54:50 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 1 Oct 2010 19:54:50 -0000 Received: (qmail 6100 invoked by uid 500); 1 Oct 2010 19:54:50 -0000 Delivered-To: apmail-pdfbox-users-archive@pdfbox.apache.org Received: (qmail 6064 invoked by uid 500); 1 Oct 2010 19:54:49 -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 6056 invoked by uid 99); 1 Oct 2010 19:54:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Oct 2010 19:54:49 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of williamstonconsulting@gmail.com designates 209.85.216.176 as permitted sender) Received: from [209.85.216.176] (HELO mail-qy0-f176.google.com) (209.85.216.176) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Oct 2010 19:54:44 +0000 Received: by qyk36 with SMTP id 36so4328307qyk.0 for ; Fri, 01 Oct 2010 12:54:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=zWeuc79RdUqY2BjJapwKo2FIXHkzROWaeIAb623SFwM=; b=eaG08R7jK+4R5+Y8A8ZlNvreJ6oHbtuwf/KB5nGFYSZgRFDflb3v5nXc7MTtqGUDPy RJgWuPiYMUEbt5j8brPZDc21ALOznNnnDEgQz7lo+zge6+Quioh/j4dmT6C3QgIuoIBl F9VohjcCE7+bsmteNHMoUu3AzdoT2d3A323wM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=nZdafEgm+z+NYDbv0CJ2dumWgNOP6SF/BS3BFrf5bpMkK/6p8D75yvLvHo8O19Hzxh WR9+bC35+TYt+wj5HkndxrD4kRIpZczdM8/qDnY7tRB6ZJbWyEPJHHQWRZmgZrjTDbKS UkB7cxGswIf+BcvnIyyfu+1Y6wHcSvicJnNHI= MIME-Version: 1.0 Received: by 10.229.188.149 with SMTP id da21mr4316496qcb.84.1285962863631; Fri, 01 Oct 2010 12:54:23 -0700 (PDT) Received: by 10.229.40.199 with HTTP; Fri, 1 Oct 2010 12:54:23 -0700 (PDT) In-Reply-To: References: Date: Fri, 1 Oct 2010 15:54:23 -0400 Message-ID: Subject: Re: insufficient data for an image From: Daniel Wilson To: users@pdfbox.apache.org, grant@floorsoft.com Content-Type: multipart/alternative; boundary=001636284732ae67dc0491938f83 --001636284732ae67dc0491938f83 Content-Type: text/plain; charset=ISO-8859-1 As begun at http://www.experts-exchange.com/Programming/Languages/Java/Q_26515004.html... Can you create an issue in JIRA with this *and include* both the image you're using and the PDF you're getting? Thanks. Daniel On Fri, Oct 1, 2010 at 2:29 PM, Grant Overby wrote: > When I open a pdf generated with pdfbox with adobe, I get the following > error: insufficient data for an image . > > I'm using this code (stripped down version) to create the pdf. > > PDDocument pdDocument = new PDDocument(); > BufferedImage image = myObject.toBufferedImage(); > PDPage pdPage = new PDPage(new PDRectangle(image.getWidth() + border * 2, > image.getHeight() + border * 2)); > pdPage.setRotation(myObject.getRotation()); > contentStream = new PDPageContentStream(pdDocument,pdPage,false,false); > contentStream.drawImage(new PDJpeg(pdDocument,image),border,border); > pdDocument.addPage(pdPage); > pdDocument.save(outputStream = new FileOutputStream(file)); > > > Any ideas about what I'm doing wrong? > > -- > Grant Overby > Senior Developer > FloorSoft, Inc. > > Often people, especially computer engineers, focus on the machines. They > think, "By doing this, the machine will run faster. By doing this, the > machine will run more effectively. By doing this, the machine will > something > something something." They are focusing on machines. But in fact we need to > focus on humans, on how humans care about doing programming or operating > the > application of the machines. We are the masters. They are the slaves. -- > Yukihiro Matsumoto > --001636284732ae67dc0491938f83--