How to set favicon.ico on a pdf link?
I am working on web project in java where i have t开发者_开发百科o open a pdf file by the link :
<a href="files/help.pdf" target="_blank" title="User Manual (pdf)">View User Manual</a>
I know how to set favicon
on the links but didn't know how to set it on this pdf file..
Can anyone have the answer?
Thanks in advance...
In Chrome, do the following:
Place the favicon in the root of your website, and call it favicon.ico
Clear the cache
Load the PDF from your website
You can't. A favicon is something that can be set on a HTML page, but not on a PDF file. You might be able to do that by linking to a HTML page which has a favicon and contains an iframe containing the PDF file, but it seems overkill for just a favicon.
You can try the default favicon location - i.e. place favicon.ico
on the root of server (which is normally the ROOT application). In production you will almost always be running as ROOT. But I don't know if browsers will recognize that - if they don't, it means you can't do it. PDFs are read in the browser only if there's a plugin, so perhaps the normal favicon resolution doesn't happen.
You could try using a php script to deliver the pdf and setting a favicon in the header there. But I don't think thats worth the effort.
精彩评论