0

I am trying to open a url which is actually a pdf file but it does not have .pdf extension in android webview BUT it does not works. It directly downloads. But when i open the url in WEB browser, the pdf file opens perfectly. Since this url does not have .pdf extension, I can not use google docs as well. Also tried to download and open the file using any pdf viewer app, it also fails. The main reason is my Url does not have .pdf extension. Is there any other solution?

B Roh
  • 89
  • 4

2 Answers2

0

I think you are not setting the content type as pdf(MIME). Thats why you are getting problem when you are downloading the pdf content.

See this post for more details.

Proper MIME media type for PDF files

MIME TYPES

Render a PDF file using Java on Android

Community
  • 1
  • 1
smali
  • 4,687
  • 7
  • 38
  • 60
0

you can see this .pdf extension is not necessary

Vaishali Sutariya
  • 5,093
  • 30
  • 32