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 3989C10B25 for ; Mon, 21 Oct 2013 17:37:11 +0000 (UTC) Received: (qmail 19374 invoked by uid 500); 21 Oct 2013 17:37:01 -0000 Delivered-To: apmail-pdfbox-users-archive@pdfbox.apache.org Received: (qmail 18309 invoked by uid 500); 21 Oct 2013 17:36:42 -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 18299 invoked by uid 99); 21 Oct 2013 17:36:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Oct 2013 17:36:40 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of bs1984@gmail.com designates 209.85.128.173 as permitted sender) Received: from [209.85.128.173] (HELO mail-ve0-f173.google.com) (209.85.128.173) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Oct 2013 17:36:36 +0000 Received: by mail-ve0-f173.google.com with SMTP id jw12so3792968veb.32 for ; Mon, 21 Oct 2013 10:36:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=97ZoWLnoJaJ5tTgqXs72Mjy7uRPVJafHjys6eE113Mo=; b=F6lr2Afc15StScGwE2g77zXz0kBr67pWESPW9NIX7F52jKYlJH4kA4mJBg3y8FH9Qn e0rYIYu182GcZZZn9jH/tjxwt86YrTGHCOgbWaOubfBQfxJKoi2CVhj+xSYXTNpmO7Ef cNJ6bIBzRVelUONGe8+8nRclHT+mERwvDa/3owwhEhOYp7CQLc+weOJT+/kvXDBqIyZE U+xWKvr8aRscrKRkoGdCJQkW32Nv3RC476fg4vd8GGVMENqBa7+IBKG5k9SiEgbB0FfV MxtrFzc54pwAcSfNysP7H4IYwuzu7oEHcAJChzht+Uy6yhPgoroP8l3UP0k7eaNh+f+z QujA== MIME-Version: 1.0 X-Received: by 10.58.11.73 with SMTP id o9mr11413039veb.8.1382376976421; Mon, 21 Oct 2013 10:36:16 -0700 (PDT) Received: by 10.52.32.42 with HTTP; Mon, 21 Oct 2013 10:36:16 -0700 (PDT) In-Reply-To: <5264C817.10503@lehmi.de> References: <5264C817.10503@lehmi.de> Date: Mon, 21 Oct 2013 10:36:16 -0700 Message-ID: Subject: Re: No text output with RenderUtil.convertToImage on document with embedded font From: Bo Shi To: users@pdfbox.apache.org Content-Type: multipart/alternative; boundary=047d7b2ed341a01a1104e943b8c8 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b2ed341a01a1104e943b8c8 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Andreas, the URL in the sample code* is exactly the PDF I was using to test. The sample provided is unchanged from what I was using to produce the issue. For what it's worth it appears to be a LaTeX generated PDF. Please excuse the duplicate line of logic. *http://www.mathworks.com/**moler/random.pdf On Sun, Oct 20, 2013 at 11:22 PM, Andreas Lehmkuehler wro= te: > Hi, > > Am 18.10.2013 03:49, schrieb Bo Shi: > > Hi - was test driving the page rendering functionality in PDFBox when I >> ran >> across an interesting case. Here's the snippet to reproduce (Using PDFB= ox >> 2.0.0-SNAPSHOT, 10/9) >> >> package testdrive; >> >> import org.apache.pdfbox.pdmodel.**PDDocument; >> import org.apache.pdfbox.pdmodel.**PDPage; >> import org.apache.pdfbox.util.**RenderUtil; >> >> import javax.imageio.ImageIO; >> import java.awt.image.BufferedImage; >> import java.io.File; >> import java.net.URL; >> >> public class Experiment { >> public static void main(String[] argv) throws Exception { >> PDDocument document =3D PDDocument.load( >> new URL("http://www.mathworks.com/**moler/random.pdf >> ")); >> PDPage p1 =3D (PDPage) document.getDocumentCatalog().** >> getAllPages().get(0); >> RenderUtil.convertToImage(p1, BufferedImage.TYPE_INT_RGB, 150); >> BufferedImage image =3D RenderUtil.convertToImage(p1, >> BufferedImage.TYPE_INT_RGB, 150); >> ImageIO.write(image, "jpg", new File("/tmp/test.jpg")); >> ImageIO.write(image, "png", new File("/tmp/test.png")); >> } >> } >> >> The result are a blank page. It seems whatever kind of embedded font th= e >> PDF is using is not supported. I'm not getting any messages in stdout >> (that might be improperly configured logging). Is this a known issue? >> Any >> workarounds? >> > Sounds like a PDFbox issue. Did you try to render the pdf using the > PDFReader > coming with PDFBox? Can you provide us with the pdf in question? > > BTW: why are you calling convertToImage twice? Remove the first call to > save > some time and resources. > > BR > Andreas Lehmk=FChler > > --047d7b2ed341a01a1104e943b8c8--