Waqas Khan
Waqas Khan

Reputation: 257

How to change pdf tab title in browser

My pdf file is open in browser tab. In the title of pdf tab instead of name it shows the url how can i changed it .I am using codeigniter framework and using Mpdf library for pdf.

Upvotes: 10

Views: 31342

Answers (5)

Anupam Hayat Shawon
Anupam Hayat Shawon

Reputation: 153

If you use TCPDF to create your PDF, you just need to add a title to the PDF as follows:

$pdf->SetTitle('My Title');

For MPDF it is

$mpdf->SetTitle('My Title');

Upvotes: 0

Suresh Kamrushi
Suresh Kamrushi

Reputation: 16086

For changing PDF tab title in browser, you need to update "title" in property.

If you have PDF editor you can do it easily. Else it is not editable.

You can use any of the tool online to edit the title.
I did it using below link.

https://www.sejda.com/edit-pdf-metadata

Upvotes: 0

Amr Berag
Amr Berag

Reputation: 1108

Put it in a div inside a page and change the page title like this:

<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 object width and height to match the page.

Reference

Upvotes: 1

Chris Lewis
Chris Lewis

Reputation: 1325

In Acrobat Pro, open the PDF and select File -> Properties -> Description and then edit the meta data title (and others if required) as you see fit.

We only saw the title being displayed like this in Firefox.

Upvotes: 2

toktik
toktik

Reputation: 1957

Your PDF document should have Title metadata set. Afterwards, browser will use it for rendering tab title.

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

Upvotes: 11

Related Questions