Hi
I created a java script to bookmark every page as per below. It works fine but when I then try to split the file by bookmarks level using PDF SPLIT AND MERGE ENHANCED software, then it doesn't work. If I create the bookmarks by adding them manually, then the PDF SPLIT AND MERGE enhanced software works fine. Any ideas why my bookmarks created by the script are different to the ones created manually. Here is the script I have created from a sample I found on the web.
if (app.viewerVersion < 10) {
app.addMenuItem({ cName: "Create bookmarks for every page", cUser: "Create bookmarks for every page", cParent: "Tools",
cExec: "Createbookmarksforeverypage(this)", cEnable: "event.rc = (event.target != null);"});
} else {
app.addToolButton({ cName: "Create bookmarks for every page", cLabel: "Create bookmarks for every page", cTooltext: "Create bookmarks for every page",
cExec: "Createbookmarksforeverypage(this)", cEnable: "event.rc = (event.target != null);"});
}
/* Create bookmarks for every page in the document */
// Double slash at front of line is a comment
function Createbookmarksforeverypage(doc) {
var root = this.bookmarkRoot;
j = 0;
try {
for (var i = 0; i < this.numPages; i += 1)
{
if (i == 0) {
root.createChild((i+1), "this.pageNum=" + i, i);
j = 1;
} else {
root.createChild((j+1), "this.pageNum=" + i, i);
j = j + 1;
}
}
}
catch(e)
{
app.alert("Processing error: "+e)
}
}