THotPDF.SetLoadedAnnotationContents Method
修改已載入 PDF 檔案指定頁面中某條註解的 Contents 欄位文字,用於更新批註的可見文字內容/Contents string and invalidates its page's render cache
This method preserves the existing appearance and rich text; changing /Contents alone does not rebuild visible FreeText text in /AP
宣告
procedure SetLoadedAnnotationContents(PageIndex, AnnotationIndex: Integer; const AContents: AnsiString);
單元
HPDFDoc
參數
| 名稱 | 用途 |
|---|---|
PageIndex | 目標頁面的從零開始的索引 |
AnnotationIndex | 頁面註解陣列中目標註解的從零開始的索引 |
AContents | 要寫入註解 Contents 項目的新文字字串 |
使用注意事項
此成員不傳回值
使用說明
- Contents 欄位是註解的主要文字內容,对於 Text 和 FreeText 註解類型,它直接顯示為註解气泡中的文字
- 部分註解類型(如連結註解)不顯示 Contents,設定此值對那些類型無視覺效果
SetLoadedFreeTextPlainTextwhen explicitly converting a supported FreeText annotation to a new visible ASCII Helvetica appearance - 修改完成後須呼叫儲存方法才能持久化更改
SetLoadedFreeTextRichTextfor the separate rich-text metadata workflow