pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tilman Hausherr <THaush...@t-online.de>
Subject Re: Read PDF file
Date Fri, 15 May 2015 11:37:59 GMT
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


Mime
View raw message