php 如何在浏览器中更改pdf选项卡标题
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/27652937/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to change pdf tab title in browser
提问by Waqas Khan
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.
我的 pdf 文件在浏览器选项卡中打开。在 pdf 选项卡的标题而不是名称中,它显示了我如何更改它的 url。我正在使用 codeigniter 框架并使用 Mpdf 库进行 pdf。
回答by Tigran Tokmajyan
Your PDF document should have Title metadata set. Afterwards, browser will use it for rendering tab title.
您的 PDF 文档应该设置了 Title 元数据。之后,浏览器将使用它来呈现选项卡标题。
回答by Chris Lewis
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.
在 Acrobat Pro 中,打开 PDF 并选择文件 -> 属性 -> 描述,然后根据需要编辑元数据标题(以及其他需要的内容)。
We only saw the title being displayed like this in Firefox.
我们只看到标题在 Firefox 中是这样显示的。
回答by Amr Berag
Put it in a div inside a page and change the page title like this:
将它放在页面内的 div 中并像这样更改页面标题:
<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.
您还可以设置对象的宽度和高度以匹配页面。