如何在 PDF 文件的每一页上应用水印?

Nar*_*rek 22 pdf watermark

我有一个 PDF 文件,想在所有页面上以 45 度角应用如下水印:

watermark watermark watermark watermark watermark watermark watermark
watermark watermark watermark watermark watermark watermark watermark
watermark watermark watermark watermark watermark watermark watermark
watermark watermark watermark watermark watermark watermark watermark
watermark watermark watermark watermark watermark watermark watermark
watermark watermark watermark watermark watermark watermark watermark
........................
Run Code Online (Sandbox Code Playgroud)

我怎样才能做到这一点?

Yar*_*hiy 20

您可以按照本答案中的说明使用pdftk。示例命令行:

pdftk original.pdf stamp watermark.pdf output final.pdf
Run Code Online (Sandbox Code Playgroud)

如果您使用的是 Linux,这会特别方便,因为 pdftk 包含在许多流行的发行版中。

对于 Windows 用户,还有免费的 GUI 版本可用。

更多选择

您可以使用background命令将其添加为背景,而不是在原始文档上加盖水印(原始 pdf 必须是透明的)。还可以应用多页水印。以下是相关命令的文档:

  background <background PDF filename | - | PROMPT>
     Applies a PDF watermark to the background of a single input
     PDF.  Pass the background PDF's filename after background
     like so:

     pdftk in.pdf background back.pdf output out.pdf

     Pdftk uses only the first page from the background PDF and
     applies it to every page of the input PDF.  This page is
     scaled and rotated as needed to fit the input page.  You can
     use - to pass a background PDF into pdftk via stdin.

     If the input PDF does not have a transparent background (such
     as a PDF created from page scans) then the resulting back-
     ground won't be visible -- use the stamp operation instead.

  multibackground <background PDF filename | - | PROMPT>
     Same as the background operation, but applies each page of
     the background PDF to the corresponding page of the input
     PDF.  If the input PDF has more pages than the stamp PDF,
     then the final stamp page is repeated across these remaining
     pages in the input PDF.

  stamp <stamp PDF filename | - | PROMPT>
     This behaves just like the background operation except it
     overlays the stamp PDF page on top of the input PDF docu-
     ment's pages.  This works best if the stamp PDF page has a
     transparent background.

  multistamp <stamp PDF filename | - | PROMPT>
     Same as the stamp operation, but applies each page of the
     background PDF to the corresponding page of the input PDF.
     If the input PDF has more pages than the stamp PDF, then the
     final stamp page is repeated across these remaining pages in
     the input PDF.
Run Code Online (Sandbox Code Playgroud)

  • 这很好,也很正确,但我花了很长时间试图让它发挥作用……结果他们网站上的 Mac 版本自 2016 年以来就被破坏了,而他们有一个有效的修复程序……呃。请参阅此堆栈溢出答案,这可能会为其他 Mac 用户(例如我自己)节省一些时间,这些用户可能会遇到您的答案:/sf/ask/2782561841/ (2认同)
  • 请注意,Windows 的免费版本*不* 支持水印。这仅在专业版中可用。 (2认同)

小智 9

使用qpdf

qpdf --overlay overlay.pdf --repeat=1 -- input.pdf output.pdf
Run Code Online (Sandbox Code Playgroud)

或者

qpdf --underlay underlay.pdf --repeat=1 -- input.pdf output.pdf
Run Code Online (Sandbox Code Playgroud)

请参阅文档


cev*_*ing 0

创建带有水印的 PDF 并使用此类工具在原始 PDF 上加盖印记:http://pdftools.softonic.de/