JavaScriptを利用した時の注釈の文字色を変えたい お世話になります。PDFにファイル名を入れて印刷したくて、ChatGPTに頼って試行錯誤しているのですが、文字色のところで、どうにもなりません。JavaScriptを使用する場合、文字の色は、今設定しているプロパティの設定値でしかどうにもならないのでしょうか?作業環境(古いのは重々承知なのでツッコミはご遠慮ください)MacOS10.14.5Build: 22.1.20112.0以下、ChatGPTの回答です。-------------------------------対処法:プロパティを完全リセットして黒文字で上書きする次のコードは、addAnnot 後に内部 appearance を再描画して強制的に黒文字に変更します。この方法だと、どんな注釈プロパティを持っていても確実に黒になります。 if (this.documentFileName) {var fileName = this.documentFileName;for (var i = 0; i < this.numPages; i++) {var rect = this.getPageBox("Crop", i);var left = rect[0] + 10;var top = Math.max(rect[1], rect[3]) - 20;// 注釈を追加var annot = this.addAnnot({type: "FreeText",page: i,rect: [left, top - 12, left + 400, top],contents: fileName,strokeColor: color.transparent,fillColor: color.transparent,alignment: 0,textFont: "HeiseiKakuGo-W5",textSize: 9});if (annot) {// appearance を完全リセットして黒文字で強制描画annot.textColor = color.black;annot.strokeColor = color.transparent;annot.fillColor = color.transparent;annot.defaultAppearance = "/HeiseiKakuGo-W5 9 Tf 0