Good point Tilman… Walter, try saving writing the InputStream to a File and check that it’s a valid PDF.
-- John > On 12 Dec 2014, at 09:50, Tilman Hausherr <[email protected]> wrote: > > This sounds more like a http problem. Try setting a user agent like a browser. > > https://stackoverflow.com/questions/2529682/setting-user-agent-of-a-java-urlconnection > > Tilman > > Am 12.12.2014 um 11:53 schrieb Walter Kehl: >> Hi all, >> >> >> I have the following situation: >> >> >> I am loading with PdfBox files from the internet with the call >> >> PDDocument document = PDDocument.load( inputStream ); >> >> >> So far it has worked nicely, but I have problems with this file : >> http://esa.un.org/unpd/wup/PressRelease/WUP2014_PressRelease.pdf >> >> >> After I load it, it is empty, and the call document.getNumberOfPages() >> returns 0. >> >> However when I download the file manually and then load it into PdfBox, then >> everything is fine. >> >> >> Any idea what could be happening? I am currently using PdfBox 1.8.5. >> >> >> Thanks and Best Regards >> >> Walter >> >> >> >> >> >

