Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

failed to find PDF header: '%PDF' not found

I am trying to download pdf content from webservice endpoint which is coming as binary. After decoding into base64 I am attaching the decoded file to webview, in which failed to find pdf header error is displaying.

Does anyone know how can I proceed to fix this error? Am I missing any step here?

Thanks.

like image 635
topgun Avatar asked Jan 13 '12 21:01

topgun


1 Answers

I had this error when developing my app that read pdf's the issue is the PDF doesn't exist at where your calling it from. The binary data that is being returned is the error response that your web service is calling. For example if I am requesting a pdf document at :

http://localhost:8080/template/DocumentServlet?documentId=923447&JSSESIONID=77EFJD3IJD8I3MMWW2435353J

if that document doesn't exist at that address then I will get an error response, and that is what the binary data is that is being returned.

like image 133
Popeye Avatar answered Oct 22 '22 04:10

Popeye