简体   繁体   English

如何将.pdf文档的标题显示为页面标题?

[英]How do I get the title of a .pdf document to appear as the page title?

I'm posting a PDF at a website and have a link pointing to it, the same as any other file. 我在网站上发布PDF并有一个指向它的链接,与任何其他文件相同。 If the browser is capable, it displays the PDF in a new tab. 如果浏览器有能力,它会在新选项卡中显示PDF。 But the URL (and an unwieldy one at that) is showing up on the top of the tab where the document title usually goes. 但是URL(以及一个笨拙的URL)显示在文档title通常所在的选项卡的顶部。 Do PDF files have a parameter for this I can adjust? PDF文件有一个参数,我可以调整吗? Or is there a way to wrap the file in something that does? 或者有没有办法将文件包装成有效的东西?

(I've tried checking "display document title" in Acrobat's options, that doesn't do it.) (我已经尝试在Acrobat的选项中检查“显示文档标题”,但没有这样做。)

I don't think this is something you can control within the PDF itself. 我不认为这是你可以在PDF本身控制的东西。 It's controlled by the web app serving the PDF, and your browser's PDF plugin, which will most likely just use the PDF's URL as the <title> . 它由服务于PDF的Web应用程序和浏览器的PDF插件控制,该插件很可能只使用PDF的URL作为<title> The filename of the served PDF can specified by the web app by setting a content-disposition header in the HTTP response, but again this isn't something you can control. 服务PDF的文件名可以由Web应用程序通过在HTTP响应中设置content-disposition标头来指定,但同样这不是您可以控制的。

The text that is displayed in the browser tab has nothing to do with the PDF -- other than it's the URL of the PDF. 浏览器选项卡中显示的文本与PDF无关 - 除了它是PDF的URL。 That info you're seeing is controlled by the web page and by the browser. 您看到的信息由网页和浏览器控制。 You cannot change it by making any changes to the PDF. 您无法通过对PDF进行任何更改来更改它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM