How to change pdf tab title in browser

前端 未结 4 1726
春和景丽
春和景丽 2020-12-11 16:54

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 fo

相关标签:
4条回答
  • 2020-12-11 17:12

    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.

    0 讨论(0)
  • 2020-12-11 17:22

    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

    0 讨论(0)
  • 2020-12-11 17:35

    Try this. It's so simple.

    $mpdf->SetTitle('My Title');
    
    0 讨论(0)
  • 2020-12-11 17:36

    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

    0 讨论(0)
提交回复
热议问题