问题
I have a link to a pdf file on my website. The pdf opens without any issues in the built-in pdf viewer on Firefox or iOS.
I get an error when I try to open the pdf by clicking the link in Firefox on Android. After clicking the link the Adobe Reader app opens and tries to download the pdf for viewing. Then I get an error and the pdf doesn't open. The error inside of Adobe Reader just says
Error. The file could not be downloaded. Please save the file to your local storage and then try to open it.
How can I troubleshoot this? I tried removing spaces from the file name, using absolute urls in the links, but none of that worked. I also tried creating a pdf using a different program, in case the issue was in the pdf itself, and that didn't help. I also tried typing in the link directly into the browser url and same thing happens.
At this point I don't know how to troubleshoot it without getting some kind of debug information. I'm using Apache on the server.
回答1:
At one time in the past, you have picked Adobe Reader as default when it comes to downloading PDF-Docs. Unfortunately, AR doesn't support that option.
To change it back, Type about:config
into the address bar of the browser. Search for browser.download.preferred.application/pdf
. Underneath it should say "Adobe Acrobat". Reset this option.
Next time you download a PDF, Firefox will ask you how you want to open the PDF. Pick anything but AR.
回答2:
PDF files created by some non-Adobe products aren't structurally correct sometimes. Adobe Reader and Acrobat products try their best to open even such PDF files but they do differ in terms of the kind of such pdf files they are able to open.
The problem is actually in the PDF file which you are trying to download. It might have some HTML code which is not formatted properly and hence the PDF viewer is not working as expected.
One workaround for this is to download the PDF file in your computer and pass the file in your Android device by other means and then opening the pdf file with the PDF viewer in the Android instead of opening it in Firefox or other browsers where you are having the problem.
Another way of fixing this is to format your PDF file using LaTex or some other tools so that it maintains the proper structure.
I am sharing a link which might have more information on this. You can see some people had a similar problem here as well.
回答3:
It could be a security related issue. If the download link is not https enabled or the certificate you provide is self-signed (or somehow not valid, aka exipred) it could prevent the Adobe app to load it directly from the url. Try to copy the file on (say) Amazon S3 and download it from andorid (which is https by default with a valid cerificate) and see if it works
来源:https://stackoverflow.com/questions/57243638/how-can-i-troubleshoot-opening-a-pdf-through-firefox-on-android