PDF 合并

元数据 · Metadata Privacy

分享前清除 PDF 元数据:一份 PDF 里藏着什么 / How to Remove PDF Metadata Before Sharing

作者名、公司名、时间戳、原始文件名,手机扫描件还带坐标。清除 PDF 元数据是发出文件前的最后一步,多数人从不做。

阅读约 8 分钟 · 8 min read

一句话结论 / Short answer

清除 PDF 元数据是发出文件前的最后一步,不是设置里勾一次的开关。你用来生成 PDF 的每个程序都会往里盖点东西:作者名、公司名、创建时间、修改时间、原始文件名,手机扫描件有时候还带坐标。这些信息不跟着页面内容显示,只跟着文件走,收件人打开属性面板就能看到,而多数人从不打开。

Removing PDF metadata before you send a file takes under a minute, and most people never do it. The cost shows up later: a proposal that still carries a former colleague's name as author, a contract draft whose timestamps put the drafting four months before it went out, a phone scan whose coordinates survive the export. Every application that writes a PDF stamps something into it, and almost nobody opens the properties panel afterwards.

判断顺序很短:先看这份 PDF 交给谁,再决定清到哪一档。交给外部的外发文件清到只剩必要字段;内部传的草稿可以留着协作信息;要走合规流程的,清除动作本身也要记一行,因为清掉的东西同样属于留痕范围。

The order of decisions is short. Look at who receives the file, then decide how far to strip it. A file going outside gets reduced to the fields it needs. A draft circulating inside can keep its collaboration details. Anything moving through a compliance process needs the stripping recorded too, since what you removed belongs to the same record. That last point is the one written up in /blog/pdf-file-audit-trail-requirements.

下面把元数据拆成八个字段,讲清每类清理方式停在什么地方,最后给一套当天能跑完的七步流程。

一份 PDF 里记了什么 / What a PDF records

八个字段按外泄后的麻烦程度排列,前面四个最常见,后面四个最容易被忽略。

Eight fields, ordered by how much trouble they cause once they leave. The first four are the common ones, and the last four are the ones people overlook.

字段常见内容外泄后的麻烦
作者 Author系统用户名,或首次安装时填的姓名外发文件上挂着离职同事或外包方的名字
公司 Company生成工具所属组织名暴露内部在用哪家软件
创建时间 CreationDate首次生成的时间时间与对外说法对不上
修改时间 ModDate最后一次保存的时间与文档落款日期冲突
生成工具 ProducerWord、LibreOffice、扫描 App 及版本暴露未打补丁的旧版本
原始文件名财务预测v3-最终版真的最终.pdf文件名里的内部代号全部外露
XMP 扩展字段自定义属性、修订记录、协作信息单条无害,合起来能拼出协作链
地理位置手机扫描件与部分相机 PDF 的坐标直接暴露拍摄地点

最后两行值得单独说。XMP 扩展字段单看一条没什么,合起来能拼出一份完整的协作名单和修改节奏;地理位置字段是唯一一条无法用常识推断出来的信息,它直接把拍摄地点交出去。

Those last two rows deserve a note. An XMP field means little on its own, and a set of them reconstructs the collaboration list and the revision rhythm. The location field is the one piece nobody could guess, and it hands over where the picture was taken.

三类清理方式停在哪里 / Where each method stops

清理 PDF 元数据的路子不多,差别集中在两件事上:清到哪一层停手,以及文件在这个过程中去了哪里。

There are few ways to clean PDF metadata, and they differ on two things: how deep they go before stopping, and where the file travels while it happens.

方式能清掉留下什么文件去哪
办公软件另存为改属性作者、标题、主题、关键词XMP 扩展字段、修订记录本机
桌面编辑器属性面板信息字典与多数 XMP 字段批注层、附件、隐藏文字层本机
在线元数据清理服务同上同上,另加服务方留有副本上传至对方服务器
浏览器本地处理信息字典与常见 XMP 字段需单独处理的批注与附件层全程本机

第三行的代价写在第四列。为了让别人帮你清一份文件里的名字,你先把整份文件交了出去,而那些名字里带着的信息本来就是你想守住的东西。这类取舍在 /blog/privacy-first-pdf-workflow 里按场景拆过一遍。

The cost of row three sits in column four. To have someone else remove the names from a file, you hand over the whole file first, and the names are exactly what you were protecting. That trade is broken down by scenario in /blog/privacy-first-pdf-workflow.

第四行也不是万能的。浏览器本地处理守住了文件去向,代价是批注层、附件层和隐藏文字层要单独动手,多数工具不会替你一并清掉。怎么自己验证文件没有外传,见 /blog/devtools-network-tab-privacy-guide。

作者名与常漏的四个字段 / Author name and four others

作者名清除是最常被做对一半的那件事。清完信息字典就以为结束了,剩下的四处还留着。

  1. 作者名:把系统用户名改成对外姓名,比事后逐个清更省事,新文件从生成时就带对的值
  2. 原始文件名:另存为之前先定名,内部代号不要进档
  3. 批注与修订:批注作者是独立字段,删掉批注内容不等于删掉作者名
  4. 嵌入附件:嵌在 PDF 里的 docx 自带一套元数据,主文件清干净它也还在
  5. 隐藏文字层:OCR 层与白字层不显示在页面上,全选复制就出来
  1. Author: changing the system username to the name you use outside beats clearing files one by one, and every new file then carries the right value from creation
  2. Original file name: settle the name before save-as, and keep internal codenames out of it
  3. Comments and revisions: a comment author is its own field, so deleting the comment text does not delete the name attached to it
  4. Embedded attachments: a docx sitting inside the PDF carries its own metadata, and it survives a clean main file
  5. Hidden text layers: the OCR layer and white-on-white text do not show on the page, and select-all plus copy brings them straight out

第一条改的是源头,其余四条只能逐个处理。改用户名的收益在时间上后置:下次重装系统或换机器时要记得再改一次。

发出去之前的七步 / Seven steps before sending

按顺序走完,第七步那行记录可以直接进外发清单。前三步解决清到什么程度,后四步解决清没清干净。

Run them in this order, and the line from step seven goes straight into the outbound checklist. The first three settle how far to strip; the last four settle whether the stripping worked.

  1. 先定接收方:外部、内部还是合规流程,这一档决定后面清到什么程度
  2. 另存一份副本,在副本上清理,原文件保留
  3. 清信息字典:作者、公司、标题、关键词、创建与修改时间
  4. 清 XMP 扩展字段与自定义属性
  5. 单独处理批注层、附件层和隐藏文字层
  6. 打开属性面板复查一遍,确认剩下的字段是有意留的
  7. 需要留痕的,把清理前后的字段清单连同时间记一行
  1. Fix the recipient first: outside, internal, or a compliance process, since that decides how far to strip
  2. Save a copy and clean the copy, keeping the original
  3. Clear the info dictionary: author, company, title, keywords, creation and modification dates
  4. Clear the XMP packet and any custom properties
  5. Handle the comment layer, attachments and hidden text separately
  6. Open the properties panel once more and confirm what remains is there on purpose
  7. Where a record is required, write one line with the before and after fields and the time

合并这一步在 pdfmergenext.shop 全程本地完成,挑页码、调页序、清元数据都不需要把文件交出去。第七步那行记录由你自己写,谁也替不了。挑页语法见 /blog/pdf-page-selection-1-3-5-syntax,加密文件的处理顺序见 /blog/encrypted-pdf-can-you-merge。

Merging on pdfmergenext.shop runs on your device, so selecting pages, reordering and clearing metadata never means handing the file over. The line from step seven is yours to write. Page selection syntax is in /blog/pdf-page-selection-1-3-5-syntax, and the order for encrypted files in /blog/encrypted-pdf-can-you-merge.

在 pdfmergenext.shop 本地合并并清掉元数据,文件不出本机 →

更多 PDF 隐私与合规的判断细节见 /blog,合并时元数据的去留规律见 PDF 元数据保留,外发前商业机密的那份清单见 商业机密保护,GDPR 选型前的检查项见 GDPR 合规 PDF 工具。

常见问题 / FAQ

清除元数据会让 PDF 打不开或者内容变形吗?

不会。元数据写在文件的信息字典和 XMP 包里,跟页面内容流是分开的两块。清掉它只影响属性面板里显示的那部分,页面文字、图片和版式都不动。真正会动到版式的是重新压缩或重新编码,那是另一回事。

为什么清了作者名,文件里还能搜出旧用户名?

因为作者名不止写在一处。信息字典里有一份,XMP 包里可能还有一份,批注的作者字段又是独立的。只清第一处的工具会留下另外两处。清完之后用文本搜索在文件里搜一次旧用户名,能搜到就说明还有地方没清。

合并前清还是合并后清?

合并后清。合并会重建文档信息字典,先清的几个文件各自的字段会被合并工具按自己的规则覆盖,白做一遍。合并成一份之后再清这一份,顺序与字段去留的差别见 /blog/pdf-metadata-preservation-merge。

扫描件也会带元数据吗?

会,而且内容更多。手机扫描 App 生成的 PDF 常带拍摄时间、设备型号,部分还带 GPS 坐标;扫描仪生成的可能带序列号。这类文件要单独看一遍坐标字段,普通另存为清不掉它。

Does removing metadata break the file or change how it looks?

No. Metadata lives in the info dictionary and the XMP packet, which are separate from the page content stream. Clearing it only changes what the properties panel shows, and the page text, images and layout are untouched. What does change layout is recompressing or re-encoding, which is a different job.

I cleared the author name, so why can the old username still be found?

Because the author is written in more than one place. One copy sits in the info dictionary, another may sit in the XMP packet, and the author of a comment is its own field. A tool that clears only the first leaves the other two. After clearing, search the file for the old username once; if it turns up, something was missed.

Should I strip before merging or after?

After. Merging rebuilds the info dictionary, so fields cleaned in the source files get overwritten by the merge tool's own rules and the work is wasted. Clean the one file that comes out, and the per-field behaviour of a merge is set out in /blog/pdf-metadata-preservation-merge.

Do scanned files carry metadata too?

They do, and often more of it. A PDF from a phone scanner usually carries capture time and device model, and some carry GPS coordinates. Scanner output may carry a serial number. Those files need a separate look at the location field, which an ordinary save-as will not remove.

相关阅读 / Related