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 2DDEC17EC5 for ; Fri, 15 May 2015 11:37:55 +0000 (UTC) Received: (qmail 29785 invoked by uid 500); 15 May 2015 11:37:55 -0000 Delivered-To: apmail-pdfbox-users-archive@pdfbox.apache.org Received: (qmail 29763 invoked by uid 500); 15 May 2015 11:37:54 -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 29751 invoked by uid 99); 15 May 2015 11:37:54 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 May 2015 11:37:54 +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 4E8E418283E for ; Fri, 15 May 2015 11:37:54 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.989 X-Spam-Level: X-Spam-Status: No, score=0.989 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H2=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled 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 xF5nd2ZiHhla for ; Fri, 15 May 2015 11:37:53 +0000 (UTC) Received: from mailout10.t-online.de (mailout10.t-online.de [194.25.134.21]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id 5B56B45435 for ; Fri, 15 May 2015 11:37:53 +0000 (UTC) Received: from fwd08.aul.t-online.de (fwd08.aul.t-online.de [172.20.26.151]) by mailout10.t-online.de (Postfix) with SMTP id 293B69010 for ; Fri, 15 May 2015 13:37:52 +0200 (CEST) Received: from [192.168.2.102] (ESJZO8ZZwhZf9PQ0kn8G-FZCmhhgtixmQk20ApbeMsjzAEi0pkfKHj2MbYmsVTVgLC@[217.231.134.101]) by fwd08.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-SHA encrypted) esmtp id 1YtDw4-3VUJGq0; Fri, 15 May 2015 13:37:48 +0200 Message-ID: <5555DA97.9050909@t-online.de> Date: Fri, 15 May 2015 13:37:59 +0200 From: Tilman Hausherr User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: users@pdfbox.apache.org Subject: Re: Read PDF file References: In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-ID: ESJZO8ZZwhZf9PQ0kn8G-FZCmhhgtixmQk20ApbeMsjzAEi0pkfKHj2MbYmsVTVgLC X-TOI-MSGID: 85ee4d07-56fd-4cfc-85a0-ad13c1663896 Am 15.05.2015 um 13:01 schrieb Andrei Petru Mura: > Hi, > > Can anyone provied me an example on how to read attachments from a pdf file? > > Here is my code, that thrown NullPointerException: > > PDDocument document = new PDDocument(); > document.load(new File("/path/to/file.pdf")); use PDDocument document = PDDocument.load(new File("/path/to/file.pdf")); About the test - please see the ExtractEmbeddedFiles example from the source code: https://svn.apache.org/viewvc/pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/ExtractEmbeddedFiles.java?view=markup&sortby=date another example is in the TestSymmetricKeyEncryption.java file, this is a unit test. Tilman > document.getDocumentCatalog().getNames().getEmbeddedFiles(); > > Can anyone provide me a short example? > > Thanks, > Andrei > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org For additional commands, e-mail: users-help@pdfbox.apache.org