Hy everybody,
i need some help in Acrobat X and Scripting: I need to export the bookmarks of a .pdf-File which I made myself to Excel or .txt.
I found a script at www.evermap.com/javascript.asp as follows:
/* Create a bookmark report */
function PrintBookmark(Report, bm, nLevel)
{
// write a name of the bookmark
var inch = 72;
Report.writeText(bm.name);
// process children
if (bm.children != null)
{
Report.indent(inch/2);
for (var i = 0; i < bm.children.length; i++)
{
PrintBookmark(Report, bm.children[i], nLevel + 1);
}
Report.outdent(inch/2);
}
}
var root = this.bookmarkRoot;
var Report = new Report();
PrintBookmark(Report, root, 0);
// Change output path for the report
Report.save("/c/myreport.pdf");
If I copy this as "printbookmark.js" in the javascript-Folder and start the javascript-debugger in Acrobat, the following Error occurs:
bm is undefined
9:Folder-Level:App:PrintBookmark.js
TypeError: bm is undefined
9:Folder-Level:App:PrintBookmark.js
I think, i need to define "bm". But how can I do this?
Thanks for the replys in forward and sorry for my bad english,
Stefan
you don't have to reinvent the wheel!
Try this first : http://acrobatusers.com/content/create-bookmark-report
;-)
abracadabraPDF.net