How to change pdf tab title in browser

My PDF file is open in a browser. In the title of the pdf tab, instead of the name, it shows the URL, how can I change it. I use the codeigniter framework and use the Mpdf library for pdf.

+6
source share
3 answers

Your PDF must have header metadata set. Subsequently, the browser will use it to display the tab title.

http://www.w3.org/TR/WCAG20-TECHS/PDF18.html

+7
source

In Acrobat Pro, open the PDF file and select โ€œFileโ€ โ†’ โ€œPropertiesโ€ โ†’ โ€œDescriptionโ€, and then edit the metadata header (and others, if necessary), as you wish.

We saw how the title is displayed in Firefox in this way.

+2
source

Place it in a div inside the page and change the page title as follows:

<head> <title>YOUR TAB TITLE</title> </head> 

and then:

 <div> <object data="test.pdf" type="application/pdf" width="300" height="200"> alt : <a href="test.pdf">test.pdf</a> </object> </div> 

You can also set the width and height of the object to fit the page.

Link

0
source

Source: https://habr.com/ru/post/980158/


All Articles