温馨提示:这篇文章已超过526天没有更新,请注意相关的内容是否还可用!
1、首先需要安装adobe acrobat Pro,下载地址:httPs://pan.bAIdu.com/s/1PD1sCryujYjjsJRDVqo6yw?pwd=0q99
2、用adobe acrobat Pro打开PDF文件
3、在“工具 ”-“JavaScript”-“文档级 JavaScript”中,添加 JavaScript脚本,可将pdf书签导出为PDF格式带页码的目录页。
function PrintBookmarks(bm, nLevel)
{
if (nLevel != 0) { // don't print the root
bmReport.absIndent=bmTab*(nLevel-1);
bm.execute();
bmReport.writeText(bm.name+".........."+(bm.doc.pageNum +1));
}
if (bm.children != null)
for (var i = 0; i < bm.children.length; i++)
PrintBookmarks(bm.children[i], nLevel + 1);
}
bmTab = 20;
bmReport = new Report();
bmReport.size = 2;
bmReport.writeText(this.title);
bmReport.writeText(" ");
bmReport.size = 1.5;
bmReport.writeText("目录");
bmReport.writeText(" ");
bmReport.size = 1;
PrintBookmarks(this.bookmarkRoot, 0);
global.bmRep = bmReport; // make global
global.wrtDoc = app.setInterval(
'try {'
+' reportDoc = global.bmRep.open("Listing of Bookmarks");'
+' console.println("Executed Report.open");'
+' app.clearInterval(global.wrtDoc);'
+' delete global.wrtDoc;'
+' console.println("Executed App.clearInterval");'
+' reportDoc.info.title = "Bookmark Listings";'
+' reportDoc.info.Author = "List Bookmark Sequence";'
+'} catch (e) {console.println("Waiting...: " + e);}'
, 100);
还没有评论,来说两句吧...