跳到正文

添加页码

以你选择的格式和位置为页面编号。

在你的设备上处理

这款工具完全在你的浏览器中运行。文件从不上传,你可以在浏览器的网络标签中亲自验证这一点。 亲自验证:打开浏览器的网络标签观察。你会看到一个查询你是否还有剩余任务的小请求,只包含工具名称和一段哈希,绝不会包含文件。

这款工具的作用

This draws a number onto each page in the position you choose. The text goes into the page's content stream, so it is part of the document afterwards and prints exactly as it appears. The format is a template rather than a list of presets, which is why Page {page} of {pages}, - {page} - and {ROMAN} are all the same feature.

Use it on anything that will be printed, filed or referred to by page: a contract where the parties need to point at page 14, a scanned bundle that arrived unnumbered, or a report assembled from several separate files.

工作原理

  1. Drop the PDF onto this page.
  2. Type the format. A bare {page} is the default; Page {page} of {pages} and {ROMAN} work the same way.
  3. Choose one of the six positions - three across the top, three across the foot.
  4. Set Start counting at if the numbering should not begin at 1, and First numbered page if the opening pages should stay unmarked.
  5. Adjust the size, colour and margins if the number lands too close to the existing content.
  6. Press Add page numbers and the download starts.

The template understands a small vocabulary and leaves everything else alone. {page} is the number and {pages} the total; {roman} and {ROMAN} give i and I; {alpha} and {ALPHA} give a and A in spreadsheet order; {page+1} and {page-2} shift the printed value. {filename}, {title} and {author} come from the document itself, and {date}, {time} and {datetime} from the clock. Anything else between braces is printed as typed, so a mistyped {pge} shows up on the page where you can see and fix it rather than vanishing.

Start counting at is the number printed on the document's own first page, and the count runs up from there: set it to 25 and page 1 reads 25, page 2 reads 26. {pages} moves with it, so Page {page} of {pages} stays arithmetically true when one document continues another's numbering.

First numbered page does a different job - it decides which page first receives a mark, without changing what that mark says. Set it to 4 and pages 1 to 3 stay clean while page 4 still reads 4. If you want the fourth page to read 1, split the front matter off, number the body on its own, then merge the two back together.

The number is drawn on top of whatever is already there, and the page is never shrunk to make room, because scaling a page changes every measurement in it to solve a problem you can see. If a number lands on existing content, raise the vertical margin, drop the size, or move it to another corner.

The font is always embedded, so accented characters, Greek and Cyrillic print correctly on any reader. CJK, Arabic and Indic are not covered; the fonts that would cover them run to tens of megabytes each.

这款工具做不到的事

  • Numbers that are already printed in the document are neither found nor replaced. A page that carries its own number will show two unless you place the new one somewhere else, or remove the old numbering another way first.

常见问题

格式框里可以放什么?
任意文本,加上花括号中的占位符:{page}、{pages}、{roman}、{ROMAN}、{alpha}、{ALPHA}、诸如 {page+1} 的偏移量,以及 {filename}、{title}、{author}、{date}、{time}、{datetime}。第 {page} 页,共 {pages} 页 会打印成 第 3 页,共 12 页;- {ROMAN} - 会打印成 - III -。不在该列表中的占位符会原样打印。
怎样让封面页不带页码?
把“首个编号页”设为 2。第 1 页保持干净,编号从第 2 页开始,而它仍显示 2,因为计数跟随文档自身的页面位置。如果你想让第二页显示 1,请把封面拆分出去,为其余部分编号,再合并回来。
我能用罗马数字或字母吗?
能。{roman} 给出 i、ii、iii,{ROMAN} 给出 I、II、III;{alpha} 和 {ALPHA} 给出 a、b、c 和 A、B、C,过了第二十六页会继续到 aa。罗马数字在超过 3,999 时会重复 M,这是通常的惯例,因为古典的上划线需要一个不能指望任何字体都有的字形。
文档已经有页码了,它们会被替换吗?
不会。新页码绘制在页面之上,旧的仍留在其生成者放置的地方。把新页码放到另一个角落,或使用一个页面范围,让只有需要的页面才获得页码。
为文档编号会上传它吗?
不会。编号由 pdf-lib 在你设备上的 Web Worker 中完成,它嵌入的字体来自本站自己的源,而不是字体 CDN,所以连那都不是向他人发出的请求。一份 500 页的文档编号时不会有一个字节离开你的机器。

相关工具