Asif
Asif

Reputation: 5038

How to set favicon.ico on a pdf link?

I am working on web project in java where i have to 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...

Upvotes: 3

Views: 13937

Answers (4)

Noji
Noji

Reputation: 187

In Chrome, do the following:

  1. Place the favicon in the root of your website, and call it favicon.ico

  2. Clear the cache

  3. Load the PDF from your website

Upvotes: 5

NCode
NCode

Reputation: 2808

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.

Upvotes: 1

Bozho
Bozho

Reputation: 597164

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.

Upvotes: 2

JB Nizet
JB Nizet

Reputation: 691865

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.

Upvotes: 3

Related Questions