如何使用“pdftk”指定附件的描述?
PDFTK的文档中没有提到如何做到这一点。该命令:
pdftk file.pdf attach_files attachDoc.pdf to_page 2 output -
将一个文件附加到原始 file.pdf
的第 2 页,并将结果输出到
。
attachDoc.pdf
是文件系统的文件名。但我无法为此指定任何描述,以使用适当的符号描述在最终文件中显示附件。
这将特别有用,因为在自动生成操作中,附件通常具有由服务器分配的临时名称,并且需要描述
有什么方法可以做到这一点吗?
In the documentation of PDFTK is not mentioned how to do it. The command:
pdftk file.pdf attach_files attachDoc.pdf to_page 2 output -
will attach a file to page 2 of the original file.pdf
and output the result to <stdout>
.
attachDoc.pdf
is the file name of the filesystem. But I can not specify any description for this to show the attachment in the final file with an appropriate notation-description.
This would be especially useful, as in the automatic generation operations, the attachments often have temporary names assigned by the server and a description would be necessary
Is there any way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
简短回答:
更长的答案:
在(最近的一个的版本)Ghostscript。 但是请注意,它非常复杂!
它需要使用特殊的 PostScript 扩展来定义
pdfmark
运算符。创建此运算符的目的是将高级功能插入到 PDF 文件中,而这些功能不能在 PostScript 本身中使用。我将借助一个单独的文件进行演示,该文件使用一系列
pdfmark
操作将文本文件插入 PDF。这是文本文件mypdfmark-for-attachments.ps
的内容:如您所见,
/Desc
键保存我的描述文本dEsCrIpTiOn
>。现在运行此 Ghostscript 命令:
这是 Acrobat 显示的生成的 PDF 文件的屏幕截图:
Short answer:
Longer answer:
You may be able to achieve what you want with the help of (a very recent version of) Ghostscript. But be warned, it is quite complicated!
It requires the usage of the special PostScript extension that defines the
pdfmark
operator. This operator was created to insert advanced features into a PDF file which cannot be used within PostScript itself.I'll demonstrate it with the help of a separate file which uses a series of
pdfmark
operations to insert a text file into a PDF. This is the content of text file,mypdfmark-for-attachments.ps
:As you can see, the
/Desc
key holds my description textdEsCrIpTiOn
.Now run this Ghostscript command:
Here is a screenshot of the resulting PDF file as shown by Acrobat: