Copy link to clipboard
Copied
Hi there!
I'm looking into removing specific bookmarks (repeated) from a bulk invoice PDF which is generated by our e-commerce platform automatically (300 invoices in one PDF file).
As you see there are two top level bookmarks in each invoice, I'm trying to figure how to remove all the "Ordered products" bookmarks with a script, so that I could use the Split function to split all 300 invoices by Top Level of Bookmarks.
I know:
this.bookmarkRoot.remove(); would remove everything
and I have tried:
this.bookmarkRoot.remove("Ordered products"); which did not work
Anyone could please help me the novice here ? 🙂
Thank you so much in advance!
You can use this code to achieve it:
for (var i=this.bookmarkRoot.children.length-1; i>=0; i--) {
var bkm = this.bookmarkRoot.children[i];
if (bkm.name=="Ordered products") bkm.remove();
}
Copy link to clipboard
Copied
You can use this code to achieve it:
for (var i=this.bookmarkRoot.children.length-1; i>=0; i--) {
var bkm = this.bookmarkRoot.children[i];
if (bkm.name=="Ordered products") bkm.remove();
}
Copy link to clipboard
Copied
That's so cool, works perfectly! Thank you so much for helping out!