pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Hewson <j...@jahewson.com>
Subject Re: Downloadind a pdf file doesn't work
Date Fri, 12 Dec 2014 17:56:31 GMT
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 <THausherr@t-online.de> 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
>> 
>>  
>>  
>>  
>> 
> 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message