向 PDF 注释添加回复/评论 – Ghostscript

问题描述 投票:0回答:1

有没有办法使用 Ghostscript 添加回复/评论到现有的 PDF 注释?我找不到有关我的研究的有用信息。

为什么? 我有德语文本以及使用 DeepL API 将其翻译成英语的内容。翻译后的文本应添加到原始 PDF 注释中作为回复/评论。

在测试文档中,我会从该响应/评论中找到标记。但我找不到任何如何在 Ghostscript 中处理它的例子。我有兴趣自动添加回复/评论。

我认为在类似的地方添加新注释不是一个好主意。概述将会受到影响。

ghostscript
1个回答
0
投票

对评论进行二次回复的问题之一是它们不会使页面混乱,因此在打开其父评论之前是看不到的。然而,它们可以轻松导出和导入以进行协作工作。

如果我们的初始文件仅包含父评论,我们可以打开该文件并导入辅助回复,

或更简单的打开辅助评论数据文件,它将导入父 PDF

最大的问题是如何编写评论数据文件,所以这里是一个简单的例子。您可以在其中看到第一条评论的名称为

NM(810b4c82-e36d-4ecf-86f5-a53ba1b4656b)
,回复为 IRT(回应)
/IRT(810b4c82-e36d-4ecf-86f5-a53ba1b4656b)

%FDF-1.2
%âãÏÓ
1 0 obj
<</FDF<</Annots[2 0 R 3 0 R 4 0 R]/F(/C/Users/lez/Downloads/simple1 \(mu1a\).pdf)/ID[<><>]/UF(/C/Users/lez/Downloads/simple1 \(mu1a\).pdf)>>/Type/Catalog>>
endobj
2 0 obj
<</BS<</Type/Border/W 0>>/C[1 1 0]/Contents(This is a text box comment)/DA(/Helv 12 Tf 0 0 0 rg)/DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#000000 )/F 4/M(D:20231011212158+01'00')/NM(810b4c82-e36d-4ecf-86f5-a53ba1b4656b)/Page 0/RC(<?xml version="1.0"?><body xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/" xfa:APIVersion="Acrobat:23.6.0" xfa:spec="2.0.2"  style="font-size:12.0pt;text-align:left;color:#000000;font-weight:normal;font-style:norma\
l;font-family:Helvetica,sans-serif;font-stretch:normal"><p>This is a text box comment</p></body>)/Rect[360.784 695.791 522.724 714.52]/Subtype/FreeText/T( )/Type/Annot>>
endobj
3 0 obj
<</C[1.0 0.0 0.0]/Contents(Dies ist eine Antwort auf einen Textfeldkommentar und kann daher in einer anderen Sprache verfasst sein)/CreationDate(D:20231011211528+01'00')/F 28/IRT(810b4c82-e36d-4ecf-86f5-a53ba1b4656b)/M(D:20231011211943+01'00')/NM(a34807a7-9440-4631-8ef8-73421cb57e10)/Name/Comment/Page 0/Popup 4 0 R/RC(<?xml version="1.0"?><body xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/" xfa:APIVersion="Acrobat:23.6.0" xfa:spec="2.0.2" ><p dir="ltr"><span dir="ltr" style="font-size:9.9pt;text-align:left;color:#000000;font-we\
ight:normal;font-style:normal">Dies ist eine Antwort auf einen Textfeldkommentar und kann daher in einer anderen Sprache verfasst sein</span></p></body>)/Rect[360.784 690.52 384.784 714.52]/Subj(Note1)/Subtype/Text/Type/Annot>>
endobj
4 0 obj
<</F 28/Open true/Page 0/Parent 3 0 R/Rect[612.0 622.52 796.0 714.52]/Subtype/Popup/Type/Annot>>
endobj
trailer
<</Root 1 0 R>>
%%EOF
© www.soinside.com 2019 - 2024. All rights reserved.