Last active
April 6, 2023 21:54
-
-
Save UskeS/524d4a9c368c6c2fdf273cfa790a95c4 to your computer and use it in GitHub Desktop.
[Acrobat]コメントを抽出してテキストファイルに書き出すAcrobat用スクリプト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var result = []; | |
for (var i = 0; i < numPages; i++) { | |
var annot = getAnnots(i); // ページに含まれる注釈コメント | |
if (!annot) { continue; } // nullが返ることがあるのでFalsyなら飛ばす | |
for (var j = 0, lenAnnot = annot.length; j < lenAnnot; j++) { | |
var myAnnots = []; | |
myAnnots.push("p." + (annot[j].page + 1)); | |
myAnnots.push(annot[j].contents.replace(/\r/g, "<br>")); | |
result.push(myAnnots.join("\t")); // 区切り文字 | |
} | |
} | |
exportTxtFile("hoge.txt", result.join("\r")); | |
function exportTxtFile(fileName, value) { | |
createDataObject({cName: fileName, cValue: value}); | |
exportDataObject({cName: fileName}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment