I am working on a Drupal site with some PDF files where I am opening a PDF file in a new window. The files are getting opened in the browser with the Acrobat Reader plugin but the favicon is not getting displayed. What should be done to show the favicon?
The problem of course is that pdf is not html and therefor there is no way to specify a favicon specifically for a single PDF file.
The first method to embed pdf in html is by making use of the object tag in html. The object defines the object that is to be embedded in the page, which in this case is the pdf file to be displayed on the web page, of course.
To add a favicon to your website, either save your favicon image to the root directory of your webserver, or create a folder in the root directory called images, and save your favicon image in this folder. A common name for a favicon image is "favicon.ico".
If you put a favicon.ico
to the root of your site, then your PDFs opened on that site will actually have that favicon. You can generate transparent ICOs from PNGs with online favicon genereators.
For example, if your favicon is reachable in:
http://example.com/favicon.ico
Then your PDF will show this favicon in the Acrobat plugin tab:
http://example.com/something/something.pdf
If you show the PDF file in an iframe
, the browser should show the site-wide favicon, but you're out of luck in an external applications. Acrobat Reader doesn't use Favicons.
UPDATE This is now possible by placing favicon.ico in the root directory of your website as per @s1m0n1stv4n answer below
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With