作者GALINE (天真可爱CQD)
看板PHP
标题Re: [请益] 如何对Content-Disposition标头加下载标题?
时间Mon May 23 14:14:17 2016
※ 引述《red0whale (red whale)》之铭言:
: 假设我有一个PDF档叫test.pdf,该档存在http://www.example.com/download/里面
: 今天如果有人点进了这个PHP页面里头,就会自动下载这个PDF档案
: 我的这个页面被Google的「爬虫」找到了,并被放在他们的搜寻引擎资料库里
: 但是问题在:他们显示出来的结果标题居然显示「Untitled」,而且没有说明内容
: 明明我原先的PDF档(test.pdf)有标题啊,
: 为什麽他们搜寻出来的结果却是没有标题和说明内容呢?
: 请各位帮我解惑一下…
: 谢谢
今天很忙,直接贴我用了什麽关键字跟找到的结果
因为看不到你实际的档案,所以也不知道你是不是踩到这问题
「google search result pdf title」
https://www.google.com.tw/search?q=google+search+result+pdf+title
第一笔
https://webmasters.googleblog.com/2011/09/pdfs-in-google-search-results.html
Q: How can I influence the title shown in search results for my PDF document?
A: We use two main elements to determine the title shown: the title metadata
within the file, and the anchor text of links pointing to the PDF file.
To give our algorithms a strong signal about the proper title to use,
we recommend updating both.
关键句:
title metadata within the file
anchor text of links pointing to the PDF
PDF 档案有个标题设定(所以不是你第一行打很大的字他就知道那是标题)
连过去的连结文字
「pdf title metadata」
https://www.google.com.tw/search?q=pdf+title+metadata
第一笔
https://helpx.adobe.com/acrobat/using/pdf-properties-metadata.html
Choose File > Properties.
Click a tab in the Document Properties dialog box.
--
莉娜用魔法爆破进入屋内。
劫犯从另一个房间里出现,大叫道︰「你是谁!」
莉娜︰「我是个可疑的女人!」
劫犯无言以对。
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 60.248.122.206
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/PHP/M.1463984064.A.6AF.html
1F:→ AndCycle: 我实际 google 了几个pdf,实务上 google 现在好像是直接 05/24 02:25
2F:→ AndCycle: 读 pdf 内文的第一句话当标题, 其他资讯都不拿来用了 05/24 02:25
3F:→ GALINE: 我不太常处理PDF,不过经验是Google会同时看好几种资料 05/24 04:50
4F:→ GALINE: 就算是网页,也可能有时抓title有时抓内文有时自己组字串 05/24 04:51
5F:→ GALINE: 而「Untitled」这个字串不太可能是Google自组的,感觉满 05/24 04:52
6F:→ GALINE: 可能是从PDF的meta来,除非原文内文就有大大的Untitled... 05/24 04:53
7F:→ AndCycle: 原po的pdf打开是一张图, 原文就算有也是盖在图下面了 05/24 16:34
昨天眼花没看到实际档案....
从 Meta 看起来是有设定 Title,但是 PDF 里面真的是有图无字
看来真的是 Google 找不到他喜欢的文字所以把标题遮掉了.......
这样的话,在图片後面盖一段字可能能够让Google愿意改标题,可能...
※ 编辑: GALINE (60.248.122.206), 05/24/2016 22:11:42
8F:→ AndCycle: 你可以随便 google 几个 google 有标题的 pdf 05/25 00:15
9F:→ AndCycle: 你会发现一堆都 meta 乱设的, google 根本不爱读 meta 05/25 00:15