如何将状态设置为 PDAnnotationTextMarkup?
How to set state to a PDAnnotationTextMarkup?
我想在注释中添加状态,如下图所示
https://imgur.com/a/ZGeQo(抱歉,我需要至少 10 个声望才能 post 张图片)
我试试这个
PDAnnotationTextMarkup a= new PDAnnotationTextMarkup(PDAnnotationTextMarkup.SUB_TYPE_HIGHLIGHT);
a.getCOSObject().setString(COSName.STATE, "Completed");
但这不起作用。
根据 PDF 规范 ISO 32000-2:
12.5.6.3 Annotation states
Beginning with PDF 1.5, annotations may have an author-specific state associated with them. The state is not specified in the annotation itself but in a separate text annotation that refers to the original annotation by means of its IRT ("in reply to") entry (see "Table 176 — Additional entries specific to a link annotation"). States shall be grouped into a number of state models, as shown in "Table 174 — Annotation states".
State changes made by a user shall be indicated in a text annotation with the following entries:
- The T entry (see "Table 172 — Additional entries in an annotation dictionary specific to markup annotations") shall specify the user.
- The IRT entry (see "Table 176 — Additional entries specific to a link annotation") shall refer to the original annotation.
- State and StateModel (see "Table 175 — Additional entries specific to a text annotation") shall update the state of the original annotation for the specified user.
Additional state changes shall be made by adding text annotations in reply to the previous reply for a given user.
Table 174 — 注释状态 — 包含例如状态模型“Review”中状态“Completed”的条目。
因此,您必须通过添加新的文本注释来设置状态,以使用状态信息回复先前对注释的回复(或者,缺少它,回复注释本身)。
我想在注释中添加状态,如下图所示
https://imgur.com/a/ZGeQo(抱歉,我需要至少 10 个声望才能 post 张图片)
我试试这个
PDAnnotationTextMarkup a= new PDAnnotationTextMarkup(PDAnnotationTextMarkup.SUB_TYPE_HIGHLIGHT);
a.getCOSObject().setString(COSName.STATE, "Completed");
但这不起作用。
根据 PDF 规范 ISO 32000-2:
12.5.6.3 Annotation states
Beginning with PDF 1.5, annotations may have an author-specific state associated with them. The state is not specified in the annotation itself but in a separate text annotation that refers to the original annotation by means of its IRT ("in reply to") entry (see "Table 176 — Additional entries specific to a link annotation"). States shall be grouped into a number of state models, as shown in "Table 174 — Annotation states".
State changes made by a user shall be indicated in a text annotation with the following entries:
- The T entry (see "Table 172 — Additional entries in an annotation dictionary specific to markup annotations") shall specify the user.
- The IRT entry (see "Table 176 — Additional entries specific to a link annotation") shall refer to the original annotation.
- State and StateModel (see "Table 175 — Additional entries specific to a text annotation") shall update the state of the original annotation for the specified user.
Additional state changes shall be made by adding text annotations in reply to the previous reply for a given user.
Table 174 — 注释状态 — 包含例如状态模型“Review”中状态“Completed”的条目。
因此,您必须通过添加新的文本注释来设置状态,以使用状态信息回复先前对注释的回复(或者,缺少它,回复注释本身)。